diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b44ed0..4356517 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,14 +70,6 @@ endif () add_definitions(-DAC_DEFAULT_CONFIG="${CMAKE_SOURCE_DIR}/config/astaroth.conf") -if (MULTIGPU_ENABLED) # Deprecated - add_definitions(-DAC_MULTIGPU_ENABLED=1) -endif () - -if (MPI_ENABLED) - add_definitions(-DAC_MPI_ENABLED=1) -endif() - ## Includes include_directories(include) # Library headers include_directories(src/common) # Common headers diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 677e6c2..6e18185 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,3 +1,14 @@ ## Astaroth Core add_library(astaroth_core STATIC device.cc node.cc astaroth.cc) target_link_libraries(astaroth_core astaroth_utils astaroth_kernels cudart) + +## Options +if (MPI_ENABLED) + find_package(MPI) + target_link_libraries(astaroth_core MPI::MPI_CXX) + target_compile_definitions(astaroth_core PRIVATE -DAC_MPI_ENABLED=1) +endif() + +if (MULTIGPU_ENABLED) + target_compile_definitions(astaroth_core PRIVATE -DAC_MULTIGPU_ENABLED=1) +endif ()