Commit c8d5e6b8 authored by Nicholas Breen's avatar Nicholas Breen

New upstream version 2019~beta2

parent 9f252b4c
...@@ -40,13 +40,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_ ...@@ -40,13 +40,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_
project(Gromacs) project(Gromacs)
# Use ccache if available to wrap CMAKE_C_COMPILER and CMAKE_CXX_COMPILER. include(gmxManageCcache)
# Reference https://ccache.samba.org
option(ENABLE_CCACHE "Allow CMake to use ccache compiler wrappers if available." ON)
# CMAKE_C_COMPILER and CMAKE_CXX_COMPILER do not change after this line.
if(ENABLE_CCACHE)
include(gmxCcache)
endif()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
...@@ -904,6 +898,9 @@ if (BUILD_TESTING) ...@@ -904,6 +898,9 @@ if (BUILD_TESTING)
endif() endif()
if (NOT GMX_BUILD_MDRUN_ONLY) if (NOT GMX_BUILD_MDRUN_ONLY)
find_package(ImageMagick QUIET COMPONENTS convert)
include(gmxTestImageMagick)
GMX_TEST_IMAGEMAGICK(IMAGE_CONVERT_POSSIBLE)
add_subdirectory(docs) add_subdirectory(docs)
add_subdirectory(share) add_subdirectory(share)
add_subdirectory(scripts) add_subdirectory(scripts)
......
...@@ -5,7 +5,7 @@ Installation guide ...@@ -5,7 +5,7 @@ Installation guide
Introduction to building GROMACS Introduction to building GROMACS
================================ ================================
These instructions pertain to building GROMACS 2019-beta1. You might These instructions pertain to building GROMACS 2019-beta2. You might
also want to check the up-to-date installation instructions. also want to check the up-to-date installation instructions.
...@@ -28,8 +28,8 @@ Quick and dirty installation ...@@ -28,8 +28,8 @@ Quick and dirty installation
Or, as a sequence of commands to execute: Or, as a sequence of commands to execute:
tar xfz gromacs-2019-beta1.tar.gz tar xfz gromacs-2019-beta2.tar.gz
cd gromacs-2019-beta1 cd gromacs-2019-beta2
mkdir build mkdir build
cd build cd build
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON
...@@ -166,7 +166,7 @@ offer competitive performance. We recommend against PGI because the ...@@ -166,7 +166,7 @@ offer competitive performance. We recommend against PGI because the
performance with C++ is very bad. performance with C++ is very bad.
The xlc compiler is not supported and has not been tested on POWER The xlc compiler is not supported and has not been tested on POWER
architectures for GROMACS-2019-beta1. We recommend to use the gcc architectures for GROMACS-2019-beta2. We recommend to use the gcc
compiler instead, as it is being extensively tested. compiler instead, as it is being extensively tested.
You may also need the most recent version of other compiler toolchain You may also need the most recent version of other compiler toolchain
...@@ -246,14 +246,14 @@ version for GROMACS code as used as the host compiler for nvcc. ...@@ -246,14 +246,14 @@ version for GROMACS code as used as the host compiler for nvcc.
To make it possible to use other accelerators, GROMACS also includes To make it possible to use other accelerators, GROMACS also includes
OpenCL support. The minimum OpenCL version required is 1.2. The OpenCL support. The minimum OpenCL version required is 1.2. The
current OpenCL implementation is recommended for use with GCN-based current OpenCL implementation is recommended for use with GCN-based
AMD GPUs, on Linux we recommend the ROCm runtime. For Intel GPUs it is AMD GPUs, and on Linux we recommend the ROCm runtime. Intel integrated
required to compile with "-DGMX_OCL_NB_CLUSTER_SIZE=4" and the Neo GPUs are supported with the Neo drivers. OpenCL is also supported with
driver is recommended. It is also supported with NVIDIA GPUs, but NVIDIA GPUs, but using the latest NVIDIA driver (which includes the
using the latest NVIDIA driver (which includes the NVIDIA OpenCL NVIDIA OpenCL runtime) is recommended. Also note that there are
runtime) is recommended. Also note that there are performance performance limitations (inherent to the NVIDIA OpenCL runtime). It is
limitations (inherent to the NVIDIA OpenCL runtime). It is not not possible to configure both CUDA and OpenCL support in the same
possible to configure both CUDA and OpenCL support in the same version build of GROMACS, nor to support both Intel and other vendors’ GPUs
of GROMACS. with OpenCL.
MPI support MPI support
...@@ -434,8 +434,8 @@ the name of the directory containing the "CMakeLists.txt" file of the ...@@ -434,8 +434,8 @@ the name of the directory containing the "CMakeLists.txt" file of the
code you want to build. For example, download the source tarball and code you want to build. For example, download the source tarball and
use use
tar xfz gromacs-2019-beta1.tgz tar xfz gromacs-2019-beta2.tgz
cd gromacs-2019-beta1 cd gromacs-2019-beta2
mkdir build-gromacs mkdir build-gromacs
cd build-gromacs cd build-gromacs
cmake .. cmake ..
...@@ -716,11 +716,13 @@ version could be considered in non performance-critical use-cases. ...@@ -716,11 +716,13 @@ version could be considered in non performance-critical use-cases.
OpenCL GPU acceleration OpenCL GPU acceleration
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
The primary target of the GROMACS OpenCL support is accelerating The primary targets of the GROMACS OpenCL support is accelerating
simulations on AMD hardware, both discrete GPUs and APUs (integrated simulations on AMD and Intel hardware. For AMD, we target both
CPU+GPU chips). The GROMACS OpenCL on NVIDIA GPUs works, but discrete GPUs and APUs (integrated CPU+GPU chips), and for Intel we
performance and other limitations make it less practical (for details target the integrated GPUs found on modern workstation and mobile
see the user guide). hardware. The GROMACS OpenCL on NVIDIA GPUs works, but performance and
other limitations make it less practical (for details see the user
guide).
To build GROMACS with OpenCL support enabled, two components are To build GROMACS with OpenCL support enabled, two components are
required: the OpenCL headers and the wrapper library that acts as a required: the OpenCL headers and the wrapper library that acts as a
...@@ -742,6 +744,11 @@ To trigger an OpenCL build the following CMake flags must be set ...@@ -742,6 +744,11 @@ To trigger an OpenCL build the following CMake flags must be set
cmake .. -DGMX_GPU=ON -DGMX_USE_OPENCL=ON cmake .. -DGMX_GPU=ON -DGMX_USE_OPENCL=ON
To build with support for Intel integrated GPUs, it is required to add
"-DGMX_OPENCL_NB_CLUSTER_SIZE=4" to the cmake command line, so that
the GPU kernels match the characteristics of the hardware. The Neo
driver is recommended.
On Mac OS, an AMD GPU can be used only with OS version 10.10.4 and On Mac OS, an AMD GPU can be used only with OS version 10.10.4 and
higher; earlier OS versions are known to run incorrectly. higher; earlier OS versions are known to run incorrectly.
...@@ -1015,7 +1022,7 @@ The simplest way to run the checks is to build GROMACS with ...@@ -1015,7 +1022,7 @@ The simplest way to run the checks is to build GROMACS with
"-DREGRESSIONTEST_DOWNLOAD", and run "make check". GROMACS will "-DREGRESSIONTEST_DOWNLOAD", and run "make check". GROMACS will
automatically download and run the tests for you. Alternatively, you automatically download and run the tests for you. Alternatively, you
can download and unpack the GROMACS regression test suite can download and unpack the GROMACS regression test suite
http://gerrit.gromacs.org/download/regressiontests-2019-beta1.tar.gz http://gerrit.gromacs.org/download/regressiontests-2019-beta2.tar.gz
tarball yourself and use the advanced "cmake" option tarball yourself and use the advanced "cmake" option
"REGRESSIONTEST_PATH" to specify the path to the unpacked tarball, "REGRESSIONTEST_PATH" to specify the path to the unpacked tarball,
which will then be used for testing. If the above does not work, then which will then be used for testing. If the above does not work, then
......
#!/usr/bin/env bash #!/usr/bin/env bash
# Set up compiler wrapper to make it easier to use ccache. # Set up compiler wrapper used for ccache.
# #
# Xcode generator doesn't include the compiler as the # Xcode generator doesn't include the compiler as the
# first argument, Ninja and Makefiles do. Handle both cases. # first argument, Ninja and Makefiles do. Handle both cases.
...@@ -8,4 +8,4 @@ shift ...@@ -8,4 +8,4 @@ shift
fi fi
export CCACHE_CPP2=true export CCACHE_CPP2=true
exec "${_c_launcher}" "${CMAKE_C_COMPILER}" "$@" exec "${CCACHE_PROGRAM}" "${CMAKE_C_COMPILER}" "$@"
#!/usr/bin/env bash #!/usr/bin/env bash
# Set up compiler wrapper to make it easier to use ccache. # Set up compiler wrapper used for ccache.
# #
# Xcode generator doesn't include the compiler as the # Xcode generator doesn't include the compiler as the
# first argument, Ninja and Makefiles do. Handle both cases. # first argument, Ninja and Makefiles do. Handle both cases.
...@@ -8,4 +8,4 @@ shift ...@@ -8,4 +8,4 @@ shift
fi fi
export CCACHE_CPP2=true export CCACHE_CPP2=true
exec "${_cxx_launcher}" "${CMAKE_CXX_COMPILER}" "$@" exec "${CCACHE_PROGRAM}" "${CMAKE_CXX_COMPILER}" "$@"
...@@ -32,8 +32,27 @@ ...@@ -32,8 +32,27 @@
# To help us fund GROMACS development, we humbly ask that you cite # To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org. # the research papers on the package. Check out http://www.gromacs.org.
# Reference https://crascit.com/2016/04/09/using-ccache-with-cmake/ # Permit the use of ccache (when available in the system path or
# # CMAKE_PREFIX_PATH), which wraps the CMAKE_C_COMPILER and
# CMAKE_CXX_COMPILER to speed up build times. Reference
# https://ccache.samba.org and
# https://crascit.com/2016/04/09/using-ccache-with-cmake/
option(GMX_ENABLE_CCACHE "Allow CMake to use ccache compiler wrappers if available." OFF)
if(NOT GMX_ENABLE_CCACHE)
return()
endif()
if(GMX_CLANG_TIDY)
message(FATAL_ERROR "ccache does not work with the wrapper script used for "
"clang-tidy builds. Use -DGMX_ENABLE_CCACHE=off.")
endif()
if(GMX_CLANG_ANALYZER)
message(FATAL_ERROR "ccache does not work with the wrapper script used for "
"clang-analyzer builds. Use -DGMX_ENABLE_CCACHE=off.")
endif()
# Here we try to make sure that ccache is invoked as `/.../ccache compiler args` to best handle more than one local # Here we try to make sure that ccache is invoked as `/.../ccache compiler args` to best handle more than one local
# compiler or a compiler wrapper, whereas it is otherwise common to replace the default compilers with symbolic links # compiler or a compiler wrapper, whereas it is otherwise common to replace the default compilers with symbolic links
# to the ccache binary. # to the ccache binary.
...@@ -43,74 +62,75 @@ ...@@ -43,74 +62,75 @@
find_program(CCACHE_PROGRAM ccache) find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM) if(CCACHE_PROGRAM)
# Check whether C compiler wrapper has been set up. # Check whether C compiler wrapper has been set up.
if(NOT DEFINED GMX_CACHE_C_COMPILER) if(NOT DEFINED GMX_CCACHE_C_COMPILER)
# Determine whether we have a cacheable compiler. # Determine whether we have a cacheable compiler.
set(_cacheable OFF) set(_cacheable OFF)
if (CMAKE_C_COMPILER_ID MATCHES "GNU" if (CMAKE_C_COMPILER_ID MATCHES "GNU"
OR CMAKE_C_COMPILER_ID MATCHES "AppleClang" OR CMAKE_C_COMPILER_ID MATCHES "AppleClang"
OR CMAKE_C_COMPILER_ID MATCHES "Clang") OR CMAKE_C_COMPILER_ID MATCHES "Clang")
message(STATUS "Setting up ccache wrapper for ${CMAKE_C_COMPILER_ID} C compiler ${CMAKE_C_COMPILER}") message(STATUS "Setting up ccache wrapper for ${CMAKE_C_COMPILER_ID} C compiler ${CMAKE_C_COMPILER}")
set(_c_launcher "${CCACHE_PROGRAM}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/admin/ccache-wrapper-c.in ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ccache-wrapper-c)
configure_file(launch-c.in ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/launch-c) file(COPY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ccache-wrapper-c
unset(_c_launcher)
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/launch-c
DESTINATION ${CMAKE_BINARY_DIR} DESTINATION ${CMAKE_BINARY_DIR}
FILE_PERMISSIONS FILE_PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
) )
set(_cacheable ON) set(_cacheable ON)
else() else()
message(STATUS "Disabling ccache set up. Not confirmed to work with compiler ID ${CMAKE_C_COMPILER_ID}.") message(FATAL_ERROR "Cannot set up ccache, as it is not confirmed to "
endif() # GNU C compiler "work with compiler ID ${CMAKE_C_COMPILER_ID}.")
set(GMX_CACHE_C_COMPILER ${_cacheable} CACHE INTERNAL "Whether the C compiler will be wrapped for caching.") endif()
set(GMX_CCACHE_C_COMPILER ${_cacheable} CACHE INTERNAL "Whether the C compiler will be wrapped for caching.")
unset(_cacheable) unset(_cacheable)
endif() # defined endif() # defined
# Check whether we should use the wrapper. If so, set CMAKE variables. # Check whether we should use the wrapper. If so, set CMAKE variables.
if(GMX_CACHE_C_COMPILER) if(GMX_CCACHE_C_COMPILER)
if(CMAKE_GENERATOR STREQUAL "Xcode") if(CMAKE_GENERATOR STREQUAL "Xcode")
# Set Xcode project attributes to route compilation and linking # Set Xcode project attributes to route compilation and linking
# through our scripts # through our scripts
set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/launch-c") set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/ccache-wrapper-c")
set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_BINARY_DIR}/launch-c") set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_BINARY_DIR}/ccache-wrapper-c")
else() else()
# Support Unix Makefiles and Ninja # Support Unix Makefiles and Ninja
set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/launch-c") set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/ccache-wrapper-c")
endif() endif()
endif(GMX_CACHE_C_COMPILER) endif()
# Check whether CXX compiler wrapper has been set up # Check whether CXX compiler wrapper has been set up
if(NOT DEFINED GMX_CACHE_CXX_COMPILER) if(NOT DEFINED GMX_CCACHE_CXX_COMPILER)
# Determine whether we have a cacheable compiler. # Determine whether we have a cacheable compiler.
set(_cacheable OFF) set(_cacheable OFF)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" if (CMAKE_CXX_COMPILER_ID MATCHES "GNU"
OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang"
OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(STATUS "Setting up ccache wrapper for ${CMAKE_CXX_COMPILER_ID} CXX compiler ${CMAKE_CXX_COMPILER}") message(STATUS "Setting up ccache wrapper for ${CMAKE_CXX_COMPILER_ID} CXX compiler ${CMAKE_CXX_COMPILER}")
set(_cxx_launcher "${CCACHE_PROGRAM}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/admin/ccache-wrapper-cxx.in ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ccache-wrapper-cxx)
configure_file(launch-cxx.in ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/launch-cxx) file(COPY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ccache-wrapper-cxx
unset(_cxx_launcher)
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/launch-cxx
DESTINATION ${CMAKE_BINARY_DIR} DESTINATION ${CMAKE_BINARY_DIR}
FILE_PERMISSIONS FILE_PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
) )
set(_cacheable ON) set(_cacheable ON)
else() else()
message(STATUS "Skipping ccache set up. Not confirmed to work with compiler ID ${CMAKE_CXX_COMPILER_ID}.") message(FATAL_ERROR "Cannot set up ccache, as it is not confirmed to "
endif() # GNU C++ compiler "work with compiler ID ${CMAKE_CXX_COMPILER_ID}.")
set(GMX_CACHE_CXX_COMPILER ${_cacheable} CACHE INTERNAL "Whether the C++ compiler will be wrapped for caching.") endif()
set(GMX_CCACHE_CXX_COMPILER ${_cacheable} CACHE INTERNAL "Whether the C++ compiler will be wrapped for caching.")
unset(_cacheable) unset(_cacheable)
endif() # defined endif() # defined
# Check whether we should use the wrapper. If so, set CMAKE variables. # Check whether we should use the wrapper. If so, set CMAKE variables.
if(GMX_CACHE_CXX_COMPILER) if(GMX_CCACHE_CXX_COMPILER)
if(CMAKE_GENERATOR STREQUAL "Xcode") if(CMAKE_GENERATOR STREQUAL "Xcode")
# Set Xcode project attributes to route compilation and linking # Set Xcode project attributes to route compilation and linking
# through our scripts # through our scripts
set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_BINARY_DIR}/launch-cxx") set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_BINARY_DIR}/ccache-wrapper-cxx")
set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_BINARY_DIR}/launch-cxx") set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_BINARY_DIR}/ccache-wrapper-cxx")
else() else()
# Support Unix Makefiles and Ninja # Support Unix Makefiles and Ninja
set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/launch-cxx") set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/ccache-wrapper-cxx")
endif() endif()
endif(GMX_CACHE_CXX_COMPILER) endif()
endif(CCACHE_PROGRAM) # ccache program else()
message(FATAL_ERROR "GMX_ENABLE_CCACHE requires that the ccache executable "
"can be found. Add its path to the CMAKE_PREFIX_PATH path")
endif()
...@@ -64,8 +64,8 @@ add_definitions(${OpenCL_DEFINITIONS}) ...@@ -64,8 +64,8 @@ add_definitions(${OpenCL_DEFINITIONS})
include_directories(SYSTEM ${OpenCL_INCLUDE_DIRS}) include_directories(SYSTEM ${OpenCL_INCLUDE_DIRS})
set(GMX_OCL_NB_CLUSTER_SIZE 8 CACHE STRING "Cluster size used by nonbonded OpenCL kernel. Set to 4 for Intel GPUs.") set(GMX_OPENCL_NB_CLUSTER_SIZE 8 CACHE STRING "Cluster size used by nonbonded OpenCL kernel. Set to 4 for Intel GPUs.")
mark_as_advanced(GMX_OCL_NB_CLUSTER_SIZE) mark_as_advanced(GMX_OPENCL_NB_CLUSTER_SIZE)
macro(gmx_gpu_setup) macro(gmx_gpu_setup)
# no OpenMP is no good! # no OpenMP is no good!
......
#
# This file is part of the GROMACS molecular simulation package.
#
# Copyright (c) 2018, 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.
#
# GROMACS is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1
# of the License, or (at your option) any later version.
#
# GROMACS is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with GROMACS; if not, see
# http://www.gnu.org/licenses, or write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# If you want to redistribute modifications to GROMACS, please
# consider that scientific software is very special. Version
# control is crucial - bugs must be traceable. We will be happy to
# consider code for inclusion in the official distribution, but
# derived work must not be called official GROMACS. Details are found
# in the README & COPYING files - if they are missing, get the
# official version at http://www.gromacs.org.
#
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
# - Define macro to check if image conversion using ImageMagick convert
# actually works, because recent changes to it made it necessary to set
# a number of flags in /etc/ImageMagick-6/policy.xml. If a sample
# conversion fails due to this, the user is informed about this being
# a possible issue.
#
# GMX_TEST_IMAGEMAGICK(VARIABLE)
#
# VARIABLE will be set in the cache to either true or false
# if convert is working or not.
function(GMX_TEST_IMAGEMAGICK VARIABLE)
set(value_ OFF)
if(NOT ${ImageMagick_CONVERT_FOUND})
MESSAGE(STATUS "No image conversion possible without ImageMagick")
elseif(NOT DEFINED ${VARIABLE})
set(TEMPDIR "${CMAKE_CURRENT_BINARY_DIR}/imagemagicktmp")
FILE(MAKE_DIRECTORY ${TEMPDIR})
set(SAMPLE_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/TestImageMagickConvert.pdf")
set(SAMPLE_OUTPUT "${TEMPDIR}/TestImageMagickConvert.png")
execute_process(
COMMAND ${ImageMagick_convert_EXECUTABLE} ${SAMPLE_INPUT} -antialias -quality 03 -quiet -pointsize 12 -density 1200 -units PixelsPerInch ${SAMPLE_OUTPUT}
RESULT_VARIABLE TEST_OUTPUT
OUTPUT_QUIET
ERROR_QUIET
)
FILE(REMOVE_RECURSE ${TEMPDIR})
if (${TEST_OUTPUT} EQUAL 0)
set(value_ ON)
else()
MESSAGE(STATUS "Could not convert sample image, ImageMagick convert can not be used")
endif()
endif()
set(${VARIABLE} ${value_} CACHE INTERNAL "Test if image conversion works")
endfunction()
...@@ -201,7 +201,7 @@ set(GMX_VERSION_PATCH 0) ...@@ -201,7 +201,7 @@ set(GMX_VERSION_PATCH 0)
# candidates, where it signifies the most recent such release from # candidates, where it signifies the most recent such release from
# this branch; it will be empty before the first such release, as well # this branch; it will be empty before the first such release, as well
# as after the final release is out. # as after the final release is out.
set(GMX_VERSION_SUFFIX "-beta1") set(GMX_VERSION_SUFFIX "-beta2")
# Conventionally with libtool, any ABI change must change the major # Conventionally with libtool, any ABI change must change the major
# version number, the minor version number should change if it's just # version number, the minor version number should change if it's just
...@@ -241,7 +241,7 @@ set(REGRESSIONTEST_BRANCH "refs/heads/master") ...@@ -241,7 +241,7 @@ set(REGRESSIONTEST_BRANCH "refs/heads/master")
# build the regressiontests tarball with all the right naming. The # build the regressiontests tarball with all the right naming. The
# naming affects the md5sum that has to go here, and if it isn't right # naming affects the md5sum that has to go here, and if it isn't right
# release workflow will report a failure. # release workflow will report a failure.
set(REGRESSIONTEST_MD5SUM "3f1896a5aab8fcfb8c252e05e329b504" CACHE INTERNAL "MD5 sum of the regressiontests tarball for this GROMACS version") set(REGRESSIONTEST_MD5SUM "3d06d41e07f523d70ae575b9ad75c670" CACHE INTERNAL "MD5 sum of the regressiontests tarball for this GROMACS version")
math(EXPR GMX_VERSION_NUMERIC math(EXPR GMX_VERSION_NUMERIC
"${GMX_VERSION_MAJOR}*10000 + ${GMX_VERSION_PATCH}") "${GMX_VERSION_MAJOR}*10000 + ${GMX_VERSION_PATCH}")
......
...@@ -65,7 +65,13 @@ if (DEFINED PYTHON_EXECUTABLE) ...@@ -65,7 +65,13 @@ if (DEFINED PYTHON_EXECUTABLE)
set(PythonInterp_FIND_QUIETLY ON) set(PythonInterp_FIND_QUIETLY ON)
endif() endif()
find_package(PythonInterp 2.7) find_package(PythonInterp 2.7)
find_package(Sphinx ${EXPECTED_SPHINX_VERSION} QUIET COMPONENTS pygments)
if (NOT ${PYTHON_VERSION_MAJOR} EQUAL 3)
find_package(Sphinx ${EXPECTED_SPHINX_VERSION} QUIET COMPONENTS pygments)
else()
MESSAGE(STATUS "Can not build documentation with Python 3")
endif()
# Even if we aren't going to make the full webpage, set up to put all # Even if we aren't going to make the full webpage, set up to put all
# the documentation output in the same place, for convenience # the documentation output in the same place, for convenience
...@@ -87,6 +93,45 @@ if (SOURCE_IS_SOURCE_DISTRIBUTION) ...@@ -87,6 +93,45 @@ if (SOURCE_IS_SOURCE_DISTRIBUTION)
endif() endif()
add_subdirectory(doxygen) add_subdirectory(doxygen)
# TODO: Consider whether this could just be replaced by using
# GMX_DEVELOPER_BUILD to control this as well.
option(GMX_BUILD_MANUAL "Whether to try to configure to build the PDF manual" OFF)
mark_as_advanced(GMX_BUILD_MANUAL)
set(MANUAL_BUILD_IS_POSSIBLE ON)
set(MANUAL_BUILD_NOT_POSSIBLE_REASON)
set(NO_IMAGE_CONVERT_REASON)
if (NOT GMX_BUILD_MANUAL)
# Make sure we only do detection of manual-building dependencies
# when the user opted in for that.
set(MANUAL_BUILD_IS_POSSIBLE OFF)
set(MANUAL_BUILD_NOT_POSSIBLE_REASON "GMX_BUILD_MANUAL is not ON")
elseif (BUILD_IS_INSOURCE)
# UseLATEX.cmake does not work with an in-source build
set(MANUAL_BUILD_IS_POSSIBLE OFF)
set(MANUAL_BUILD_NOT_POSSIBLE_REASON "the build is in-source")
else()
include(manual/UseLATEX.cmake)
if(${PYTHON_VERSION_MAJOR} EQUAL 3)
set(MANUAL_BUILD_IS_POSSIBLE OFF)
set(MANUAL_BUILD_NOT_POSSIBLE_REASON "We can not build the documentation when using python3")
elseif(NOT SPHINX_FOUND)
set(MANUAL_BUILD_IS_POSSIBLE OFF)
set(MANUAL_BUILD_NOT_POSSIBLE_REASON "Sphinx has not been found and is needed to create the LaTex input files")
elseif(NOT PDFLATEX_COMPILER OR NOT IMAGE_CONVERT_POSSIBLE)
set(MANUAL_BUILD_IS_POSSIBLE OFF)
set(MANUAL_BUILD_NOT_POSSIBLE_REASON "pdflatex or some other dependency (ImageMagick convert) is not available")
if (NOT IMAGE_CONVERT_POSSIBLE)
set(NO_IMAGE_CONVERT_REASON "Can not convert files for online or pdf manual")
endif()
# TODO Later, identify other dependencies like bibtex,
# make_index, date, some graphics conversion program,
# etc. Perhaps patch UseLATEX.cmake and contribute upstream.
endif()
endif()
if (SPHINX_FOUND) if (SPHINX_FOUND)
# We need to have all the Sphinx input files in a single directory, and # We need to have all the Sphinx input files in a single directory, and
# since some of them are generated, we copy everything into the build tree, # since some of them are generated, we copy everything into the build tree,
...@@ -107,13 +152,40 @@ if (SPHINX_FOUND) ...@@ -107,13 +152,40 @@ if (SPHINX_FOUND)
endif() endif()
# The reference manual still contains the individual sections from the # The reference manual still contains the individual sections from the
# LaTeX document, with the files below grouped and annotated by chapter. # LaTeX document, with the files below grouped and annotated by chapter.
set(REFERENCEMANUAL_SPHINX_FILES set(REFERENCEMANUAL_SPHINX_FILES_GENERAL
# Main index file, preface and introduction. # Main index file, preface and introduction.
reference-manual/index.rst reference-manual/index.rst
reference-manual/preface.rst reference-manual/preface.rst
reference-manual/introduction.rst reference-manual/introduction.rst
# Definitions and Units chapter # Definitions and Units chapter
reference-manual/definitions.rst reference-manual/definitions.rst
# Topologies chapter
reference-manual/topologies.rst
reference-manual/topologies/particle-type.rst
reference-manual/topologies/parameter-files.rst
reference-manual/topologies/molecule-definition.rst
reference-manual/topologies/constraint-algorithm-section.rst
reference-manual/topologies/pdb2gmx-input-files.rst
reference-manual/topologies/topology-file-formats.rst
reference-manual/topologies/force-field-organization.rst
# File formats chapter
reference-manual/file-formats.rst
# Run parameters and programs chapter
reference-manual/run-parameters.rst
# Implementation details chapter
reference-manual/details.rst
# Averages and fluctations chapter
reference-manual/averages.rst
# References
reference-manual/references.rst
# PNG formated plot files that don't need to be converted into PNG
# for the web page.
reference-manual/plots/peregrine.png
reference-manual/plots/adress.png
reference-manual/plots/plotje.png
reference-manual/plots/xvgr.png
)
set(REFERENCEMANUAL_SPHINX_FILES_WITH_IMAGES
# Algorithms chapter # Algorithms chapter
reference-manual/algorithms.rst reference-manual/algorithms.rst
reference-manual/algorithms/periodic-boundary-conditions.rst reference-manual/algorithms/periodic-boundary-conditions.rst
...@@ -142,17 +214,6 @@ if (SPHINX_FOUND) ...@@ -142,17 +214,6 @@ if (SPHINX_FOUND)
reference-manual/functions/nonbonded-interactions.rst reference-manual/functions/nonbonded-interactions.rst
reference-manual/functions/polarization.rst reference-manual/functions/polarization.rst
reference-manual/functions/restraints.rst reference-manual/functions/restraints.rst
# Topologies chapter
reference-manual/topologies.rst
reference-manual/topologies/particle-type.rst
reference-manual/topologies/parameter-files.rst
reference-manual/topologies/molecule-definition.rst
reference-manual/topologies/constraint-algorithm-section.rst
reference-manual/topologies/pdb2gmx-input-files.rst
reference-manual/topologies/topology-file-formats.rst
reference-manual/topologies/force-field-organization.rst
# File formats chapter
reference-manual/file-formats.rst
# Special topics chapter # Special topics chapter
reference-manual/special.rst reference-manual/special.rst
reference-manual/special/free-energy-implementation.rst reference-manual/special/free-energy-implementation.rst
...@@ -168,8 +229,6 @@ if (SPHINX_FOUND) ...@@ -168,8 +229,6 @@ if (SPHINX_FOUND)
reference-manual/special/qmmm.rst reference-manual/special/qmmm.rst
reference-manual/special/vmd-imd.rst reference-manual/special/vmd-imd.rst
reference-manual/special/membrane-embedding.rst reference-manual/special/membrane-embedding.rst
# Run parameters and programs chapter
reference-manual/run-parameters.rst
# Analysis chapter # Analysis chapter
reference-manual/analysis.rst reference-manual/analysis.rst
reference-manual/analysis/using-groups.rst reference-manual/analysis/using-groups.rst
...@@ -185,20 +244,7 @@ if (SPHINX_FOUND) ...@@ -185,20 +244,7 @@ if (SPHINX_FOUND)
reference-manual/analysis/covariance-analysis.rst