Skip to content

Commit 3073420

Browse files
committed
cmake: fix handling of mpi
going to test on juqueen
1 parent b459268 commit 3073420

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

3rdparty/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ message(STATUS "----------------------------------------------------------------
1010
message(STATUS "Boost")
1111

1212
set(Boost_USE_MULTITHREADED ON)
13-
if(NOT ${pfasst_BUILD_SHARED_LIBS})
13+
if(${pfasst_BUILD_SHARED_LIBS})
14+
set(Boost_USE_STATIC_LIBS OFF)
15+
else()
1416
set(Boost_USE_STATIC_LIBS ON)
1517
endif()
1618
set(Boost_ADDITIONAL_VERSIONS "1.57" "1.57.0" ${Boost_ADDITIONAL_VERSIONS})

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ list(APPEND CMAKE_FIND_ROOT_PATH ${pfasst_SOURCE_DIR}/stack)
1414
set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/3rdparty)
1515

1616
option(pfasst_DISABLE_LIBCXX "Disable use of LLVM's libc++ when compiling with Clang." ON )
17-
option(pfasst_BUILD_SHARED_LIBS "Build shared libraries." OFF)
17+
option(pfasst_BUILD_SHARED_LIBS "Build shared libraries." ON )
1818
option(pfasst_BUILD_EXAMPLES "Build example programs." ON )
1919
CMAKE_DEPENDENT_OPTION(pfasst_INSTALL_EXAMPLES "Install example programs." ON
2020
"pfasst_BUILD_EXAMPLES" OFF)
@@ -25,12 +25,17 @@ option(pfasst_DEFAULT_RAND_SEED "Using a hardcoded random seed"
2525

2626
if(${pfasst_WITH_MPI})
2727
find_package(MPI REQUIRED)
28-
if(NOT "${CMAKE_CXX_COMPILER}" STREQUAL "${MPI_CXX_COMPILER}")
28+
if(NOT "${CMAKE_CXX_COMPILER}" STREQUAL "${MPI_CXX_COMPILER}" OR
29+
NOT "${CMAKE_C_COMPILER}" STREQUAL "${MPI_C_COMPILER}")
2930
message(STATUS "C++ Compiler: ${CMAKE_CXX_COMPILER}")
3031
message(STATUS "MPI C++ Compiler Wrapper: ${MPI_CXX_COMPILER}")
31-
message(FATAL_ERROR "Please make sure to set CXX and CC to the MPI compiler wrappers!")
32+
message(WARNING "Please make sure to set CXX and CC to the MPI compiler wrappers!")
33+
set(CMAKE_CXX_COMPILER "${MPI_CXX_COMPILER}")
34+
set(CMAKE_C_COMPILER "${MPI_C_COMPILER}")
35+
message(STATUS "Set default compilers to MPI compilers.")
3236
endif()
3337
message(STATUS "Using MPI C++ Compiler Wrapper: ${MPI_CXX_COMPILER}")
38+
message(STATUS "USing MPI C Compiler Wrapper: ${MPI_C_COMPILER}")
3439
add_definitions(-DWITH_MPI)
3540
endif()
3641

tests/examples/advection_diffusion/test_mpi_advection_diffusion.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ int main(int argc, char** argv)
7070
testing::InitGoogleTest(&argc, argv);
7171
pfasst::init(argc, argv,
7272
pfasst::examples::advection_diffusion::AdvectionDiffusionSweeper<>::init_opts,
73-
pfasst::examples::advection_diffusion::AdvectionDiffusionSweeper<>::init_logs,
74-
true);
73+
pfasst::examples::advection_diffusion::AdvectionDiffusionSweeper<>::init_logs);
7574
int result = 1, max_result; // GTest return value 1 (failure), 0 (success)
7675
result = RUN_ALL_TESTS();
7776
MPI_Allreduce(&result, &max_result, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);

0 commit comments

Comments
 (0)