build the template program:
$ source /path/to/GMXRC
$ cmake /path/to/template
+Alternatively, setting CMAKE_PREFIX_PATH will direct cmake
+to find a particular GROMACS installation.
-The Makefile.pkg can be used if cmake is unavailble. It
+The Makefile.pkg can be used if cmake is unavailable. It
makes use of pkg-config only to build the template program:
$ source /path/to/GMXRC
$ make -f Makefile.pkg
+You will need to make sure that you use a sufficiently similar C++
+compiler and C++ Standard Library as the one that was used for
+compiling GROMACS, preferably the same one. If you used any system
+libraries (e.g. Boost, FFTW, BLAS, LAPACK) when installing GROMACS,
+then you will need make them available to the template build system
+also. The easiest way to do this is to have pkg-config installed on
+your system, and to source GMXRC from the GROMACS installation before
+you attempt to configure the template. A subset of Boost is supposed
+to be installed with GROMACS, but currently the automatic machinery
+does not detect that installation, so you may need to install Boost
+(headers only) in order to use the GROMACS template program.
+
+If the compiler used for GROMACS was capable of some C++11 features
+then, by default, those will be required for compiling the
+template. To make that work, you can either configure GROMACS with
+$ cmake -DGMX_CXX11=off
+or configure the template with the appropriate
+$ cmake -DCMAKE_CXX_FLAGS="-flag-for-your-compiler"
+You can find out the necessary flags from your compiler's documentation,
+or by inspecting the src/buildinfo.h file in the GROMACS build tree.
+
----------------------------------------------------------
If you are reading this in the distribution directory,
list(REMOVE_ITEM PC_GROMACS_LIBRARIES ${GROMACS_LIBRARY_NAME})
foreach (LIB ${PC_GROMACS_LIBRARIES})
find_library(GROMACS_${LIB} NAMES ${LIB}
- HINTS ${PC_GROMACS_LIBRARY_DIRS} @CMAKE_INSTALL_PREFIX@/@INCL_INSTALL_DIR@)
+ HINTS ${PC_GROMACS_LIBRARY_DIRS} @CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@)
list(APPEND GMX_DEP_LIBRARIES ${GROMACS_${LIB}})
unset(GROMACS_${LIB} CACHE)
endforeach(LIB)
if ("${GROMACS_PKG}" MATCHES "libgmx")
if (${GROMACS_VERSION} EQUAL 40000)
- find_path(GROMACS_INCLUDE_DIR tpxio.h HINTS ${PC_GROMACS_INCLUDE_DIRS})
+ find_path(GROMACS_INCLUDE_DIR tpxio.h HINTS ${PC_GROMACS_INCLUDE_DIRS} @CMAKE_INSTALL_PREFIX@/@INCL_INSTALL_DIR@)
else(${GROMACS_VERSION} EQUAL 40000)
- find_path(GROMACS_INCLUDE_DIR gromacs/tpxio.h HINTS ${PC_GROMACS_INCLUDE_DIRS})
+ find_path(GROMACS_INCLUDE_DIR gromacs/tpxio.h HINTS ${PC_GROMACS_INCLUDE_DIRS} @CMAKE_INSTALL_PREFIX@/@INCL_INSTALL_DIR@)
endif(${GROMACS_VERSION} EQUAL 40000)
elseif("${GROMACS_PKG}" MATCHES "libgromacs")
- find_path(GROMACS_INCLUDE_DIR gromacs/version.h HINTS ${PC_GROMACS_INCLUDE_DIRS})
+ find_path(GROMACS_INCLUDE_DIR gromacs/version.h HINTS ${PC_GROMACS_INCLUDE_DIRS} @CMAKE_INSTALL_PREFIX@/@INCL_INSTALL_DIR@)
endif("${GROMACS_PKG}" MATCHES "libgmx")
set(GROMACS_LIBRARIES "${GROMACS_LIBRARY};${GROMACS_DEP_LIBRARIES}" )
list(APPEND GROMACS_INCLUDE_DIRS ${PC_GROMACS_INCLUDE_DIRS})
endif(PC_GROMACS_INCLUDE_DIRS)
+if(NOT ${GROMACS_MAJOR_VERSION} LESS 5)
+ include(CheckIncludeFile)
+ # Let find_package find the subset of Boost installed with GROMACS
+ set(BOOST_INCLUDEDIR ${GROMACS_INCLUDE_DIRS}/gromacs/external/boost)
+ find_package(Boost 1.44.0 REQUIRED)
+ if(Boost_FOUND)
+ list(APPEND GROMACS_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
+ else()
+ message(FATAL_ERROR "Boost not found, compiling the GROMACS template will not work")
+ endif()
+endif()
+
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set GROMACS_FOUND to TRUE
# if all listed variables are TRUE