Added out-of-the-box support for MPI (though not enabled by default). Previously the user had to pass mpicxx explicitly as the cmake compiler in order to compile MPI code, but this was bad practice and it's better to let cmake handle the include and compilation flags.
This commit is contained in:
@@ -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
|
||||
|
@@ -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 ()
|
||||
|
Reference in New Issue
Block a user