Skip to content

Commit

Permalink
Attempt to fix #1588
Browse files Browse the repository at this point in the history
  • Loading branch information
willend committed Mar 8, 2024
1 parent 8792f10 commit 9570305
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions cmake/Modules/PlatformDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,30 +95,47 @@ function( detect_platform_variables resultvarname )
if ( NOT WINDOWS )
set(MPIFLAGS "-DUSE_MPI -l${MPILIB}")
else()
set(MPIFLAGS "/DUSE_MPI /LINK /DYNAMICBASE ${MPILIB}")
if ( MCCODE_BUILD_CONDA_PKG )
set(MPIFLAGS "/DUSE_MPI /LINK /DYNAMICBASE ${MPILIB}")
else()
set(MPIFLAGS "-DUSE_MPI -l${MPILIB}")
endif()
endif()
else()
if ( NOT WINDOWS )
set(MPILIB "mpi")
set(MPIFLAGS "-DUSE_MPI -l${MPILIB}")
else()
set(MPILIB "msmpi.lib")
set(MPIFLAGS "/DUSE_MPI /LINK /DYNAMICBASE ${MPILIB}")
if ( MCCODE_BUILD_CONDA_PKG )
set(MPILIB "msmpi.lib")
set(MPIFLAGS "/DUSE_MPI /LINK /DYNAMICBASE ${MPILIB}")
else()
set(MPILIB "msmpi")
set(MPIFLAGS "-DUSE_MPI -l${MPILIB}")
endif()
endif()
endif()
provide_var( MPILIB )
if ( MPILIBDIR )
if ( NOT WINDOWS )
set(MPIFLAGS "-Wl,-rpath,${MPILIBDIR} -L${MPILIBDIR} ${MPIFLAGS}")
else()
set(MPIFLAGS "${MPIFLAGS} /LIBPATH:${MPILIBDIR}")
if ( MCCODE_BUILD_CONDA_PKG )
set(MPIFLAGS "${MPIFLAGS} /LIBPATH:${MPILIBDIR}")
else ()
set(MPIFLAGS "-L${MPILIBDIR} ${MPIFLAGS}")
endif()
endif()
endif()
if ( MPIINCLUDEDIR )
if ( NOT WINDOWS )
set(MPIFLAGS "-I${MPIINCLUDEDIR} ${MPIFLAGS}")
else()
set(MPIFLAGS "/I${MPIINCLUDEDIR} ${MPIFLAGS}")
if ( MCCODE_BUILD_CONDA_PKG )
set(MPIFLAGS "/I${MPIINCLUDEDIR} ${MPIFLAGS}")
else()
set(MPIFLAGS "-I${MPIINCLUDEDIR} ${MPIFLAGS}")
endif()
endif()
endif()
provide_var( MPIFLAGS )
Expand Down

0 comments on commit 9570305

Please sign in to comment.