Version bumps after new release
[alexxy/gromacs.git] / CMakeLists.txt
index ffab22d20af413fdb33981ee3c8966df72684cad..c3f49cecbcf56f86eb299af2dde0b5c5538bb1d3 100644 (file)
@@ -58,15 +58,15 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 # 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.5-dev")
+set(PROJECT_VERSION "5.0.7-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.5-dev")
+set(REGRESSIONTEST_VERSION "5.0.7-dev")
 # The MD5 checksum of the regressiontest tarball. Only used if "-dev"
 # is not present in the PROJECT_VERSION
-set(REGRESSIONTEST_MD5SUM "81e8ff1600495ce2a57706dca9d73482")
+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
@@ -105,6 +105,9 @@ set(API_VERSION ${NUM_VERSION})
 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)
@@ -265,10 +268,16 @@ gmx_option_multichoice(
     "${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
@@ -328,6 +337,11 @@ option(GMX_DEVELOPER_BUILD
     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
 ######################################################################
@@ -473,6 +487,11 @@ include(gmxManageSharedLibraries)
 # 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
@@ -608,13 +627,6 @@ if (GMX_BUILD_UNITTESTS AND NOT HAVE_LIBXML2)
         "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
 ########################################################################
@@ -871,7 +883,13 @@ include(gmxManageSuffixes)
 # 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