Skip to content

Commit

Permalink
use MPI::MPI_CXX
Browse files Browse the repository at this point in the history
  • Loading branch information
alkino committed Apr 30, 2024
1 parent 9626174 commit 67aa5a0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmake/MacroHelper.cmake
Expand Up @@ -189,13 +189,13 @@ macro(nrn_mpi_find_package)
AND NRN_ENABLE_MPI_DYNAMIC)
set(_temp ${CMAKE_OSX_ARCHITECTURES})
unset(CMAKE_OSX_ARCHITECTURES CACHE)
find_package(MPI REQUIRED COMPONENTS C)
find_package(MPI REQUIRED)
set(CMAKE_OSX_ARCHITECTURES
${_temp}
CACHE INTERNAL "" FORCE)
set(NRN_UNIVERSAL2_BUILD ON)
else()
find_package(MPI REQUIRED COMPONENTS C)
find_package(MPI REQUIRED)
endif()
endmacro()

Expand Down
2 changes: 1 addition & 1 deletion src/coreneuron/CMakeLists.txt
Expand Up @@ -492,7 +492,7 @@ endforeach()

# we can link to MPI libraries in non-dynamic-mpi build
if(NRN_ENABLE_MPI AND NOT NRN_ENABLE_MPI_DYNAMIC)
target_link_libraries(coreneuron-core PUBLIC ${MPI_C_LIBRARIES})
target_link_libraries(coreneuron-core PUBLIC MPI::MPI_CXX)
endif()

# ~~~
Expand Down
5 changes: 2 additions & 3 deletions src/nrniv/CMakeLists.txt
Expand Up @@ -470,7 +470,7 @@ if(NRN_ENABLE_MPI)
# Note that we do not link here to libmpi. That is dlopen first.
if(MINGW) # type msmpi only
add_dependencies(${libname}_lib nrniv_lib)
target_link_libraries(${libname}_lib ${MPI_C_LIBRARIES})
target_link_libraries(${libname}_lib MPI::MPI_CXX)
target_link_libraries(${libname}_lib nrniv_lib)
endif()
set_property(TARGET ${libname}_lib PROPERTY OUTPUT_NAME ${libname})
Expand All @@ -490,8 +490,7 @@ if(NRN_ENABLE_MPI)
install(TARGETS ${libnrnmusic}_lib DESTINATION ${NRN_INSTALL_SHARE_LIB_DIR})
endif()
else()
target_link_libraries(nrniv_lib ${MPI_C_LIBRARIES})
target_include_directories(nrniv_lib PUBLIC ${MPI_INCLUDE_PATH})
target_link_libraries(nrniv_lib MPI::MPI_CXX)
endif()
endif()

Expand Down

0 comments on commit 67aa5a0

Please sign in to comment.