#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2009,2010,2011,2012,2013,2014,2015, 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.
# NOTE: when releasing the "-dev" suffix needs to be stripped off!
# REGRESSIONTEST_VERSION and REGRESSIONTEST_BRANCH should always be
# defined.
-set(PROJECT_VERSION "5.0.3-dev")
+set(PROJECT_VERSION "5.0.6")
# If this is a released tarball, "-dev" will not be present in
# PROJECT_VERSION, and REGRESSIONTEST_VERSION specifies the version
# number of the regressiontest tarball against which the code tarball
# can be tested. This will be the version of the last patch release.
-set(REGRESSIONTEST_VERSION "5.0.3-dev")
+set(REGRESSIONTEST_VERSION "5.0.6")
# The MD5 checksum of the regressiontest tarball. Only used if "-dev"
# is not present in the PROJECT_VERSION
-set(REGRESSIONTEST_MD5SUM "004f2377adf252e2caa9c241390d4b9c")
+set(REGRESSIONTEST_MD5SUM "0f3b41e7a0fbb43efd6793d2b2fedacc")
# If this is not a released tarball, "-dev" will be present in
# PROJECT_VERSION, and REGRESSIONTEST_BRANCH specifies the name of the
# gerrit.gromacs.org branch whose HEAD can test this code, *if* this
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND UNIX)
set(CMAKE_INSTALL_PREFIX "/usr/local/gromacs" CACHE STRING "Installation prefix (installation will need write permissions here)" FORCE)
endif()
+if("${CMAKE_INSTALL_PREFIX}" STREQUAL "${CMAKE_BINARY_DIR}")
+ message(FATAL_ERROR "GROMACS cannot be installed into the build tree, choose a different location for CMAKE_INSTALL_PREFIX")
+endif()
include(gmxBuildTypeReference)
include(gmxBuildTypeTSAN)
if(GMX_BUILD_HOSTNAME AND NOT "${GMX_BUILD_HOSTNAME}" STREQUAL "${TMP_HOSTNAME}")
message(WARNING "
The CMake cache, probably generated on a different host (${GMX_BUILD_HOSTNAME}),
- is being reused! This could lead to inconsitencies; therefore, it is
+ is being reused! This could lead to inconsistencies; therefore, it is
recommended to regenerate the cache!")
endif()
set(GMX_BUILD_HOSTNAME "${TMP_HOSTNAME}" CACHE INTERNAL
"${GMX_SUGGESTED_SIMD}"
None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256 IBM_QPX Sparc64_HPC_ACE Reference)
+if(GMX_TARGET_MIC)
+ set(GMX_FFT_LIBRARY_DEFAULT "mkl")
+else()
+ set(GMX_FFT_LIBRARY_DEFAULT "fftw3")
+endif()
+
gmx_option_multichoice(
GMX_FFT_LIBRARY
"FFT library"
- "fftw3"
+ "${GMX_FFT_LIBRARY_DEFAULT}"
fftw3 mkl "fftpack[built-in]")
gmx_dependent_option(
GMX_BUILD_OWN_FFTW
OFF)
mark_as_advanced(GMX_DEVELOPER_BUILD)
+option(GMX_BUILD_SHARED_EXE
+ "Build exectuables as shared binaries. If not set, this disables rpath and dynamic linker flags in an attempt to build a static binary, but this may require setting up the toolchain properly and making appropriate libraries available."
+ ON)
+mark_as_advanced(GMX_BUILD_SHARED_EXE)
+
######################################################################
# Detect OpenMP support
######################################################################
check_include_files(sched.h HAVE_SCHED_H)
check_include_files(regex.h HAVE_POSIX_REGEX)
-check_include_file_cxx(regex HAVE_CXX11_REGEX)
# TODO: It could be nice to inform the user if no regex support is found,
# as selections won't be fully functional.
# Find external packages #
########################################################################
+# TNG wants zlib if it is available. And static libxml2 might have a dependency
+find_package(ZLIB QUIET)
+include(gmxTestZLib)
+gmx_test_zlib(HAVE_ZLIB)
+
# Unconditionally find the package, as it is also required for unit
# tests. This exports LIBXML2_FOUND, which we should not use because
# it does not tell us that linking will succeed. Instead, we test that
"Either set GMX_BUILD_UNITTESTS=OFF or tell CMake how to find a working version of libxml2.")
endif()
-if(GMX_USE_TNG AND NOT GMX_EXTERNAL_TNG)
- # TNG wants zlib if it is available
- find_package(ZLIB QUIET)
- include(gmxTestZLib)
- gmx_test_zlib(HAVE_ZLIB)
-endif()
-
########################################################################
# Generate development version info for cache
########################################################################
include(gmxTestCXX11)
gmx_test_cxx11(GMX_CXX11_SUPPORTED GMX_CXX11_FLAGS)
include(CMakeDependentOption)
+# clang with some older versions of boost fail to work with C++11
+if(CMAKE_CXX_COMPILER_ID MATCHES Clang AND
+ (Boost_VERSION VERSION_EQUAL 104601 OR Boost_VERSION VERSION_EQUAL 104700))
+ set(CLANG_AND_OLD_EXTERNAL_BOOST TRUE)
+endif()
# nvcc does not support C++11 flags, so with GPUs we prefer to skip C++11 flags
# entirely to keep the compilation environment uniform.
cmake_dependent_option(GMX_CXX11
"Use C++11 features"
- ON "GMX_CXX11_SUPPORTED AND NOT GMX_GPU" OFF)
+ ON "GMX_CXX11_SUPPORTED AND NOT GMX_GPU AND NOT CLANG_AND_OLD_EXTERNAL_BOOST" OFF)
mark_as_advanced(GMX_CXX11)
if(GMX_CXX11)
set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} ${GMX_CXX11_FLAGS}")
endif()
+# Now we can test for CXX11_REGEX include file
+check_include_file_cxx(regex HAVE_CXX11_REGEX)
include(gmxTestXDR)
gmx_test_xdr(GMX_SYSTEM_XDR)
# CMake supports RPATH on OS X only from 2.8.12 upwards.
# CMAKE_SYSTEM_VERSION > 8.0 matches OS X 10.5 and above, where RPATH support
# was added.
-if((NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") OR
+
+if(NOT GMX_BUILD_SHARED_EXE)
+ # No rpath
+ set(CMAKE_SKIP_RPATH TRUE)
+ set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS) # remove -Wl,-Bdynamic
+ set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
+elseif((NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") OR
((CMAKE_SYSTEM_VERSION VERSION_GREATER 8.0) AND (NOT CMAKE_VERSION VERSION_LESS 2.8.12)))
# The build folder always has bin/ and lib/; if we are also going to
# install to lib/, then the installation RPATH works also in the build