From a443f44aefa3a3b654c7268c0c2c2fa382bdd5bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20P=C3=A9an?= Date: Sat, 21 Jan 2023 15:20:24 +0100 Subject: [PATCH 1/8] Enable examples on CI for `windows_latest_cmake` --- .github/workflows/jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index c9868fcdf..3d688cb87 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -281,6 +281,6 @@ jobs: - name: Run job run: | mkdir -p build && cd build - cmake -GNinja -DICB=ON .. # -DEXAMPLES=ON KO + cmake -GNinja -DICB=ON -DEXAMPLES=ON .. cmake --build . -v ctest --output-on-failure From 24573391ffb7be62cebb6033f9c2575303c3b564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20P=C3=A9an?= Date: Sat, 21 Jan 2023 15:21:36 +0100 Subject: [PATCH 2/8] Fix CI for `windows_latest_cmake` --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0227ec50a..4b15bea67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) From 569a5583a7ea6218fd3d42ebaa0c5e05d5651abf Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sun, 22 Jan 2023 11:55:58 +0100 Subject: [PATCH 3/8] Try to build and run MPI test suite on windows ?... --- .github/workflows/jobs.yml | 3 ++- CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index 3d688cb87..3c213b21e 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -269,6 +269,7 @@ jobs: mingw-w64-x86_64-ninja mingw-w64-x86_64-gcc-fortran mingw-w64-x86_64-openblas + mingw-w64-x86_64-msmpi - name: Clone and check out repository code uses: actions/checkout@v2 with: @@ -281,6 +282,6 @@ jobs: - name: Run job run: | mkdir -p build && cd build - cmake -GNinja -DICB=ON -DEXAMPLES=ON .. + cmake -GNinja -DICB=ON -DMPI=ON -DEXAMPLES=ON .. cmake --build . -v ctest --output-on-failure diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b15bea67..f0dba3956 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 mpirun -n 2 ./${lwe}) endforeach() endfunction(pexamples) From 23bc208485eeaa587e73a246f7be063da95093a6 Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sun, 22 Jan 2023 12:31:13 +0100 Subject: [PATCH 4/8] Revert "Try to build and run MPI test suite on windows ?..." This reverts commit 569a5583a7ea6218fd3d42ebaa0c5e05d5651abf. --- .github/workflows/jobs.yml | 3 +-- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index 3c213b21e..3d688cb87 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -269,7 +269,6 @@ jobs: mingw-w64-x86_64-ninja mingw-w64-x86_64-gcc-fortran mingw-w64-x86_64-openblas - mingw-w64-x86_64-msmpi - name: Clone and check out repository code uses: actions/checkout@v2 with: @@ -282,6 +281,6 @@ jobs: - name: Run job run: | mkdir -p build && cd build - cmake -GNinja -DICB=ON -DMPI=ON -DEXAMPLES=ON .. + cmake -GNinja -DICB=ON -DEXAMPLES=ON .. cmake --build . -v ctest --output-on-failure diff --git a/CMakeLists.txt b/CMakeLists.txt index f0dba3956..4b15bea67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) + add_test(NAME "${lwe}_ex" COMMAND mpirun -n 2 ./${lwe} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) endforeach() endfunction(pexamples) From c7e15f8ac92228aea4e1a8e7716b9c2ec6f838a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20P=C3=A9an?= Date: Tue, 24 Jan 2023 20:54:18 +0000 Subject: [PATCH 5/8] Enable MPI for CI job `windows_latest_cmake` --- .github/workflows/jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index 3d688cb87..5bf3f8524 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -281,6 +281,6 @@ jobs: - name: Run job run: | mkdir -p build && cd build - cmake -GNinja -DICB=ON -DEXAMPLES=ON .. + cmake -GNinja -DICB=ON -DEXAMPLES=ON -DMPI=ON .. cmake --build . -v ctest --output-on-failure From 9b68c2692c568ede4ededc3c9e2f4e768768ff9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20P=C3=A9an?= Date: Tue, 24 Jan 2023 21:01:31 +0000 Subject: [PATCH 6/8] FIx CI job `windows_latest_cmake` for MPI examples * Add flag `-fallow-invalid-boz` fixing false positive errors on comments * Replace `mpirun` by standard `mpiexec` * Fix working directory of tests for MPI binaries --- .github/workflows/jobs.yml | 7 +++++++ CMakeLists.txt | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index 5bf3f8524..99dd1d5dc 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -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: @@ -283,4 +286,8 @@ jobs: mkdir -p build && cd build 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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b15bea67..865da69a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -212,7 +212,7 @@ if (MPI) endif() endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${MPI_Fortran_COMPILE_FLAG}") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${MPI_Fortran_COMPILE_FLAG} -fallow-invalid-boz") # Check if we can use ISO_C_BINDING provided by MPI. file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/PROG_ICB.f90 @@ -771,12 +771,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) From a23929112f32d75ac7b85e9410a50d7e6233cd6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20P=C3=A9an?= Date: Tue, 24 Jan 2023 21:15:38 +0000 Subject: [PATCH 7/8] Update changelog --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index f4511feb6..bfd4a3be9 100644 --- a/CHANGES +++ b/CHANGES @@ -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. From ac027021348ba4f6162dc731b0c3704bab5e4995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20P=C3=A9an?= Date: Wed, 25 Jan 2023 21:27:13 +0000 Subject: [PATCH 8/8] Apply BOZ workaround only for specific compiler --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 865da69a4..f9a08ed70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,7 +212,10 @@ if (MPI) endif() endif() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${MPI_Fortran_COMPILE_FLAG} -fallow-invalid-boz") + 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