2 # This file is part of the GROMACS molecular simulation package.
4 # Copyright (c) 2012,2013, by the GROMACS development team, led by
5 # David van der Spoel, Berk Hess, Erik Lindahl, and including many
6 # others, as listed in the AUTHORS file in the top-level source
7 # directory and at http://www.gromacs.org.
9 # GROMACS is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public License
11 # as published by the Free Software Foundation; either version 2.1
12 # of the License, or (at your option) any later version.
14 # GROMACS is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Lesser General Public License for more details.
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with GROMACS; if not, see
21 # http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 # If you want to redistribute modifications to GROMACS, please
25 # consider that scientific software is very special. Version
26 # control is crucial - bugs must be traceable. We will be happy to
27 # consider code for inclusion in the official distribution, but
28 # derived work must not be called official GROMACS. Details are found
29 # in the README & COPYING files - if they are missing, get the
30 # official version at http://www.gromacs.org.
32 # To help us fund GROMACS development, we humbly ask that you cite
33 # the research papers on the package. Check out http://www.gromacs.org.
36 #add here any programs you want to compile
40 # Uncomment the next line to build OpenMM:
41 #option(GMX_OPENMM "Accelerated execution on GPUs through the OpenMM library (no longer supported" ON)
43 # At run time, you may need to set the environment variable
44 # OPENMM_PLUGIN_DIR=PATH_TO_GROMACS/openmm/lib/plugins
49 message(FATAL_ERROR "The OpenMM build is not compatible with the native GPU build")
53 set (GMX_BINARY_SUFFIX "-openmm")
54 set (GMX_LIBS_SUFFIX "_openmm")
56 #######################################################################
57 # Check for options incompatible with OpenMM build #
58 #######################################################################
59 # we'll use the built-in fft to avoid unnecessary dependencies
60 string(TOUPPER ${GMX_FFT_LIBRARY} GMX_FFT_LIBRARY)
61 if(NOT ${GMX_FFT_LIBRARY} STREQUAL "FFTPACK")
62 message(STATUS "No external FFT libraries needed for the OpenMM build, switching to fftpack!")
63 set(GMX_FFT_LIBRARY "fftpack" CACHE STRING
64 "No external FFT libraries needed for the OpenMM build, switching to fftpack!" FORCE)
67 message(FATAL_ERROR "The OpenMM build is not compatible with MPI!")
70 message(STATUS "Thread-MPI not compatible with OpenMM, disabled!")
71 set(GMX_THREAD_MPI OFF CACHE BOOL
72 "Thread-MPI not compatible with OpenMM build, disabled!" FORCE)
75 message(STATUS "OpenMP multithreading not compatible with OpenMM, disabled")
76 set(GMX_OPENMP OFF CACHE BOOL
77 "OpenMP multithreading not compatible with OpenMM, disabled!" FORCE)
79 if(GMX_SOFTWARE_INVSQRT)
80 set(GMX_SOFTWARE_INVSQRT OFF CACHE STRING
81 "The OpenMM build does not need GROMACS software 1/sqrt!" FORCE)
82 endif(GMX_SOFTWARE_INVSQRT)
83 string(TOUPPER ${GMX_CPU_ACCELERATION} GMX_CPU_ACCELERATION)
84 if(NOT GMX_CPU_ACCELERATION STREQUAL "NONE")
85 message(STATUS "Switching off CPU-based acceleration, the OpenMM build does not support/need any!")
86 set(GMX_CPU_ACCELERATION "None" CACHE STRING
87 "Switching off CPU-based acceleration, the OpenMM build does not support/need any!" FORCE)
90 message(FATAL_ERROR "The OpenMM build does not support FAH build!")
93 message(FATAL_ERROR "The OpenMM-build does not support double precision calculations!")
96 set(CUDA_BUILD_EMULATION OFF)
97 find_package(CUDA 3.1 REQUIRED)
98 add_definitions(-DGMX_OPENMM)
99 if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
100 set(CUDA_VERBOSE_BUILD ON)
102 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/contrib)
105 # mark as advanced the unused variables
106 mark_as_advanced(FORCE GMX_CPU_ACCELERATION GMX_MPI GMX_FFT_LIBRARY
107 GMX_QMMM_PROGRAM GMX_THREAD_MPI GMX_DOUBLE)
111 mark_as_advanced(CLEAR GMX_CPU_ACCELERATION GMX_MPI GMX_FFT_LIBRARY
112 GMX_QMMM_PROGRAM GMX_THREAD_MPI GMX_DOUBLE)
116 foreach(PROG ${CONTRIB_PROGRAMS})
117 add_executable(${PROG} ${PROG}.c ${NGMX_COMMON_SOURCE})
118 set_target_properties(${PROG} PROPERTIES OUTPUT_NAME "${PROG}${GMX_BINARY_SUFFIX}")