# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-cmake_minimum_required(VERSION 3.4.3)
+cmake_minimum_required(VERSION 3.9.6)
# 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
message("CMAKE_SHARED_LINKER_FLAGS: ${FFT_LINKER_FLAGS} ${MPI_LINKER_FLAGS}")
endif()
-if(NOT GMX_OPENMP)
- #Unset all OpenMP flags in case OpenMP was disabled either by the user
- #or because it was only partially detected (e.g. only for C but not C++ compiler)
- unset(OpenMP_C_FLAGS CACHE)
- unset(OpenMP_CXX_FLAGS CACHE)
-else()
- set(GMX_EXE_LINKER_FLAGS ${GMX_EXE_LINKER_FLAGS} ${OpenMP_LINKER_FLAGS})
- set(GMX_SHARED_LINKER_FLAGS ${GMX_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS})
-endif()
-
-
########################################################################
# Specify install locations
########################################################################
# Test older gcc
# Test oldest supported CUDA
+# Test oldest supported cmake
# Test oldest supported Ubuntu
# Test MPI with CUDA
# Test MPI with gcc
-# Test cmake version from before new FindCUDA support (in 3.8)
# Test MPMD PME with library MPI
-# Test recent cmake (3.7+), to cover minor FindCUDA changes from 3.7.0
-gcc-4.8 gpuhw=nvidia cuda-7.0 cmake-3.8.1 mpi npme=1 nranks=2 openmp
+gcc-4.8 gpuhw=nvidia cuda-7.0 cmake-3.9.6 mpi npme=1 nranks=2 openmp
# Test non-default use of mdrun -gpu_id
# Test newest gcc supported by newest CUDA at time of release
# Test thread-MPI with CUDA
-# Test older cmake version (< 3.7)
# Test SIMD implementation of pair search for GPU code-path
-gcc-7 gpuhw=nvidia gpu_id=1 cuda-10.0 thread-mpi openmp cmake-3.6.1 release-with-assert simd=avx2_256
+gcc-7 gpuhw=nvidia gpu_id=1 cuda-10.0 thread-mpi openmp cmake-3.10.0 release-with-assert simd=avx2_256
# Test with libcxx
# Test with ThreadSanitizer + OpenMP + SIMD
# Test fftpack fallback
gcc-8 double x11 no-tng fftpack simd=sse4.1
-# Test oldest supported cmake
# Test older clang
# Test clang in double precision
# Test without OpenMP
# Test thread-MPI
# Test AVX_128_FMA SIMD + Double (Important for Simd4N=Simd4 and sizeof(SimdInt32)!=4*GMX_SIMD_REAL_WIDTH)
# Test with TNG support
-clang-3.4 double simd=avx_128_fma thread-mpi no-openmp fftpack cmake-3.4.3 tng
+clang-3.4 double simd=avx_128_fma thread-mpi no-openmp fftpack cmake-3.11.4 tng
# Test newest clang at time of release
# Test with AddressSanitizer (without OpenMP, see below)
clang-7 no-openmp asan cmake-3.11.4
-# Test newest cmake at time of release
-# Test with clang-tidy (without OpenMP, cmake>=3.6)
+# Test with clang-tidy (without OpenMP)
clang-7 no-openmp cmake-3.12.1 tidy
# Test oldest supported MSVC on Windows
gcc-8 openmp simd=avx2_256 gpuhw=amd opencl-1.2 clFFT-2.14 buildfftw
# TODO
+# Test newest cmake at time of release
# Add OpenMP support to ASAN build (but libomp.so in clang-4 reports leaks, so might need a suitable build or suppression)
# Test hwloc-2 support
# Test newest supported LTS Ubuntu
# Test oldest supported gcc at time of release
# Test mpi support
# Test mdrun-only build
-gcc-4.8 mpi mdrun-only release cmake-3.8.1
+gcc-4.8 mpi mdrun-only release cmake-3.9.6
# Test static linking with gcc
# Test newest gcc at time of release
# Test static linking with clang
# Test double precision
# Test newest supported clang version
-clang-5 static double release cmake-3.6.1
+clang-5 static double release cmake-3.10.0
# Test with GPU support
# Test with newest CUDA at time of release
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016,2017,2019, 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.
# We should do OpenMP detection if we get here
# OpenMP check must come before other CFLAGS!
find_package(OpenMP)
- if(OPENMP_FOUND)
- # CMake on Windows doesn't support linker flags passed to target_link_libraries
- # (i.e. it treats /openmp as \openmp library file). Also, no OpenMP linker flags are needed.
- if(NOT (WIN32 AND NOT MINGW))
- if(CMAKE_COMPILER_IS_GNUCC AND GMX_PREFER_STATIC_OPENMP AND NOT APPLE)
- set(OpenMP_LINKER_FLAGS "-Wl,-static -lgomp -lrt -Wl,-Bdynamic -lpthread")
- set(OpenMP_SHARED_LINKER_FLAGS "")
- else()
- # Only set a linker flag if the user didn't set them manually
- if(NOT DEFINED OpenMP_LINKER_FLAGS)
- set(OpenMP_LINKER_FLAGS "${OpenMP_C_FLAGS}")
- endif()
- if(NOT DEFINED OpenMP_SHARED_LINKER_FLAGS)
- set(OpenMP_SHARED_LINKER_FLAGS "${OpenMP_C_FLAGS}")
- endif()
- endif()
- endif()
- if(MINGW)
- #GCC Bug 48659
- set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS} -mstackrealign")
- endif()
- else()
+ if(NOT OPENMP_FOUND)
message(WARNING
"The compiler you are using does not support OpenMP parallelism. This might hurt your performance a lot, in particular with GPUs. Try using a more recent version, or a different compiler. For now, we are proceeding by turning off OpenMP.")
set(GMX_OPENMP OFF CACHE STRING "Whether GROMACS will use OpenMP parallelism." FORCE)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+# Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019, 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.
if(NOT CLANG_TIDY_EXE)
message(FATAL_ERROR "clang-tidy not found.")
endif()
- if(CMAKE_VERSION VERSION_LESS "3.6")
- message(FATAL_ERROR "clang-tidy support requires cmake 3.6.")
- endif()
endif()
#####
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+# Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018,2019, 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.
PUBLIC
${GMX_PUBLIC_LIBRARIES}
)
+if (GMX_OPENMP)
+ target_link_libraries(libgromacs PUBLIC OpenMP::OpenMP_CXX)
+endif()
set_target_properties(libgromacs PROPERTIES
OUTPUT_NAME "gromacs${GMX_LIBS_SUFFIX}"
SOVERSION ${LIBRARY_SOVERSION_MAJOR}
VERSION ${LIBRARY_VERSION}
- COMPILE_FLAGS "${OpenMP_C_FLAGS}")
+ )
gmx_manage_lmfit()
target_link_libraries(libgromacs PRIVATE lmfit)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2018, by the GROMACS development team, led by
+# Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2018,2019, 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.
${GMX_STDLIB_LIBRARIES})
set(BINARY_NAME "mdrun${GMX_BINARY_SUFFIX}")
set_target_properties(mdrun PROPERTIES
- OUTPUT_NAME "${BINARY_NAME}"
- COMPILE_FLAGS "${OpenMP_C_FLAGS}")
+ OUTPUT_NAME "${BINARY_NAME}")
install(TARGETS mdrun DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT mdrun)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gmx-completion-${BINARY_NAME}.bash
"complete -o nospace -F _gmx_mdrun_compl ${BINARY_NAME}")
endif()
set(BINARY_NAME "gmx${GMX_BINARY_SUFFIX}")
set_target_properties(gmx PROPERTIES
- OUTPUT_NAME "${BINARY_NAME}"
- COMPILE_FLAGS "${OpenMP_C_FLAGS}")
+ OUTPUT_NAME "${BINARY_NAME}")
install(TARGETS gmx
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})