@@ -130,11 +130,14 @@ jobs:
130130 - name : Checkout LAPACK
131131 uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
132132
133+ - name : Install ninja-build tool
134+ uses : seanmiddleditch/gha-setup-ninja@16b940825621068d98711680b6c3ff92201f8fc0 # v3
135+
133136 - name : Configure CMake
134137 # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
135138 # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
136139 run : >
137- cmake -B build
140+ cmake -B build -G Ninja
138141 -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
139142 -D CMAKE_INSTALL_PREFIX=${{github.workspace}}/lapack_install
140143 -D CBLAS:BOOL=ON
@@ -181,4 +184,57 @@ jobs:
181184 -D BUILD_SHARED_LIBS:BOOL=ON
182185
183186 - name : Install
184- run : cmake --build build --target install -j2
187+ run : cmake --build build --target install -j2
188+
189+ memory-check :
190+ runs-on : ubuntu-latest
191+ env :
192+ BUILD_TYPE : Debug
193+
194+ steps :
195+
196+ - name : Checkout LAPACK
197+ uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
198+
199+ - name : Install ninja-build tool
200+ uses : seanmiddleditch/gha-setup-ninja@16b940825621068d98711680b6c3ff92201f8fc0 # v3
201+
202+ - name : Install APT packages
203+ run : |
204+ sudo apt update
205+ sudo apt install -y cmake valgrind gfortran
206+
207+ - name : Configure CMake
208+ run : >
209+ cmake -B build -G Ninja
210+ -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
211+ -D CBLAS:BOOL=ON
212+ -D LAPACKE:BOOL=ON
213+ -D BUILD_TESTING:BOOL=ON
214+ -D LAPACKE_WITH_TMG:BOOL=ON
215+ -D BUILD_SHARED_LIBS:BOOL=ON
216+ -D LAPACK_TESTING_USE_PYTHON:BOOL=OFF
217+
218+ - name : Build
219+ run : cmake --build build --config ${{env.BUILD_TYPE}}
220+
221+ - name : Test
222+ working-directory : ${{github.workspace}}/build
223+ run : |
224+ ctest -C ${{env.BUILD_TYPE}} --schedule-random -j2 -T memcheck > memcheck.out
225+ cat memcheck.out
226+ if tail -n 1 memcheck.out | grep -q "Memory checking results:"; then
227+ exit 0
228+ else
229+ for f in Testing/Temporary/MemoryChecker.*.log; do
230+ if tail -n 1 $f | grep -q "ERROR SUMMARY: 0 errors"; then
231+ tail -n 1 $f
232+ continue
233+ else
234+ echo "Memory check failed in $f"
235+ cat $f
236+ exit 1
237+ fi
238+ done
239+ exit 0
240+ fi
0 commit comments