Skip to content

Commit

Permalink
Require CMake 3.28
Browse files Browse the repository at this point in the history
Removed explicit cmake policy setting in favor of cmake_policy(VERSION
3.28), per recommendation from CMake developers. Now behaviour is
always like our minimum required ones, except that we get warnings
from newer cmake that might have introduced new policies.

Removed various work-arounds and deploy various new features as noted
in old code.

Removed CUDA-specific version requirements now that the general
requirement exceeds them.

Refs #5014
  • Loading branch information
mabraham authored and lundborgmagnus committed Oct 21, 2024
1 parent bed1626 commit 812d99f
Show file tree
Hide file tree
Showing 30 changed files with 77 additions and 176 deletions.
14 changes: 1 addition & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,7 @@
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out https://www.gromacs.org.

cmake_minimum_required(VERSION 3.18.4)

cmake_policy(SET CMP0022 NEW)
cmake_policy(SET CMP0048 NEW) # As of CMake 3.22, default is still "OLD"
cmake_policy(SET CMP0068 NEW) # From CMake 3.9
cmake_policy(SET CMP0074 NEW) # From CMake 3.12
if(POLICY CMP0131) # From CMake 3.24
cmake_policy(SET CMP0131 NEW)
endif()
if(POLICY CMP0135) # From CMake 3.24
# We don't care about DOWNLOAD_EXTRACT_TIMESTAMP; prefer the new behavior
cmake_policy(SET CMP0135 NEW)
endif()
cmake_minimum_required(VERSION 3.28)

# CMake modules/macros are in a subdirectory to keep this file cleaner
# This needs to be set before project() in order to pick up toolchain files
Expand Down
2 changes: 1 addition & 1 deletion admin/containers/scripted_gmx_docker_builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ def prepare_venv(version: packaging.version.Version) -> typing.Sequence[str]:
'black' \
'breathe' \
'build' \
'cmake>=3.18.4' \
'cmake>=3.28' \
'flake8>=3.7.7' \
'furo' \
'gcovr>=4.2' \
Expand Down
10 changes: 5 additions & 5 deletions admin/gitlab-ci/archive.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ archive:configure:release:
script:
- rm -rf gromacs*tar.gz
- cd $BUILD_DIR
- cmake --build . --target gmx -- -j4 2>&1 | tee buildLogFile.log
- cmake --build . --target man -- -j4 2>&1 | tee manBuildLogFile.log
- cmake --build . --target completion -- -j4 2>&1 | tee completionBuildLogFile.log
- cmake --build . --target install-guide -- -j4 2>&1 | tee installGuideBuildLogFile.log
- cmake --build . --target package_source -- -j4 2>&1 | tee packageBuildLogFile.log
- $CMAKE --build . --target gmx -- -j4 2>&1 | tee buildLogFile.log
- $CMAKE --build . --target man -- -j4 2>&1 | tee manBuildLogFile.log
- $CMAKE --build . --target completion -- -j4 2>&1 | tee completionBuildLogFile.log
- $CMAKE --build . --target install-guide -- -j4 2>&1 | tee installGuideBuildLogFile.log
- $CMAKE --build . --target package_source -- -j4 2>&1 | tee packageBuildLogFile.log
- awk '/warning/,/warning.*generated|^$/' buildLogFile.log manBuildLogFile.log
completionBuildLogFile.log installGuideBuildLogFile.log
packageBuildLogFile.log | grep -v "CMake" | tee buildErrors.log || true
Expand Down
21 changes: 13 additions & 8 deletions admin/gitlab-ci/documentation.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
stage: configure-build
cache: {}
variables:
CMAKE: /usr/local/cmake-3.29.8/bin/cmake
KUBERNETES_CPU_LIMIT: 1
KUBERNETES_CPU_REQUEST: 1
KUBERNETES_MEMORY_REQUEST: 2Gi
Expand Down Expand Up @@ -60,7 +61,7 @@
# without additional hinting. Once CMakeCache.txt exists, the later stages
# should work fine without reactivating the venv.
- source /root/venv/py3.9/bin/activate
- cmake ..
- $CMAKE ..
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
$CMAKE_COMPILER_SCRIPT
$CMAKE_EXTRA_OPTIONS
Expand Down Expand Up @@ -94,6 +95,7 @@
stage: release-configure
cache: {}
variables:
CMAKE: /usr/local/cmake-3.29.8/bin/cmake
KUBERNETES_CPU_LIMIT: 1
KUBERNETES_CPU_REQUEST: 1
KUBERNETES_MEMORY_REQUEST: 2Gi
Expand Down Expand Up @@ -162,7 +164,7 @@
fi
- cd $RELEASE_BUILD_DIR
- source /root/venv/py3.9/bin/activate
- cmake ../$RELEASE_SOURCE/
- $CMAKE ../$RELEASE_SOURCE/
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
$CMAKE_COMPILER_SCRIPT
$CMAKE_EXTRA_OPTIONS
Expand Down Expand Up @@ -201,9 +203,11 @@ docs:configure:
.docs:build:
# TODO (#3480) this should be organized more like the current documentation.py script
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-24.04-llvm-19-docs
variables:
CMAKE: /usr/local/cmake-3.29.8/bin/cmake
script:
- cd $BUILD_DIR
- cmake --build . --target gmx -- -j8
- $CMAKE --build . --target gmx -- -j8
- cd ..
artifacts:
name: docs-artifacts-$CI_COMMIT_REF_SLUG
Expand Down Expand Up @@ -242,25 +246,26 @@ docs:build:
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-24.04-llvm-19-docs
cache: {}
variables:
CMAKE: /usr/local/cmake-3.29.8/bin/cmake
KUBERNETES_CPU_LIMIT: 4
KUBERNETES_CPU_REQUEST: 2
KUBERNETES_MEMORY_REQUEST: 4Gi
script:
- cd $BUILD_DIR
- |
cmake --build . --target sphinx-programs \
$CMAKE --build . --target sphinx-programs \
-- -j4 2>setupErrors.log | tee docs/setup.log || true
- |
if [ ! -f setupErrors.log -o -s setupErrors.log ] ; then
echo "Errors while setting up Sphinx dependencies."
[ -f setupErrors.log ] && cat setupErrors.log
exit 1
fi
- cmake --build . --target doxygen-all -- -j4 2>&1 | tee docs/doxygen-all.log
- cmake --build . --target manual -- -j4 2>&1 | tee docs/manual/all-output.log
- $CMAKE --build . --target doxygen-all -- -j4 2>&1 | tee docs/doxygen-all.log
- $CMAKE --build . --target manual -- -j4 2>&1 | tee docs/manual/all-output.log
| grep -i "warning" | grep -v "TeX" | grep -v "Package" || true
- cmake --build . --target webpage-sphinx -- -j4 2>&1 | tee webpage-sphinx.log || true
- cmake --build . --target webpage -- -j4 > webpage.log 2>&1 || true
- $CMAKE --build . --target webpage-sphinx -- -j4 2>&1 | tee webpage-sphinx.log || true
- $CMAKE --build . --target webpage -- -j4 > webpage.log 2>&1 || true
- grep "WARNING:" docs/manual/all-output.log > pythonErrors.log || true
- grep -i "error" docs/sphinx-*.log > sphinxDiagnostics.log || true
- grep -i "warning" docs/sphinx-*.log >> sphinxDiagnostics.log || true
Expand Down
5 changes: 1 addition & 4 deletions admin/gitlab-ci/global.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
# Base definition for using oneAPI.
.use-oneapi:base:
variables:
# Use the HPC clang-based compiler variants so that OpenMP is active
CMAKE_COMPILER_SCRIPT: -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DCMAKE_INCLUDE_PATH=/opt/intel/oneapi/compiler/latest/linux/include/sycl;/opt/intel/oneapi/compiler/latest/include/sycl -DCMAKE_PREFIX_PATH=/opt/intel/oneapi/compiler/latest/linux
CMAKE_EXTRA_OPTIONS: -DGMX_FFT_LIBRARY=mkl
before_script:
Expand All @@ -98,9 +97,7 @@
# Base definition for using oneAPI IntelLLVM
.use-oneapi-intel-llvm:base:
variables:
# We need to add -isystem directories manually for OpenMP to work.
# With CMake 3.26+, OpenMP_*_INCLUDE_DIR could be used instead of CMAKE_*_FLAGS
CMAKE_COMPILER_SCRIPT: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_FLAGS=-isystem/opt/intel/oneapi/compiler/latest/opt/compiler/include/ -DCMAKE_CXX_FLAGS=-isystem/opt/intel/oneapi/compiler/latest/opt/compiler/include/
CMAKE_COMPILER_SCRIPT: -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx
before_script:
# Necessary to override gitlab default 'set -e' which breaks Intel's setvar.sh script
- set +e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ gromacs:clang-14-cuda.12.1:release:configure:
- !reference [.rules:nightly-only-for-release, rules]
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-22.04-llvm-14-cuda-12.1.0
variables:
CMAKE: /usr/local/cmake-3.29.3/bin/cmake
COMPILER_MAJOR_VERSION: 14
RELEASE_BUILD_DIR: release-builds-clang
CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=RelWithAssert"
Expand All @@ -38,6 +39,7 @@ gromacs:clang-14-cuda.12.1:release:build:
rules:
- !reference [.rules:nightly-only-for-release, rules]
variables:
CMAKE: /usr/local/cmake-3.29.3/bin/cmake
BUILD_DIR: release-builds-clang
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-22.04-llvm-14-cuda-12.1.0
needs:
Expand All @@ -52,6 +54,7 @@ gromacs:clang-14-cuda.12.1:release:test:
stage: release-tests
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-22.04-llvm-14-cuda-12.1.0
variables:
CMAKE: /usr/local/cmake-3.29.3/bin/cmake
BUILD_DIR: release-builds-clang
GMX_TEST_LABELS: "QuickGpuTest|SlowGpuTest"
GMX_FORCE_UPDATE_DEFAULT_CPU: 1
Expand All @@ -72,6 +75,7 @@ gromacs:clang-14-cuda.12.1:release:regressiontest:
stage: release-tests
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-22.04-llvm-14-cuda-12.1.0
variables:
CMAKE: /usr/local/cmake-3.29.3/bin/cmake
BUILD_DIR: release-builds-clang
REGRESSIONTEST_PME_RANK_NUMBER: 0
REGRESSIONTEST_TOTAL_RANK_NUMBER: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ gromacs:clang-14:cxx-20:configure:
- !reference [.rules:merge-requests, rules]
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-22.04-llvm-14-cuda-12.1.0
variables:
CMAKE: /usr/local/cmake-3.29.3/bin/cmake
CMAKE_EXTRA_OPTIONS: -DCMAKE_CXX_STANDARD=20 -DGMX_INSTALL_LEGACY_API=ON -DGMX_USE_TNG=OFF -DGMX_USE_COLVARS=NONE -DGMX_USE_PLUMED=OFF
CMAKE_EXTRA_OPTIONS: "-DCMAKE_CXX_FLAGS='-stdlib=libc++' -DCMAKE_CXX_STANDARD=20 -DGMX_INSTALL_LEGACY_API=ON -DGMX_USE_TNG=OFF -DGMX_USE_COLVARS=NONE -DGMX_USE_PLUMED=OFF"
COMPILER_MAJOR_VERSION: 14

Expand All @@ -35,6 +37,8 @@ gromacs:clang-14:cxx-20:build:
rules:
- !reference [.rules:merge-requests, rules]
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-22.04-llvm-14-cuda-12.1.0
variables:
CMAKE: /usr/local/cmake-3.29.3/bin/cmake
needs:
- job: gromacs:clang-14:cxx-20:configure

Expand All @@ -45,6 +49,7 @@ gromacs:clang-14:cxx-20:test:
- !reference [.rules:merge-requests, rules]
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-22.04-llvm-14-cuda-12.1.0
variables:
CMAKE: /usr/local/cmake-3.29.3/bin/cmake
GMX_FORCE_UPDATE_DEFAULT_CPU: 1
needs:
- job: gromacs:clang-14:cxx-20:build
Expand All @@ -55,6 +60,8 @@ gromacs:clang-14:cxx-20:regressiontest:
rules:
- !reference [.rules:merge-requests, rules]
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-22.04-llvm-14-cuda-12.1.0
variables:
CMAKE: /usr/local/cmake-3.29.3/bin/cmake
needs:
- job: gromacs:clang-14:cxx-20:build
- job: regressiontests:prepare
Expand Down
5 changes: 5 additions & 0 deletions admin/gitlab-ci/gromacs.matrix/gromacs.clang-14.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ gromacs:clang-14:configure:
- !reference [.rules:merge-requests, rules]
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-22.04-llvm-14-cuda-12.1.0
variables:
CMAKE: /usr/local/cmake-3.29.3/bin/cmake
COMPILER_MAJOR_VERSION: 14
CMAKE_EXTRA_OPTIONS: -DGMX_INSTALL_LEGACY_API=ON -DGMX_USE_TNG=no -DGMX_USE_COLVARS=NONE -DGMX_USE_PLUMED=OFF

Expand All @@ -35,6 +36,8 @@ gromacs:clang-14:build:
rules:
- !reference [.rules:merge-requests, rules]
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-22.04-llvm-14-cuda-12.1.0
variables:
CMAKE: /usr/local/cmake-3.29.3/bin/cmake
needs:
- job: gromacs:clang-14:configure

Expand All @@ -45,6 +48,7 @@ gromacs:clang-14:test:
- !reference [.rules:merge-requests, rules]
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-22.04-llvm-14-cuda-12.1.0
variables:
CMAKE: /usr/local/cmake-3.29.3/bin/cmake
GMX_FORCE_UPDATE_DEFAULT_CPU: 1
GMX_FILLERS_IN_LOCAL_STATE: 1
needs:
Expand All @@ -57,6 +61,7 @@ gromacs:clang-14:regressiontest:
- !reference [.rules:merge-requests, rules]
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-22.04-llvm-14-cuda-12.1.0
variables:
CMAKE: /usr/local/cmake-3.29.3/bin/cmake
GMX_FILLERS_IN_LOCAL_STATE: 1
needs:
- job: gromacs:clang-14:build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ gromacs-cp2k-9.1:gcc-11-nightly:configure:
# Dockefile generated with /admin/containers/scripted_gmx_docker_builds.py
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-24.04-gcc-11-cp2k-9.1
variables:
CMAKE: /usr/local/cmake-3.29.8/bin/cmake
KUBERNETES_CPU_LIMIT: 1
KUBERNETES_CPU_REQUEST: 1
KUBERNETES_MEMORY_REQUEST: 2Gi
Expand Down Expand Up @@ -57,6 +58,7 @@ gromacs-cp2k-9.1:gcc-11-nightly:build-test:
- !reference [.rules:nightly-not-for-release, rules]
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-24.04-gcc-11-cp2k-9.1
variables:
CMAKE: /usr/local/cmake-3.29.8/bin/cmake
KUBERNETES_CPU_LIMIT: 4
KUBERNETES_CPU_REQUEST: 4
KUBERNETES_MEMORY_REQUEST: 8Gi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ gromacs-cp2k-2024.2:gcc-14-nightly:configure:
# Dockefile generated with /admin/containers/scripted_gmx_docker_builds.py
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-24.04-gcc-14-cp2k-2024.2
variables:
CMAKE: /usr/local/cmake-3.29.8/bin/cmake
KUBERNETES_CPU_LIMIT: 1
KUBERNETES_CPU_REQUEST: 1
KUBERNETES_MEMORY_REQUEST: 2Gi
Expand Down Expand Up @@ -60,6 +61,7 @@ gromacs-cp2k-2024.2:gcc-14-nightly:build-test:
- !reference [.rules:nightly-not-for-release, rules]
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-24.04-gcc-14-cp2k-2024.2
variables:
CMAKE: /usr/local/cmake-3.29.8/bin/cmake
KUBERNETES_CPU_LIMIT: 4
KUBERNETES_CPU_REQUEST: 4
KUBERNETES_MEMORY_REQUEST: 8Gi
Expand Down
2 changes: 1 addition & 1 deletion admin/gitlab-ci/lint.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ clang-tidy:configure-schedule-cuda:
- !reference [.rules:post-merge-acceptance, rules]
image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-22.04-llvm-18-cuda-12.1.0
variables:
CMAKE: cmake
CMAKE: /usr/local/cmake-3.29.8/bin/cmake
COMPILER_MAJOR_VERSION: 18
BUILD_DIR: build-clang-tidy
CMAKE_EXTRA_OPTIONS: -DCLANG_TIDY=clang-tidy-$COMPILER_MAJOR_VERSION -DGMX_CLANG_TIDY=ON -DGMX_COMPILER_WARNINGS=ON -DGMX_CLANG_CUDA=ON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
image: ${CI_REGISTRY_IMAGE}/ci-ubuntu-24.04-llvm-19
stage: test
variables:
CMAKE: /usr/local/cmake-3.30.3/bin/cmake
COMPILER_MAJOR_VERSION: 19
KUBERNETES_CPU_LIMIT: 4
KUBERNETES_CPU_REQUEST: 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
image: ${CI_REGISTRY_IMAGE}/ci-ubuntu-22.04-llvm-14-cuda-12.1.0
stage: test
variables:
CMAKE: /usr/local/cmake-3.30.3/bin/cmake
COMPILER_MAJOR_VERSION: 14
KUBERNETES_CPU_LIMIT: 2
KUBERNETES_CPU_REQUEST: 2
Expand Down
2 changes: 1 addition & 1 deletion cmake/AdaptiveCppTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out https://www.gromacs.org.

cmake_minimum_required(VERSION 3.18)
cmake_minimum_required(VERSION 3.28)
project(AdaptiveCppTest)
find_package(adaptivecpp QUIET)
if(NOT adaptivecpp_FOUND)
Expand Down
2 changes: 0 additions & 2 deletions cmake/gmxManageCuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out https://www.gromacs.org.

cmake_minimum_required(VERSION 3.21.2)

set(GMX_GPU_CUDA ON)

option(GMX_CLANG_CUDA "Use clang for CUDA" OFF)
Expand Down
11 changes: 6 additions & 5 deletions cmake/gmxManageFFTLibraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,16 @@ if(${GMX_FFT_LIBRARY} STREQUAL "FFTW3")
message(STATUS "Found MKL at ${MKLROOT}")
endif()
add_library(MKL::MKL INTERFACE IMPORTED GLOBAL)
if(UNIX)
target_link_libraries(MKL::MKL INTERFACE -Wl,--start-group) #only necessary for static but doesn't hurt otherwise. cmake 3.24 has LINK_GROUP
endif()
foreach(_lib mkl_core mkl_sequential mkl_intel_lp64)
find_library(${_lib}_PATH "${_lib}" PATHS "${MKLROOT}/lib" "${MKLROOT}/lib/intel64" REQUIRED)
target_link_libraries(MKL::MKL INTERFACE "${${_lib}_PATH}")
if(NOT UNIX)
target_link_libraries(MKL::MKL INTERFACE "${${_lib}_PATH}")
endif()
endforeach()
if(UNIX)
target_link_libraries(MKL::MKL INTERFACE -Wl,--end-group -lpthread -lm -ldl)
# LINK_GROUP only necessary for static but doesn't hurt otherwise.
target_link_libraries(MKL::MKL INTERFACE "$<LINK_GROUP:RESCAN,mkl_core,mkl_sequential,mkl_intel_lp64>")
target_link_libraries(MKL::MKL INTERFACE -lpthread -lm -ldl)
endif()
target_link_directories(MKL::MKL INTERFACE "${MKLROOT}/lib" "${MKLROOT}/lib/intel64")
target_include_directories(MKL::MKL INTERFACE "${MKLROOT}/include")
Expand Down
5 changes: 2 additions & 3 deletions cmake/gmxManageGpuAwareMpi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ function(GMX_TEST_GPU_AWARE_MPI BACKEND)
string(TOUPPER "${BACKEND}" BACKEND_UPPER)
string(TOLOWER "${BACKEND}" BACKEND_LOWER)

# Note: MPI_COMPILE_FLAGS is an output variable controlled by FindMPI.cmake,
# but is deprecated since CMake 3.10.
list(JOIN MPI_COMPILE_FLAGS " " CMAKE_REQUIRED_FLAGS)
list(JOIN MPI_CXX_COMPILE_OPTIONS " " CMAKE_REQUIRED_FLAGS)
list(JOIN MPI_CXX_COMPILE_DEFINITIONS " " CMAKE_REQUIRED_DEFINITIONS)
set(CMAKE_REQUIRED_INCLUDES ${MPI_INCLUDE_PATH})
set(CMAKE_REQUIRED_LIBRARIES ${MPI_LIBRARIES})

Expand Down
3 changes: 0 additions & 3 deletions cmake/gmxManageNvshmem.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ if(GMX_NVSHMEM)
target_link_libraries(nvshmem_host_lib INTERFACE CUDA::nvml CUDA::cuda_driver)

add_library(nvshmem_device_lib STATIC IMPORTED GLOBAL)
# cuda separable compilation is properly supported from 3.20.1
# fix - https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5962
cmake_minimum_required(VERSION 3.20.1)
set_target_properties(nvshmem_device_lib PROPERTIES IMPORTED_LOCATION ${NVSHMEM_DEVICE_LIBS})
target_include_directories(nvshmem_device_lib INTERFACE $<BUILD_INTERFACE:${NVSHMEM_INCLUDE}>)
target_include_directories(nvshmem_device_lib INTERFACE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
Expand Down
14 changes: 1 addition & 13 deletions cmake/gmxManageSyclAdaptiveCpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,7 @@ if (GMX_ACPP_HAVE_HIP_TARGET AND GMX_GPU_FFT_ROCFFT)
endif()
if (ACPP_JSON AND NOT ACPP_ROCM_PATH)
file(READ "${ACPP_JSON}" ACPP_JSON_CONTENTS)
if (CMAKE_VERSION VERSION_LESS 3.19)
# We want the value encoded by the line
# "default-rocm-path" : "/opt/rocm",
# so we use regular expressions to remove everything before
# and after the relevant quotation marks.
#
# Remove this when GROMACS requires CMake 3.19 or higher, as the
# proper JSON parsing below is more robust.
string(REGEX REPLACE ".*\"default-rocm-path\" *: * \"" "" ACPP_ROCM_PATH_VALUE ${ACPP_JSON_CONTENTS})
string(REGEX REPLACE "\",.*" "" ACPP_ROCM_PATH_VALUE ${ACPP_ROCM_PATH_VALUE})
else()
string(JSON ACPP_ROCM_PATH_VALUE GET ${ACPP_JSON_CONTENTS} "default-rocm-path")
endif()
string(JSON ACPP_ROCM_PATH_VALUE GET ${ACPP_JSON_CONTENTS} "default-rocm-path")
set(ACPP_ROCM_PATH "${ACPP_ROCM_PATH_VALUE}" CACHE PATH "The default ROCm used by AdaptiveCpp/hipSYCL" FORCE)
endif()

Expand Down
5 changes: 1 addition & 4 deletions cmake/gmxManageSyclOneApi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,9 @@ if(NOT GMX_GPU_SYCL OR GMX_SYCL_ACPP OR NOT GMX_SYCL_DPCPP)
endif()

if(WIN32)
if(CMAKE_VERSION VERSION_LESS "3.23.0")
message(FATAL_ERROR "SYCL with DPC++ on Windows requires cmake 3.23 or later.")
endif()
if(NOT BUILD_SHARED_LIBS)
message(FATAL_ERROR "SYCL with DPC++ on Windows doesn't work with static libraries. Set BUILD_SHARED_LIBS=on.")
# Tested up to 3.23.1 and icx 2022.1. Problem is order of exe link argument order. Works if gromacs.lib
# Tested up to cmake 3.23.1 and icx 2022.1. Problem is order of exe link argument order. Works if gromacs.lib
# and -fsycl both appear before -link. Not possible to change order from cmake script. cmake fix is WIP.
endif()
endif()
Expand Down
Loading

0 comments on commit 812d99f

Please sign in to comment.