cmake: try to fix MPI4WIN build
This commit is contained in:
@ -186,6 +186,7 @@ if(BUILD_MPI)
|
|||||||
# We use a non-standard procedure to compile with MPI on windows
|
# We use a non-standard procedure to compile with MPI on windows
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
|
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||||
include(MPI4WIN)
|
include(MPI4WIN)
|
||||||
|
target_link_libraries(lammps PUBLIC LAMMPS::MPI)
|
||||||
else()
|
else()
|
||||||
find_package(MPI REQUIRED)
|
find_package(MPI REQUIRED)
|
||||||
target_compile_definitions(lammps PRIVATE -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1)
|
target_compile_definitions(lammps PRIVATE -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1)
|
||||||
@ -515,9 +516,6 @@ include(Packages/GPU)
|
|||||||
# and after everything else that is compiled locally
|
# and after everything else that is compiled locally
|
||||||
######################################################################
|
######################################################################
|
||||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||||
if(LAMMPS_USE_MPI4WIN)
|
|
||||||
target_link_libraries(lammps PRIVATE ${MPI4WIN_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
target_link_libraries(lammps PRIVATE -lwsock32 -lpsapi)
|
target_link_libraries(lammps PRIVATE -lwsock32 -lpsapi)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -16,8 +16,11 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
|
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
|
||||||
target_compile_definitions(lammps PRIVATE -DMPICH_SKIP_MPICXX)
|
file(MAKE_DIRECTORY "${SOURCE_DIR}/include")
|
||||||
target_include_directories(lammps PRIVATE "${SOURCE_DIR}/include")
|
add_library(LAMMPS::MPI UNKNOWN IMPORTED)
|
||||||
set(MPI4WIN_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
|
set_target_properties(LAMMPS::MPI PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
||||||
|
INTERFACE_COMPILE_DEFINITIONS "-DMPICH_SKIP_MPICXX")
|
||||||
add_dependencies(lammps mpi4win_build)
|
add_dependencies(lammps mpi4win_build)
|
||||||
set(LAMMPS_USE_MPI4WIN ON)
|
set(LAMMPS_USE_MPI4WIN ON)
|
||||||
|
|||||||
Reference in New Issue
Block a user