#
# Copyright (c) 2009,2010,2011,2012,2013 by the GROMACS development team.
# Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team.
-# Copyright (c) 2019,2020, by the GROMACS development team, led by
+# Copyright (c) 2019,2020,2021, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
# Providing a default value >=10.14 helps to find modern C++ compatibility,
# such as by defaulting to the Clang libc++ instead of libstdc++.
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14 CACHE STRING
- "OS X deployment target affects default SDK version and compiler flags."
- FORCE)
+ "OS X deployment target affects default SDK version and compiler flags.")
# By default, limit the binary architecture to a single 64-bit build.
set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
"OS X architecture affects the compatibility of the (potentially fat) binaries produced."
include(gmxBuildTypeTSAN)
include(gmxBuildTypeASAN)
include(gmxBuildTypeMSAN)
+include(gmxBuildTypeUBSAN)
include(gmxBuildTypeReleaseWithAssert)
if(NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel Reference RelWithAssert Profile TSAN ASAN MSAN." FORCE)
+ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel Reference RelWithAssert Profile TSAN ASAN MSAN UBSAN." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
- "MinSizeRel" "RelWithDebInfo" "Reference" "RelWithAssert" "Profile" "TSAN" "ASAN" "MSAN")
+ "MinSizeRel" "RelWithDebInfo" "Reference" "RelWithAssert" "Profile" "TSAN" "ASAN" "MSAN" "UBSAN")
endif()
if(CMAKE_CONFIGURATION_TYPES)
# Add appropriate GROMACS-specific build types for the Visual
gmx_option_multichoice(
GMX_GPU
"Framework for GPU acceleration"
- None
- None CUDA OpenCL)
+ OFF
+ OFF CUDA OpenCL SYCL)
gmx_option_multichoice(
GMX_SIMD
"SIMD instruction set for CPU kernels and compiler optimization"
"AUTO"
- AUTO None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256 AVX2_128 AVX_512 AVX_512_KNL MIC ARM_NEON ARM_NEON_ASIMD IBM_VMX IBM_VSX Sparc64_HPC_ACE Reference)
+ AUTO None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256 AVX2_128 AVX_512 AVX_512_KNL MIC ARM_NEON ARM_NEON_ASIMD ARM_SVE IBM_VMX IBM_VSX Sparc64_HPC_ACE Reference)
if(GMX_TARGET_MIC)
set(GMX_FFT_LIBRARY_DEFAULT "mkl")
# These need to be done early (before further tests).
#####################################################################
+include(gmxTestIntelLLVM)
include(gmxCFlags)
gmx_c_flags()
check_cxx_source_compiles("int main(){ return __builtin_clzll(1);}" HAVE_BUILTIN_CLZLL)
if(MSVC)
check_cxx_source_compiles("#include <intrin.h>\n int main(){unsigned long r;unsigned long i=1;_BitScanReverse(&r,i);return r;}" HAVE_BITSCANREVERSE)
- check_cxx_source_compiles("#include <intrin.h>\n int main(){unsigned long r;unsigned __int64 i=1;_BitScanReverse(&r,i);return r;}" HAVE_BITSCANREVERSE64)
+ check_cxx_source_compiles("#include <intrin.h>\n int main(){unsigned long r;unsigned __int64 i=1;_BitScanReverse64(&r,i);return r;}" HAVE_BITSCANREVERSE64)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "XL")
check_cxx_source_compiles("int main(){ return __cntlz4(1);}" HAVE_CNTLZ4)
check_cxx_source_compiles("int main(){ return __cntlz8(1);}" HAVE_CNTLZ8)
message(FATAL_ERROR "HWLOC package support required, but not found.")
endif()
+ if (HWLOC_FOUND AND HWLOC_VERSION VERSION_LESS "2")
+ message(STATUS "Support for hwloc versions 1.x is deprecated")
+ endif()
+
set(HWLOC_FIND_QUIETLY_AFTER_FIRST_RUN TRUE CACHE INTERNAL "Be quiet during future attempts to find HWLOC")
endif()
include(gmxManageLmfit)
-string(TOUPPER "${GMX_GPU}" _gmx_gpu_uppercase)
-if(NOT ${_gmx_gpu_uppercase} STREQUAL "NONE")
+if(GMX_GPU)
+ string(TOUPPER "${GMX_GPU}" _gmx_gpu_uppercase)
if(${_gmx_gpu_uppercase} STREQUAL "CUDA")
include(gmxManageCuda)
elseif(${_gmx_gpu_uppercase} STREQUAL "OPENCL")
+ message(STATUS "GPU support with OpenCL is deprecated. It is still fully supported (and "
+ "recommended for AMD and Intel GPUs). It may be replaced by different approaches in "
+ "future releases of GROMACS.")
include(gmxManageOpenCL)
+ elseif(${_gmx_gpu_uppercase} STREQUAL "SYCL")
+ include(gmxManageSYCL)
endif()
if(NOT GMX_OPENMP)
message(WARNING "To use GPU acceleration efficiently, mdrun requires OpenMP multi-threading, which is currently not enabled.")
endif()
-# Not ideal to set this without the GPU acceleration, but the source presently requires GMX_GPU
-# to be set to GMX_GPU_None for a non-GPU build to work.
-set(GMX_GPU_ACCELERATION_FRAMEWORK "GMX_GPU_${_gmx_gpu_uppercase}")
-
if(CYGWIN)
set(GMX_CYGWIN 1)
endif()
endif()
endif()
+# People might want to customize the default location for the DSSP binary
+set(GMX_DSSP_PROGRAM_PATH "/usr/local/bin/dssp"
+ CACHE PATH
+ "The default location to use for the DSSP binary")
+mark_as_advanced(GMX_DSSP_PROGRAM_PATH)
+
# Link real-time library for POSIX timers. The check for clock_gettime
# confirms the linkability of rt.
if(HAVE_TIME_H AND HAVE_UNISTD_H AND HAVE_CLOCK_GETTIME)
# # # # # # # # # # 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}")
- set(CMAKE_SHARED_LINKER_FLAGS "${FFT_LINKER_FLAGS} ${MPI_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}")
+ 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}")
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}")