#
# 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.4-dev")
+set(PROJECT_VERSION "5.0.6-dev")
# 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.4-dev")
+set(REGRESSIONTEST_VERSION "5.0.6-dev")
# The MD5 checksum of the regressiontest tarball. Only used if "-dev"
# is not present in the PROJECT_VERSION
-set(REGRESSIONTEST_MD5SUM "9a72c01017a09be959e2aa66f5be2315")
+set(REGRESSIONTEST_MD5SUM "c3258e8c3162ce851718d1649e33e565")
# 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)
"${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
########################################################################
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