@@ -23,71 +23,58 @@ jobs:
2323 ubuntu :
2424 # For available GitHub-hosted runners, see:
2525 # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
26- runs-on : ubuntu-latest
26+ runs-on : ${{ matrix.os }}
2727
28- name : ubuntu (${{ matrix.compiler }} ${{ matrix.cuda }} CUDA ${{ matrix.openmp }} OpenMP, ${{ matrix.link }})
28+ name : ${{ matrix.os }} (${{ matrix.compiler }} ${{ matrix.cuda }} CUDA ${{ matrix.openmp }} OpenMP, ${{ matrix.link }})
2929
3030 strategy :
3131 # Allow other runners in the matrix to continue if some fail
3232 fail-fast : false
3333
3434 matrix :
35- compiler : [gcc, clang]
36- cuda : [with, without]
35+ os : [ubuntu-latest]
36+ compiler : [gcc]
37+ cuda : [with]
3738 openmp : [with]
3839 link : [both]
3940 include :
40- - compiler : gcc
41- compiler-pkgs : " g++ gcc"
42- cc : " gcc"
43- cxx : " g++"
44- - compiler : clang
45- compiler-pkgs : " clang libomp-dev"
46- cc : " clang"
47- cxx : " clang++"
48- # Clang seems to generally require less cache size (smaller object files?).
49- - compiler : gcc
50- ccache-max : 600M
51- - compiler : clang
52- ccache-max : 500M
53- - cuda : with
54- cuda-pkgs : " nvidia-cuda-dev nvidia-cuda-toolkit"
55- cuda-cmake-flags :
56- -DSUITESPARSE_USE_CUDA=ON
57- -DSUITESPARSE_USE_STRICT=ON
58- -DCUDAToolkit_INCLUDE_DIRS="/usr/include"
59- -DCMAKE_CUDA_COMPILER_LAUNCHER="ccache"
60- - compiler : gcc
61- compiler-pkgs : " g++ gcc"
62- cc : " gcc"
63- cxx : " g++"
64- ccache-max : 600M
41+ - os : ubuntu-latest
42+ compiler : gcc
43+ cuda : with
44+ openmp : with
45+ link : both
46+ - os : ubuntu-latest
47+ compiler : gcc
48+ cuda : without
49+ openmp : with
50+ link : both
51+ - os : ubuntu-latest
52+ compiler : gcc
6553 cuda : without
6654 openmp : without
67- openmp-cmake-flags : " -DSUITESPARSE_USE_OPENMP=OFF"
68- - compiler : gcc
69- compiler-pkgs : " g++ gcc"
70- cc : " gcc"
71- cxx : " g++"
72- ccache-max : 600M
55+ link : both
56+ - os : ubuntu-latest
57+ compiler : clang
58+ cuda : with
59+ openmp : with
60+ link : both
61+ - os : ubuntu-latest
62+ compiler : gcc
7363 cuda : with
74- cuda-pkgs : " nvidia-cuda-dev nvidia-cuda-toolkit"
75- cuda-cmake-flags :
76- -DSUITESPARSE_USE_CUDA=ON
77- -DSUITESPARSE_USE_STRICT=ON
78- -DCUDAToolkit_INCLUDE_DIRS="/usr/include"
79- -DCMAKE_CUDA_COMPILER_LAUNCHER="ccache"
8064 openmp : with
8165 link : static
8266 # "Fake" a cross-compilation to exercise that build system path
83- link-cmake-flags :
84- -DBUILD_SHARED_LIBS=OFF
85- -DBUILD_STATIC_LIBS=ON
67+ extra-cmake-flags :
8668 -DCMAKE_SYSTEM_NAME="Linux"
69+ - os : ubuntu-24.04-arm
70+ compiler : gcc
71+ cuda : without
72+ openmp : with
73+ link : both
8774
8875 env :
89- CC : ${{ matrix.cc }}
90- CXX : ${{ matrix.cxx }}
76+ CC : ${{ matrix.compiler == 'gcc' && 'gcc' || 'clang' }}
77+ CXX : ${{ matrix.compiler == 'gcc' && 'g++' || 'clang++' }}
9178
9279 steps :
9380 - name : get CPU information
@@ -97,21 +84,22 @@ jobs:
9784 uses : actions/checkout@v4
9885
9986 - name : install dependencies
100- env :
101- COMPILER_PKGS : ${{ matrix.compiler-pkgs }}
102- CUDA_PKGS : ${{ matrix.cuda-pkgs }}
10387 run : |
10488 sudo apt -qq update
105- sudo apt install -y ${COMPILER_PKGS} autoconf automake ccache cmake \
89+ sudo apt install -y \
90+ ${{ matrix.compiler == 'gcc' && 'g++ gcc' || 'clang' }} \
91+ ${{ matrix.compiler == 'clang' && matrix.openmp == 'with' && 'libomp-dev' || '' }} \
92+ autoconf automake ccache cmake \
10693 dvipng gfortran libgmp-dev liblapack-dev libmpfr-dev valgrind \
107- libopenblas-dev ${CUDA_PKGS}
94+ libopenblas-dev \
95+ ${{ matrix.cuda == 'with' && 'nvidia-cuda-dev nvidia-cuda-toolkit' || '' }}
10896
10997 - name : prepare ccache
11098 # create key with human readable timestamp
11199 # used in action/cache/restore and action/cache/save steps
112100 id : ccache-prepare
113101 run : |
114- echo "key=ccache:ubuntu :${{ matrix.compiler }}:${{ matrix.cuda }}:${{ matrix.openmp }}:${{ matrix.link }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT
102+ echo "key=ccache:${{ matrix.os }} :${{ matrix.compiler }}:${{ matrix.cuda }}:${{ matrix.openmp }}:${{ matrix.link }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT
115103
116104 - name : restore ccache
117105 # setup the GitHub cache used to maintain the ccache from one job to the next
@@ -121,8 +109,8 @@ jobs:
121109 key : ${{ steps.ccache-prepare.outputs.key }}
122110 # Prefer caches from the same branch. Fall back to caches from the dev branch.
123111 restore-keys : |
124- ccache:ubuntu :${{ matrix.compiler }}:${{ matrix.cuda }}:${{ matrix.openmp }}:${{ matrix.link }}:${{ github.ref }}
125- ccache:ubuntu :${{ matrix.compiler }}:${{ matrix.cuda }}:${{ matrix.openmp }}:${{ matrix.link }}:
112+ ccache:${{ matrix.os }} :${{ matrix.compiler }}:${{ matrix.cuda }}:${{ matrix.openmp }}:${{ matrix.link }}:${{ github.ref }}
113+ ccache:${{ matrix.os }} :${{ matrix.compiler }}:${{ matrix.cuda }}:${{ matrix.openmp }}:${{ matrix.link }}:
126114
127115 - name : create empty libraries
128116 # This is to work around a bug in nvlink.
@@ -135,16 +123,17 @@ jobs:
135123 ar rcsv librt.a empty.o
136124 ar rcsv libpthread.a empty.o
137125 # overwrite system libraries with "valid" empty libraries
138- sudo mv ./libdl.a /usr/lib/x86_64-linux-gnu /libdl.a
139- sudo mv ./librt.a /usr/lib/x86_64-linux-gnu /librt.a
140- sudo mv ./libpthread.a /usr/lib/x86_64-linux-gnu /libpthread.a
126+ sudo mv ./libdl.a /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) /libdl.a
127+ sudo mv ./librt.a /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) /librt.a
128+ sudo mv ./libpthread.a /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) /libpthread.a
141129
142130 - name : configure ccache
143131 env :
144132 CCACHE_MAX : ${{ matrix.ccache-max }}
145133 run : |
146134 test -d ~/.ccache || mkdir ~/.ccache
147- echo "max_size = $CCACHE_MAX" >> ~/.ccache/ccache.conf
135+ # Clang seems to generally require less cache size (smaller object files?).
136+ echo "max_size = ${{ matrix.compiler == 'gcc' && '600M' || '500M' }}" >> ~/.ccache/ccache.conf
148137 echo "compression = true" >> ~/.ccache/ccache.conf
149138 ccache -s
150139 echo "/usr/lib/ccache" >> $GITHUB_PATH
@@ -156,21 +145,29 @@ jobs:
156145 printf " \033[0;32m==>\033[0m Building library \033[0;32m${lib}\033[0m\n"
157146 echo "::group::Configure $lib"
158147 cd ${GITHUB_WORKSPACE}/${lib}/build
159- cmake -DCMAKE_BUILD_TYPE=" Release" \
148+ cmake -DCMAKE_BUILD_TYPE=' Release' \
160149 -DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}" \
161150 -DCMAKE_C_COMPILER_LAUNCHER="ccache" \
162151 -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
163152 -DCMAKE_Fortran_COMPILER_LAUNCHER="ccache" \
164153 -DBLA_VENDOR="OpenBLAS" \
165154 -DSUITESPARSE_DEMOS=OFF \
166155 -DBUILD_TESTING=OFF \
167- ${{ matrix.cuda-cmake-flags }} \
168- ${{ matrix.openmp-cmake-flags }} \
169- ${{ matrix.link-cmake-flags }} \
156+ ${{ matrix.cuda == 'with'
157+ && '-DSUITESPARSE_USE_CUDA=ON \
158+ -DSUITESPARSE_USE_STRICT=ON \
159+ -DCUDAToolkit_INCLUDE_DIRS="/usr/include" \
160+ -DCMAKE_CUDA_COMPILER_LAUNCHER="ccache"'
161+ || '-DSUITESPARSE_USE_CUDA=OFF' }} \
162+ -DSUITESPARSE_USE_OPENMP=${{ matrix.openmp == 'without' && 'OFF' || 'ON' }} \
163+ ${{ matrix.link == 'static'
164+ && '-DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON'
165+ || '' }} \
166+ ${{ matrix.extra-cmake-flags }} \
170167 ..
171168 echo "::endgroup::"
172169 echo "::group::Build $lib"
173- cmake --build . --config Release
170+ cmake --build .
174171 echo "::endgroup::"
175172 done
176173
@@ -214,8 +211,15 @@ jobs:
214211 cmake \
215212 -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/lib/cmake" \
216213 -DBLA_VENDOR="OpenBLAS" \
217- ${{ matrix.cuda-cmake-flags }} \
218- ${{ matrix.link-cmake-flags }} \
214+ ${{ matrix.cuda == 'with'
215+ && '-DSUITESPARSE_USE_CUDA=ON \
216+ -DSUITESPARSE_USE_STRICT=ON \
217+ -DCUDAToolkit_INCLUDE_DIRS="/usr/include" \
218+ -DCMAKE_CUDA_COMPILER_LAUNCHER="ccache"'
219+ || '' }} \
220+ ${{ matrix.link == 'static'
221+ && '-DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON'
222+ || '' }} \
219223 ..
220224 echo "::endgroup::"
221225 printf "::group::\033[0;32m==>\033[0m Building example\n"
0 commit comments