Skip to content

Commit 67714ae

Browse files
committed
Add action for MSYS2 builds.
1 parent ad45981 commit 67714ae

File tree

1 file changed

+117
-0
lines changed

1 file changed

+117
-0
lines changed

.github/workflows/dynamic_arch.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,120 @@ jobs:
101101
cd build
102102
cmake -DDYNAMIC_ARCH=1 -DNOFORTRAN=0 -DBUILD_WITHOUT_LAPACK=0 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release ..
103103
make -j$(nproc)
104+
105+
106+
msys2:
107+
runs-on: windows-latest
108+
109+
strategy:
110+
fail-fast: false
111+
matrix:
112+
msystem: [MINGW64, MINGW32, CLANG64]
113+
idx: [int32, int64]
114+
include:
115+
- msystem: MINGW64
116+
idx: int32
117+
target-prefix: mingw-w64-x86_64
118+
fc-pkg: mingw-w64-x86_64-gcc-fortran
119+
- msystem: MINGW32
120+
idx: int32
121+
target-prefix: mingw-w64-i686
122+
fc-pkg: mingw-w64-i686-gcc-fortran
123+
- msystem: CLANG64
124+
idx: int32
125+
target-prefix: mingw-w64-clang-x86_64
126+
c-lapack-flags: -DC_LAPACK=ON
127+
- msystem: MINGW64
128+
idx: int64
129+
idx64-flags: -DBINARY=64 -DINTERFACE64=1
130+
target-prefix: mingw-w64-x86_64
131+
fc-pkg: mingw-w64-x86_64-gcc-fortran
132+
- msystem: CLANG64
133+
idx: int64
134+
idx64-flags: -DBINARY=64 -DINTERFACE64=1
135+
target-prefix: mingw-w64-clang-x86_64
136+
c-lapack-flags: -DC_LAPACK=ON
137+
exclude:
138+
- msystem: MINGW32
139+
idx: int64
140+
141+
defaults:
142+
run:
143+
# Use MSYS2 bash as default shell
144+
shell: msys2 {0}
145+
146+
env:
147+
CHERE_INVOKING: 1
148+
149+
steps:
150+
- name: Get CPU name
151+
shell: pwsh
152+
run : |
153+
Get-CIMInstance -Class Win32_Processor | Select-Object -Property Name
154+
155+
- name: Install build dependencies
156+
uses: msys2/setup-msys2@v2
157+
with:
158+
msystem: ${{ matrix.msystem }}
159+
update: true
160+
release: false # Use pre-installed version
161+
install: >-
162+
base-devel
163+
${{ matrix.target-prefix }}-cc
164+
${{ matrix.fc-pkg }}
165+
${{ matrix.target-prefix }}-cmake
166+
${{ matrix.target-prefix }}-ninja
167+
${{ matrix.target-prefix }}-ccache
168+
169+
- name: Checkout repository
170+
uses: actions/checkout@v3
171+
172+
- name: Compilation cache
173+
uses: actions/cache@v2
174+
with:
175+
# It looks like this path needs to be hard-coded.
176+
path: C:/msys64/home/runneradmin/.ccache
177+
# We include the commit sha in the cache key, as new cache entries are
178+
# only created if there is no existing entry for the key yet.
179+
key: ccache-msys2-${{ matrix.msystem }}-${{ matrix.idx }}-${{ github.ref }}-${{ github.sha }}
180+
# Restore a matching ccache cache entry. Prefer same branch.
181+
restore-keys: |
182+
ccache-msys2-${{ matrix.msystem }}-${{ matrix.idx }}-${{ github.ref }}
183+
ccache-msys2-${{ matrix.msystem }}-${{ matrix.idx }}
184+
185+
- name: Configure ccache
186+
# Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota.
187+
run: |
188+
which ccache
189+
test -d ~/.ccache || mkdir -p ~/.ccache
190+
echo "max_size = 250M" > ~/.ccache/ccache.conf
191+
echo "compression = true" >> ~/.ccache/ccache.conf
192+
ccache -s
193+
echo $HOME
194+
cygpath -w $HOME
195+
196+
- name: Configure OpenBLAS
197+
run: |
198+
mkdir build && cd build
199+
cmake -DBUILD_SHARED_LIBS=ON \
200+
-DBUILD_STATIC_LIBS=ON \
201+
-DDYNAMIC_ARCH=ON \
202+
-DUSE_THREAD=ON \
203+
-DNUM_THREADS=64 \
204+
-DTARGET=CORE2 \
205+
${{ matrix.idx64-flags }} \
206+
${{ matrix.c-lapack-flags }} \
207+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
208+
-DCMAKE_Fortran_COMPILER_LAUNCHER=ccache \
209+
..
210+
211+
- name: Build OpenBLAS
212+
run: cd build && cmake --build .
213+
214+
- name: Show ccache status
215+
continue-on-error: true
216+
run: ccache -s
217+
218+
- name: Run tests
219+
timeout-minutes: 60
220+
run: cd build && ctest

0 commit comments

Comments
 (0)