Skip to content

Commit

Permalink
Run all examples for job windows_latest_cmake in CI (#392)
Browse files Browse the repository at this point in the history
* Enable examples on CI for `windows_latest_cmake`

* Enable MPI for CI job `windows_latest_cmake`
  • Loading branch information
FabienPean authored Jan 26, 2023
1 parent f4d7302 commit 12814dc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ jobs:
mingw-w64-x86_64-ninja
mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-openblas
mingw-w64-x86_64-msmpi
- name: Install MS-MPI (for mpiexec)
uses: mpi4py/setup-mpi@v1
- name: Clone and check out repository code
uses: actions/checkout@v2
with:
Expand All @@ -281,6 +284,10 @@ jobs:
- name: Run job
run: |
mkdir -p build && cd build
cmake -GNinja -DICB=ON .. # -DEXAMPLES=ON KO
cmake -GNinja -DICB=ON -DEXAMPLES=ON -DMPI=ON ..
cmake --build . -v
- name: Run tests
run: |
export PATH="/c/Program Files/Microsoft MPI/Bin":$PATH # add mpiexec to msys2 path
cd build
ctest --output-on-failure
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
arpack-ng - 3.9.0

[ Fabien Péan ]
* CI: Enable job `windows_latest_cmake` to run all tests
* CMake: Fix BLAS and LAPACK static library order needed to consume the library on Windows with static linkage

[ Zhentao Wang ]
* [BUG FIX] parpack.h and parpack.hpp: type of rwork should be real instead of complex.
* Allow ritz_option {"LR", "SR", "LI", "SI"} for complex eigenvalue problems in ICB.
Expand Down
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function(examples list_name)
get_filename_component(lwe ${l} NAME_WE)
add_executable(${lwe} ${arpackexample_DIR}/${l} ${examples_EXTRA_SRCS})
target_link_libraries(${lwe} arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
add_test(NAME "${lwe}_ex" COMMAND ${lwe} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
add_test(NAME "${lwe}_ex" COMMAND ${lwe})
endforeach()
endfunction(examples)

Expand All @@ -72,7 +72,7 @@ function(pexamples list_name)
get_filename_component(lwe ${l} NAME_WE)
add_executable(${lwe} ${parpackexample_DIR}/${l} )
target_link_libraries(${lwe} parpack arpack MPI::MPI_Fortran)
add_test(NAME "${lwe}_ex" COMMAND mpirun -n 2 ./${lwe} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
add_test(NAME "${lwe}_ex" COMMAND mpiexec -n 2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${lwe})
endforeach()
endfunction(pexamples)

Expand Down Expand Up @@ -213,6 +213,9 @@ if (MPI)
endif()

set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${MPI_Fortran_COMPILE_FLAG}")
if(CMAKE_SYSTEM_NAME MATCHES "Windows" AND CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-invalid-boz")
endif()

# Check if we can use ISO_C_BINDING provided by MPI.
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/PROG_ICB.f90
Expand Down Expand Up @@ -771,12 +774,12 @@ function(build_tests)
add_executable(icb_parpack_c PARPACK/TESTS/MPI/icb_parpack_c.c)
target_include_directories(icb_parpack_c PUBLIC ${PROJECT_SOURCE_DIR}/ICB MPI::MPI_C) # Get parpack.h mpi.h
target_link_libraries(icb_parpack_c parpack arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS} MPI::MPI_C)
add_test(icb_parpack_c_tst mpirun -n 2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_parpack_c)
add_test(icb_parpack_c_tst mpiexec -n 2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_parpack_c)

add_executable(icb_parpack_cpp PARPACK/TESTS/MPI/icb_parpack_cpp.cpp)
target_include_directories(icb_parpack_cpp PUBLIC ${PROJECT_SOURCE_DIR}/ICB MPI::MPI_CXX) # Get parpack.hpp mpi.h
target_link_libraries(icb_parpack_cpp parpack arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS} MPI::MPI_CXX)
add_test(icb_parpack_cpp_tst mpirun -n 2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_parpack_cpp)
add_test(icb_parpack_cpp_tst mpiexec -n 2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_parpack_cpp)
endif()
endif()
endfunction(build_tests)
Expand Down

0 comments on commit 12814dc

Please sign in to comment.