Skip to content

Commit

Permalink
Add ctest to spack build pipelines. (#118)
Browse files Browse the repository at this point in the history
* Fix spack test stage..

* Add `--keep-stage` to spack install to keep build dir...

* Avoid using cache in spack install...

* Install dependencies from cache, but not resolve.

* Add ~/+lusol builds.

* Add make test_install to github tests. (#170)

* Disable Lusol by default.

* Enable full build without LUSOL.

---------

Co-authored-by: pelesh <peless@ornl.gov>
  • Loading branch information
cameronrutherford and pelesh authored Jun 21, 2024
1 parent a92074f commit b77ca06
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 20 deletions.
37 changes: 24 additions & 13 deletions .github/workflows/spack_cpu_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
Expand All @@ -76,13 +76,14 @@ jobs:
permissions:
packages: write
contents: read

strategy:
matrix:
# Minimal Build(s) - GHCR mirror speeds these up a lot!
spack_spec:
- resolve@develop+klu
- resolve@develop~klu
- resolve@develop~klu~lusol
- resolve@develop+klu~lusol
- resolve@develop+klu+lusol

name: Build ReSolve with Spack
steps:
Expand All @@ -92,10 +93,10 @@ jobs:
# Once we move submodule deps into spack, we can do some more builds
# Also need to change build script to use spack from base image
submodules: true

- name: Setup Spack
run: echo "$PWD/buildsystem/spack/spack/bin" >> "$GITHUB_PATH"

- name: Create heredoc spack.yaml
run: |
cat << EOF > spack.yaml
Expand All @@ -111,25 +112,35 @@ jobs:
mirrors:
local-buildcache: oci://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
spack: https://binaries.spack.io/develop
EOF
- name: Configure GHCR mirror
run: spack -e . mirror set --oci-username ${{ env.USERNAME }} --oci-password "${{ secrets.GITHUB_TOKEN }}" local-buildcache

- name: Trust keys
run: spack -e . buildcache keys --install --trust

- name: Find external packages
run: spack -e . external find --all

- name: Spack develop ReSolve
run: spack -e . develop --path=$(pwd) resolve@develop

- name: Concretize
run: spack -e . concretize

- name: Install
run: spack -e . install --no-check-signature


- name: Install dependencies
run: spack -e . install --no-check-signature --only dependencies

- name: Install package
run: spack -e . install --keep-stage --no-check-signature --no-cache --fresh

- name: Test Build
run: cd $(spack -e . location --build-dir resolve@develop) && ctest -VV

- name: Test Installation
run: cd $(spack -e . location --build-dir resolve@develop) && make test_install

# Push with force to override existing binaries...
- name: Push to binaries to buildcache
run: |
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ endif()

option(RESOLVE_TEST_WITH_BSUB "Use `jsrun` instead of `mpirun` commands when running tests" OFF)
option(RESOLVE_USE_KLU "Use KLU, AMD and COLAMD libraries from SuiteSparse" ON)
option(RESOLVE_USE_LUSOL "Build the LUSOL library" ON)
option(RESOLVE_USE_LUSOL "Build the LUSOL library" OFF)
option(RESOLVE_USE_CUDA "Use CUDA language and SDK" OFF)
option(RESOLVE_USE_HIP "Use HIP language and ROCm library" OFF)
option(RESOLVE_USE_PROFILING "Set profiling tracers in the code" OFF)
Expand Down Expand Up @@ -96,7 +96,7 @@ if(RESOLVE_USE_CUDA)

if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES 60 CACHE STRING "Selects CUDA architectures")
endif()
endif()

set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-extended-lambda")

Expand Down
2 changes: 1 addition & 1 deletion buildsystem/spack/spack
Submodule spack updated 9446 files
15 changes: 11 additions & 4 deletions tests/unit/matrix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,22 @@ add_executable(runMatrixFactorizationTests.exe runMatrixFactorizationTests.cpp)
target_link_libraries(runMatrixFactorizationTests.exe PRIVATE ReSolve resolve_matrix)

# Build LUSOL-related tests
add_executable(runLUSOLTests.exe runLUSOLTests.cpp)
target_link_libraries(runLUSOLTests.exe PRIVATE ReSolve resolve_matrix)
if(RESOLVE_USE_LUSOL)
add_executable(runLUSOLTests.exe runLUSOLTests.cpp)
target_link_libraries(runLUSOLTests.exe PRIVATE ReSolve resolve_matrix)
endif()

# Install tests
set(installable_tests runMatrixIoTests.exe runMatrixHandlerTests.exe runMatrixFactorizationTests.exe runLUSOLTests.exe)
set(installable_tests runMatrixIoTests.exe runMatrixHandlerTests.exe runMatrixFactorizationTests.exe)
if(RESOLVE_USE_LUSOL)
list(APPEND installable_tests runLUSOLTests.exe)
endif()
install(TARGETS ${installable_tests}
RUNTIME DESTINATION bin/resolve/tests/unit)

add_test(NAME matrix_test COMMAND $<TARGET_FILE:runMatrixIoTests.exe>)
add_test(NAME matrix_handler_test COMMAND $<TARGET_FILE:runMatrixHandlerTests.exe>)
add_test(NAME matrix_factorization_test COMMAND $<TARGET_FILE:runMatrixFactorizationTests.exe>)
add_test(NAME lusol_test COMMAND $<TARGET_FILE:runLUSOLTests.exe>)
if(RESOLVE_USE_LUSOL)
add_test(NAME lusol_test COMMAND $<TARGET_FILE:runLUSOLTests.exe>)
endif()

0 comments on commit b77ca06

Please sign in to comment.