diff options
author | Timo Dörr <timo@latecrew.de> | 2013-10-16 16:31:41 +0200 |
---|---|---|
committer | Timo Dörr <timo@latecrew.de> | 2013-10-23 14:09:22 +0200 |
commit | c6ce5675b9af1b8d573afd9fb24ab74611f35644 (patch) | |
tree | 13cd414c49310e0f384974c816281190d7046a83 /CMakeLists.txt | |
parent | b68d5a3e3927498f0947db56cb4002962362872e (diff) |
Add MPI support
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d5a2001..f2324b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,16 +33,36 @@ enable_testing() set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/common/cmake") #}}} +find_program (MPICC "mpicc") + #{{{ Options option(WITH_PROFILING "Enable profiling" OFF) option(WITH_TESTS "Build test suite" ON) +option(WITH_MPI "Build with MPI support" OFF) +option(WITH_DEBUG "Build with DEBUG support" OFF) if (WITH_PROFILING) add_definitions("-pg") set(CMAKE_C_FLAGS "-pg") endif () + +if (WITH_DEBUG) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -ggdb") +endif () + +if (WITH_MPI) + add_definitions ("-DMPI") + + if (NOT MPICC) + message (FATAL_ERROR "No mpicc compiler be found but MPI was explicitly enabled") + endif () + + set(CMAKE_C_COMPILER ${MPICC}) +endif () + #}}} + #{{{ Dependencies set(PKG_GLIB2_MIN_REQUIRED "2.22") set(PKG_JSON_GLIB_MIN_REQUIRED "0.7.6") |