Skip to content

Commit

Permalink
CMake: Add FLAMEGPU_ENABLE_MPI option.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robadob committed Jul 14, 2023
1 parent 193fd83 commit d9fe6bc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ option(FLAMEGPU_RTC_DISK_CACHE "Enable caching of RTC kernels to disk by default
# Option to enable/disable logging of dynamic RTC files to disk
option(FLAMEGPU_RTC_EXPORT_SOURCES "Export RTC source files to disk at runtime" OFF)

# Option to enable/disable MPI support
option(FLAMEGPU_ENABLE_MPI "Enable MPI support for distributed ensembles" OFF)

# Option to make put glm on the include path
option(FLAMEGPU_ENABLE_GLM "Experimental: Make GLM available to flamegpu2 projects on the include path" OFF)
mark_as_advanced(FLAMEGPU_ENABLE_GLM)
Expand Down Expand Up @@ -510,6 +513,17 @@ if (FLAMEGPU_VISUALISATION)
target_compile_definitions(${PROJECT_NAME} PUBLIC FLAMEGPU_VISUALISATION)
endif()

if (FLAMEGPU_ENABLE_MPI)
find_package(MPI REQUIRED)
if (MPI_CXX_FOUND)
# This sets up include directories and lib
target_link_libraries(${PROJECT_NAME} PUBLIC MPI::MPI_CXX)
else()
message(FATAL_ERROR "MPI C++ Support was not found!")
endif()
endif()


# Make GLM accessible via include. PUBLIC so this is usable by downstream projects
# @todo - make the vis cmake/glm create a target to use.
if (FLAMEGPU_ENABLE_GLM)
Expand Down

0 comments on commit d9fe6bc

Please sign in to comment.