Skip to content

Commit 0b9193a

Browse files
Add test to the CI for BLAS++ and LAPACK++ flags
1 parent e7f4bd3 commit 0b9193a

File tree

1 file changed

+89
-1
lines changed

1 file changed

+89
-1
lines changed

.github/workflows/cmake.yml

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,92 @@ jobs:
237237
fi
238238
done
239239
exit 0
240-
fi
240+
fi
241+
242+
test-blaspp-flag:
243+
runs-on: ubuntu-latest
244+
245+
env:
246+
BUILD_TYPE: Release
247+
FFLAGS: "-Wall -Wno-unused-dummy-argument -Wno-unused-variable -Wno-unused-label -Werror=conversion -fimplicit-none -frecursive -fcheck=all"
248+
249+
strategy:
250+
fail-fast: false
251+
matrix:
252+
sharedlib: [ ON, OFF ]
253+
lapackpp: [ ON, OFF ]
254+
255+
steps:
256+
257+
- name: Checkout LAPACK
258+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
259+
260+
- name: Install ninja-build tool
261+
uses: seanmiddleditch/gha-setup-ninja@16b940825621068d98711680b6c3ff92201f8fc0 # v3
262+
263+
- name: Install the Basics
264+
# Adding some noise to the system: libopenblas-dev liblapack-dev should not
265+
# be linked to BLAS++ or LAPACK++.
266+
run: |
267+
sudo apt update
268+
sudo apt install -y cmake gfortran
269+
# sudo apt purge libopenblas-dev liblapack-dev
270+
271+
- name: Configure CMake
272+
run: >
273+
cmake -B build -G Ninja
274+
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
275+
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/lapack_install
276+
-D CBLAS:BOOL=OFF
277+
-D LAPACKE:BOOL=OFF
278+
-D BUILD_TESTING:BOOL=OFF
279+
-D BUILD_SHARED_LIBS:BOOL=${{ matrix.sharedlib }}
280+
-D BLAS++:BOOL=ON
281+
-D LAPACK++:BOOL=${{ matrix.lapackpp }}
282+
283+
- name: Build
284+
run: cmake --build build --config ${{env.BUILD_TYPE}}
285+
286+
- name: Check dependencies of BLAS++
287+
working-directory: ${{github.workspace}}/build
288+
run: |
289+
if [[ ${{ matrix.sharedlib }} == 'ON' ]]; then
290+
blaspp_blas=$(ldd lib/libblaspp.so | grep libblas.so | { grep -v grep || true; })
291+
if [[ -z $blaspp_blas || "$blaspp_blas" != *"${{github.workspace}}/build"* ]]; then
292+
echo "BLAS++ dependency to BLAS is not correct!"
293+
echo "ldd lib/libblaspp.so:"
294+
ldd lib/libblaspp.so
295+
exit 1
296+
fi
297+
else
298+
blaspp_blas=$(cat lib/blaspp/blasppConfig.cmake | grep -lblas | { grep -v grep || true; })
299+
if [[ -z $blaspp_blas ]]; then
300+
echo "BLAS++ dependency to BLAS is not correct!"
301+
echo "We could not find -lblas in lib/blaspp/blasppConfig.cmake"
302+
exit 1
303+
fi
304+
fi
305+
306+
- name: Check dependencies when LAPACK++ is ON
307+
if: ${{ matrix.lapackpp == 'ON' }}
308+
working-directory: ${{github.workspace}}/build
309+
run: |
310+
if [[ ${{ matrix.sharedlib }} == 'ON' ]]; then
311+
lapackpp_lapack=$(ldd lib/liblapackpp.so | grep liblapack.so | { grep -v grep || true; })
312+
if [[ -z $lapackpp_lapack || $lapackpp_lapack != *"${{github.workspace}}/build"* ]]; then
313+
echo "LAPACK++ dependency to LAPACK is not correct!"
314+
echo "ldd lib/liblapackpp.so:"
315+
ldd lib/liblapackpp.so
316+
exit 1
317+
fi
318+
else
319+
lapackpp_lapack=$(cat lib/lapackpp/lapackppConfig.cmake | grep -llapack | { grep -v grep || true; })
320+
if [[ -z $lapackpp_lapack ]]; then
321+
echo "LAPACK++ dependency to LAPACK is not correct!"
322+
echo "We could not find -llapack in lib/lapackpp/lapackppConfig.cmake"
323+
exit 1
324+
fi
325+
fi
326+
327+
- name: Install
328+
run: cmake --build build --target install -j2

0 commit comments

Comments
 (0)