# # # # # # # # # # NO MORE TESTS AFTER THIS LINE! # # # # # # # # # # #
# these are set after everything else
if (NOT GMX_SKIP_DEFAULT_CFLAGS)
- set(CMAKE_EXE_LINKER_FLAGS "${FFT_LINKER_FLAGS} ${MPI_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS} ${DISABLE_SYCL_CXX_FLAGS}")
- set(CMAKE_SHARED_LINKER_FLAGS "${FFT_LINKER_FLAGS} ${MPI_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS} ${DISABLE_SYCL_CXX_FLAGS}")
+ #TODO(#3672): Use target_link_libraries(... MPI::MPI_CXX) instead of ${MPI_CXX_LINK_FLAGS}
+ set(CMAKE_EXE_LINKER_FLAGS "${FFT_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS} ${DISABLE_SYCL_CXX_FLAGS}")
+ set(CMAKE_SHARED_LINKER_FLAGS "${FFT_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS} ${DISABLE_SYCL_CXX_FLAGS}")
else()
message("Recommended flags which are not added because GMX_SKIP_DEFAULT_CFLAGS=yes:")
message("CMAKE_C_FLAGS: ${SIMD_C_FLAGS};${MPI_COMPILE_FLAGS};${EXTRA_C_FLAGS};${GMXC_CFLAGS}")
foreach(build_type ${build_types_with_explicit_flags})
message("CMAKE_CXX_FLAGS_${build_type}: ${GMXC_CXXFLAGS_${build_type}}")
endforeach()
- message("CMAKE_EXE_LINKER_FLAGS: ${FFT_LINKER_FLAGS} ${MPI_LINKER_FLAGS}")
- message("CMAKE_SHARED_LINKER_FLAGS: ${FFT_LINKER_FLAGS} ${MPI_LINKER_FLAGS}")
+ message("CMAKE_EXE_LINKER_FLAGS: ${FFT_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS}")
+ message("CMAKE_SHARED_LINKER_FLAGS: ${FFT_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS}")
endif()
# Allow `admin` directory to be easily conveyed to nested CMake commands.
set(GMX_ADMIN_DIR ${CMAKE_SOURCE_DIR}/admin)
if (GMX_LIB_MPI)
# GROMACS is built against an MPI library.
set(_gmx_mpi_type "library")
- # TODO: Normative solution with #3672.
- # Do not target_link_options(gmxapi PRIVATE ${MPI_LINKER_FLAGS})
+ # TODO(#3672): Normative solution with #3672.
+ # Do not target_link_options(gmxapi PRIVATE ${MPI_CXX_LINK_FLAGS})
# because the root CMakeLists.txt sets CMAKE_SHARED_LINKER_FLAGS.
target_compile_options(gmxapi PUBLIC ${MPI_COMPILE_FLAGS})
target_link_libraries(gmxapi PUBLIC ${MPI_CXX_LIBRARIES})
elseif (MPI_CXX_VERSION VERSION_LESS 2.0)
message(FATAL_ERROR "MPI version 2.0 or higher is required. Please update your MPI library.")
endif ()
- # TODO(#3672): Replace usage of `MPI_LINKER_FLAGS` with MPI_LINK_FLAGS,
- # MPI_<lang>_LINK_FLAGS, or target_link_libraries(... MPI::MPI_CXX)
- set(MPI_LINKER_FLAGS ${MPI_CXX_LINK_FLAGS})
- separate_arguments(MPI_CXX_LINK_FLAGS)
#TODO(#3672, #3776): These should be acquired through the MPI::MPI_CXX target.
include_directories(SYSTEM ${MPI_CXX_INCLUDE_PATH})
list(APPEND GMX_COMMON_LIBRARIES ${MPI_CXX_LIBRARIES})