Removed MPI from the core library dependencies: instead one should use the appropriate mpi compiler for compiling host code by passing something like -DCMAKE_C_COMPILER=/appl/opt/openmpi/3.1.3-cuda/gcc/7.3.0/bin/mpicc -DCMAKE_CXX_COMPILER=/appl/opt/openmpi/3.1.3-cuda/gcc/7.3.0/bin/mpicxx to cmake

This commit is contained in:
jpekkila
2019-12-03 18:40:15 +02:00
parent c273fcf110
commit 04e27e85b2

View File

@@ -40,19 +40,14 @@ elseif (CMAKE_BUILD_TYPE_UPPER STREQUAL "DEBUG")
endif()
if (MPI_ENABLED)
find_package(MPI REQUIRED)
add_definitions(-DAC_MPI_ENABLED=1)
cuda_include_directories(${MPI_CXX_INCLUDE_PATH})
add_definitions(-DAC_DEFAULT_CONFIG="${CMAKE_SOURCE_DIR}/config/astaroth.conf") # Hack, cmake doesnt propagate properly from utils. Probably because utils is compiled after core
endif ()
## Create and link the library
#set(CMAKE_POSITION_INDEPENDENT_CODE ON) # fpic for shared libraries
cuda_add_library(astaroth_core STATIC astaroth.cc node.cc device.cc kernels/boundconds.cu kernels/integration.cu kernels/reductions.cu)
target_include_directories(astaroth_core PRIVATE . ${CUDA_INCLUDE_DIRS})
target_link_libraries(astaroth_core ${CUDA_LIBRARIES} m)
target_link_libraries(astaroth_core m ${CUDA_LIBRARIES})
target_compile_definitions(astaroth_core PRIVATE AC_USE_CUDA_RUNTIME_API)
add_dependencies(astaroth_core dsl_headers)
@@ -62,5 +57,5 @@ if (MULTIGPU_ENABLED)
endif ()
if (MPI_ENABLED)
target_link_libraries(astaroth_core ${MPI_CXX_LIBRARIES} astaroth_utils)
target_link_libraries(astaroth_core astaroth_utils)
endif ()