Skip to content

Commit

Permalink
add example test
Browse files Browse the repository at this point in the history
cmake config: need to specify mpiseq_FOUND
  • Loading branch information
scivision committed Jul 8, 2022
1 parent e4d8006 commit b59f364
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 11 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ jobs:

- uses: actions/checkout@v2

- run: cmake -B build -Darith=d -Dparallel:BOOL=false -DCMAKE_INSTALL_PREFIX=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
- name: config
run: cmake -B build -Darith=d -Dparallel:BOOL=false -DCMAKE_INSTALL_PREFIX=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}

- name: print config log
if: ${{ failure() }}
run: cat build/CMakeFiles/CMakeError.log

- run: cmake --build build --parallel
- run: ctest --test-dir build --preset default

Expand All @@ -46,6 +52,11 @@ jobs:

- name: configure example
run: cmake -S example -B example/build -Dparallel:BOOL=false -DCMAKE_PREFIX_PATH=${{ runner.temp }} -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}

- name: print config log
if: ${{ failure() }}
run: cat example/build/CMakeFiles/CMakeError.log

- name: build example
run: cmake --build example/build --parallel || cmake --build example/build -v
- name: test example
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/intel-oneapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,30 @@ jobs:
printenv >> $GITHUB_ENV
- name: CMake Configure
run: cmake -B build
run: cmake -B build -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}

- name: print config log
if: ${{ failure() }}
run: cat build/CMakeFiles/CMakeError.log

- name: CMake build
run: cmake --build build

- name: unit test
run: ctest --test-dir build --preset default --output-junit test-unit-oneapi.xml

- name: install package
run: cmake --install build

- name: configure example
run: cmake -S example -B example/build -DCMAKE_PREFIX_PATH=${{ runner.temp }}

- name: print config log
if: ${{ failure() }}
run: cat example/build/CMakeFiles/CMakeError.log

- name: build example
run: cmake --build example/build --parallel || cmake --build example/build -v

- name: test example
run: ctest --test-dir example/build -V
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ DESCRIPTION "Sparse direct parallel solver"
HOMEPAGE_URL "http://mumps-solver.org/"
)

include(CTest)
enable_testing()
if(DEFINED BUILD_TESTING)
set(${PROJECT_NAME}_BUILD_TESTING ${BUILD_TESTING})
else()
set(${PROJECT_NAME}_BUILD_TESTING true)
endif()

if(NOT MUMPS_UPSTREAM_VERSION)
set(MUMPS_UPSTREAM_VERSION 5.5.0)
Expand Down Expand Up @@ -104,7 +109,7 @@ configure_file(src/CMakeLists.txt ${mumps_SOURCE_DIR}/src/ COPYONLY)
add_subdirectory(${mumps_SOURCE_DIR}/src ${mumps_BINARY_DIR}/src)


if(BUILD_TESTING)
if(${PROJECT_NAME}_BUILD_TESTING)
add_subdirectory(test)
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/compilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ endif()

# --- compiler check

add_compile_definitions(Add_)
add_compile_definitions("$<$<COMPILE_LANGUAGE:C>:Add_>")
# "Add_" works for all modern compilers we tried.

add_compile_definitions($<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:${MSVC}>>:_CRT_SECURE_NO_WARNINGS>)
Expand Down
4 changes: 3 additions & 1 deletion cmake/config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ find_dependency(LAPACK)

include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake)

if(NOT TARGET MUMPS::MPISEQ)
if(TARGET MUMPS::MPISEQ)
set(MUMPS_mpiseq_FOUND true)
else()
find_dependency(MPI COMPONENTS C Fortran)
find_dependency(SCALAPACK)
endif()
Expand Down
4 changes: 2 additions & 2 deletions cmake/libraries.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"lapack": {
"git": "https://github.com/scivision/lapack.git",
"tag": "v3.10.1.0"
"tag": "v3.10.1.1"
},
"scalapack": {
"git": "https://github.com/scivision/scalapack.git",
"tag": "v2.2.0.4"
"tag": "v2.2.0.5"
},

"mumps": {
Expand Down
3 changes: 1 addition & 2 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ endif()

set(CMAKE_TLS_VERIFY true)

set(FETCHCONTENT_UPDATES_DISCONNECTED_MUMPS true)
set_directory_properties(PROPERTIES EP_UPDATE_DISCONNECTED true)
set(FETCHCONTENT_UPDATES_DISCONNECTED true)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/Modules)

Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "https://spdx.org/licenses/CECILL-C.html",
"codeRepository": "https://github.com/scivision/mumps",
"contIntegration": "https://github.com/scivision/mumps/actions",
"dateModified": "2022-04-14",
"dateModified": "2022-07-08",
"downloadUrl": "https://github.com/scivision/mumps/releases",
"issueTracker": "https://github.com/scivision/mumps/issues",
"name": "MUMPS",
Expand Down

0 comments on commit b59f364

Please sign in to comment.