if(UNIX)
option(GMX_SYMLINK_OLD_BINARY_NAMES "Create symbolic links for pre-5.0 binary names" ON)
endif()
+option(GMX_BUILD_MDRUN_ONLY "Build and install only the mdrun binary" OFF)
if(UNIX)
option(GMX_PREFER_STATIC_LIBS "When finding libraries prefer static archives (not available on non-*nix platforms and it will only work if static versions of external dependencies are available and found)!" OFF)
message(STATUS "Using manually set library suffix: \"${GMX_LIBS_SUFFIX}\"")
endif (NOT SUFFIX_QUIETLY)
endif(GMX_DEFAULT_SUFFIX)
+if (GMX_BUILD_MDRUN_ONLY)
+ set(GMX_LIBS_SUFFIX "_mdrun${GMX_LIBS_SUFFIX}")
+endif ()
set(SUFFIX_QUIETLY TRUE CACHE INTERNAL "")
set(PKG_CFLAGS "")
# TODO: Propagate the above settings to the installed CMakeFiles.txt template
# (from share/template/)
set(PKG_CFLAGS "${PKG_CFLAGS} -DBOOST_NO_TYPEID -I${INCL_INSTALL_DIR}/gromacs/external/boost")
- install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/external/boost/boost
- DESTINATION ${INCL_INSTALL_DIR}/gromacs/external/boost
- COMPONENT development)
+ if (NOT GMX_BUILD_MDRUN_ONLY)
+ install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/external/boost/boost
+ DESTINATION ${INCL_INSTALL_DIR}/gromacs/external/boost
+ COMPONENT development)
+ endif ()
endif()
if (GMX_BUILD_FOR_COVERAGE)
add_definitions(-DNDEBUG -DBOOST_DISABLE_ASSERTS -DGMX_DISABLE_ASSERTS)
endif ()
-add_subdirectory(doxygen)
-add_subdirectory(share)
+if (NOT GMX_BUILD_MDRUN_ONLY)
+ add_subdirectory(doxygen)
+ add_subdirectory(share)
+ add_subdirectory(scripts)
+endif ()
add_subdirectory(src)
-add_subdirectory(scripts)
# Issue a warning if NVIDIA GPUs were detected, but CUDA was not found.
# Don't bother the user after the first configure pass.
include(CTest)
mark_as_advanced(BUILD_TESTING)
-#gmxtests target builds all binaries required for running gmxtest
-add_custom_target(gmxtests DEPENDS gmx links)
IF(BUILD_TESTING)
enable_testing()
- add_subdirectory(tests)
#"check" target builds and runs all tests
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
- add_dependencies(check gmxtests tests)
+ add_dependencies(check tests)
+ # TODO: This would be better within tests/CMakeLists.txt
+ if (NOT GMX_BUILD_MDRUN_ONLY)
+ #gmxtests target builds all binaries required for running gmxtest
+ add_custom_target(gmxtests DEPENDS gmx links)
+ add_dependencies(check gmxtests)
+ add_subdirectory(tests)
+ endif()
#TODO: Add warning if NOT REGRESSIONTEST_PATH OR NOT GMX_XML that regression/unit tests are not run.
ENDIF()
\begin{verbatim}
cmake .. -DCMAKE_TOOLCHAIN_FILE=BlueGeneQ-static-XL-C \
- -DCMAKE_PREFIX_PATH=/your/fftw/installation/prefix
-make mdrun
-make install-mdrun
+ -DCMAKE_PREFIX_PATH=/your/fftw/installation/prefix \
+ -DGMX_BUILD_MDRUN_ONLY=ON
+make
+make install
\end{verbatim}
It is possible to configure and make the remaining \gromacs{} tools
with the compute node toolchain, but as none of those tools are
configure_file(config.h.cmakein config.h)
configure_file(buildinfo.h.cmakein buildinfo.h)
-include(../cmake/BuildManPages.cmake)
+if (NOT GMX_BUILD_MDRUN_ONLY)
+ include(../cmake/BuildManPages.cmake)
+endif()
if (BUILD_TESTING)
add_custom_target(tests)
if (GMX_BUILD_UNITTESTS)
add_subdirectory(gromacs)
add_subdirectory(programs)
-if(NOT GMX_FAHCORE)
- add_subdirectory(ngmx)
+if (NOT GMX_FAHCORE AND NOT GMX_BUILD_MDRUN_ONLY)
+ add_subdirectory(ngmx)
+endif()
+if (NOT GMX_FAHCORE)
add_subdirectory(contrib)
-endif(NOT GMX_FAHCORE)
+endif()
set(LIBGROMACS_SOURCES)
-add_subdirectory(legacyheaders)
+function (gmx_install_headers DESTINATION)
+ if (NOT GMX_BUILD_MDRUN_ONLY)
+ if (DESTINATION)
+ set(DESTINATION ${INCL_INSTALL_DIR}/gromacs/${DESTINATION})
+ else()
+ set(DESTINATION ${INCL_INSTALL_DIR}/gromacs)
+ endif()
+ install(FILES ${ARGN} DESTINATION ${DESTINATION} COMPONENT development)
+ endif()
+endfunction ()
+
add_subdirectory(gmxlib)
add_subdirectory(mdlib)
add_subdirectory(gmxpreprocess)
-add_subdirectory(gmxana)
-add_subdirectory(analysisdata)
add_subdirectory(commandline)
add_subdirectory(fft)
add_subdirectory(linearalgebra)
add_subdirectory(onlinehelp)
add_subdirectory(options)
-add_subdirectory(selection)
-add_subdirectory(trajectoryanalysis)
add_subdirectory(utility)
-
-file(GLOB LIBGROMACS_HEADERS *.h)
-install(FILES ${LIBGROMACS_HEADERS} DESTINATION ${INCL_INSTALL_DIR}/gromacs
- COMPONENT development)
+if (NOT GMX_BUILD_MDRUN_ONLY)
+ add_subdirectory(legacyheaders)
+ add_subdirectory(gmxana)
+ add_subdirectory(analysisdata)
+ add_subdirectory(selection)
+ add_subdirectory(trajectoryanalysis)
+endif ()
list(APPEND LIBGROMACS_SOURCES ${GMXLIB_SOURCES} ${MDLIB_SOURCES})
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/version.h)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.h
- DESTINATION ${INCL_INSTALL_DIR}/gromacs
- COMPONENT development)
+file(GLOB LIBGROMACS_HEADERS *.h)
+configure_file(version.h.cmakein version.h)
+gmx_install_headers("" ${LIBGROMACS_HEADERS})
+gmx_install_headers("" ${CMAKE_CURRENT_BINARY_DIR}/version.h)
# Add target that generates gitversion.c every time make is run
# if git version info is requested
SOVERSION ${SOVERSION}
COMPILE_FLAGS "${OpenMP_C_FLAGS}")
-install(TARGETS libgromacs DESTINATION ${LIB_INSTALL_DIR} COMPONENT libraries)
+# Only install the library in mdrun-only mode if it is actually necessary
+# for the binary
+if (NOT GMX_BUILD_MDRUN_ONLY OR BUILD_SHARED_LIBS)
+ install(TARGETS libgromacs DESTINATION ${LIB_INSTALL_DIR} COMPONENT libraries)
+endif()
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libgromacs.pc.cmakein
- ${CMAKE_CURRENT_BINARY_DIR}/libgromacs.pc @ONLY)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgromacs.pc
- DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
- RENAME "libgromacs${GMX_LIBS_SUFFIX}.pc"
- COMPONENT development)
+if (NOT GMX_BUILD_MDRUN_ONLY)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libgromacs.pc.cmakein
+ ${CMAKE_CURRENT_BINARY_DIR}/libgromacs.pc @ONLY)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgromacs.pc
+ DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
+ RENAME "libgromacs${GMX_LIBS_SUFFIX}.pc"
+ COMPONENT development)
+endif()
if (INSTALL_CUDART_LIB) #can be set manual by user
if (GMX_GPU)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2010,2011,2012, by the GROMACS development team, led by
+# Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
# David van der Spoel, Berk Hess, Erik Lindahl, and including many
# others, as listed in the AUTHORS file in the top-level source
# directory and at http://www.gromacs.org.
arraydata.h
dataframe.h
datamodule.h)
-install(FILES ${ANALYSISDATA_PUBLIC_HEADERS}
- DESTINATION ${INCL_INSTALL_DIR}/gromacs/analysisdata
- COMPONENT development)
+gmx_install_headers(analysisdata ${ANALYSISDATA_PUBLIC_HEADERS})
add_subdirectory(modules)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2010, by the GROMACS development team, led by
+# Copyright (c) 2010,2013, by the GROMACS development team, led by
# David van der Spoel, Berk Hess, Erik Lindahl, and including many
# others, as listed in the AUTHORS file in the top-level source
# directory and at http://www.gromacs.org.
displacement.h
histogram.h
plot.h)
-install(FILES ${ANALYSISDATA_MODULES_PUBLIC_HEADERS}
- DESTINATION ${INCL_INSTALL_DIR}/gromacs/analysisdata/modules
- COMPONENT development)
+gmx_install_headers(analysisdata/modules ${ANALYSISDATA_MODULES_PUBLIC_HEADERS})
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2012, by the GROMACS development team, led by
+# Copyright (c) 2012,2013, by the GROMACS development team, led by
# David van der Spoel, Berk Hess, Erik Lindahl, and including many
# others, as listed in the AUTHORS file in the top-level source
# directory and at http://www.gromacs.org.
set(COMMANDLINE_PUBLIC_HEADERS
cmdlinehelpwriter.h
cmdlineparser.h)
-install(FILES ${COMMANDLINE_PUBLIC_HEADERS}
- DESTINATION ${INCL_INSTALL_DIR}/gromacs/commandline
- COMPONENT development)
+gmx_install_headers(commandline ${COMMANDLINE_PUBLIC_HEADERS})
-if (BUILD_TESTING)
+# mdrun build does not include the selection machinery, which is used in the
+# tests
+if (BUILD_TESTING AND NOT GMX_BUILD_MDRUN_ONLY)
add_subdirectory(tests)
-endif (BUILD_TESTING)
+endif()
set(FFT_PUBLIC_HEADERS
fft.h)
-install(FILES ${FFT_PUBLIC_HEADERS}
- DESTINATION ${INCL_INSTALL_DIR}/gromacs/fft
- COMPONENT development)
+gmx_install_headers(fft ${FFT_PUBLIC_HEADERS})
if (BUILD_TESTING)
add_subdirectory(tests)
matrix.h
mtxio.h
sparsematrix.h)
-install(FILES ${LINEARALGEBRA_PUBLIC_HEADERS}
- DESTINATION ${INCL_INSTALL_DIR}/gromacs/linearalgebra
- COMPONENT development)
+gmx_install_headers(linearalgebra ${LINEARALGEBRA_PUBLIC_HEADERS})
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2012, by the GROMACS development team, led by
+# Copyright (c) 2012,2013, by the GROMACS development team, led by
# David van der Spoel, Berk Hess, Erik Lindahl, and including many
# others, as listed in the AUTHORS file in the top-level source
# directory and at http://www.gromacs.org.
set(ONLINEHELP_PUBLIC_HEADERS
helptopicinterface.h)
-install(FILES ${ONLINEHELP_PUBLIC_HEADERS}
- DESTINATION ${INCL_INSTALL_DIR}/gromacs/onlinehelp
- COMPONENT development)
+gmx_install_headers(onlinehelp ${ONLINEHELP_PUBLIC_HEADERS})
if (BUILD_TESTING)
add_subdirectory(tests)
optionflags.h
options.h
timeunitmanager.h)
-install(FILES ${OPTIONS_PUBLIC_HEADERS}
- DESTINATION ${INCL_INSTALL_DIR}/gromacs/options
- COMPONENT development)
+gmx_install_headers(options ${OPTIONS_PUBLIC_HEADERS})
if (BUILD_TESTING)
add_subdirectory(tests)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2010,2012, by the GROMACS development team, led by
+# Copyright (c) 2010,2012,2013, by the GROMACS development team, led by
# David van der Spoel, Berk Hess, Erik Lindahl, and including many
# others, as listed in the AUTHORS file in the top-level source
# directory and at http://www.gromacs.org.
selectionenums.h
selectionoption.h
selectionoptionmanager.h)
-install(FILES ${SELECTION_PUBLIC_HEADERS}
- DESTINATION ${INCL_INSTALL_DIR}/gromacs/selection
- COMPONENT development)
+gmx_install_headers(selection ${SELECTION_PUBLIC_HEADERS})
if (BUILD_TESTING)
add_subdirectory(tests)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2010, by the GROMACS development team, led by
+# Copyright (c) 2010,2013, by the GROMACS development team, led by
# David van der Spoel, Berk Hess, Erik Lindahl, and including many
# others, as listed in the AUTHORS file in the top-level source
# directory and at http://www.gromacs.org.
analysismodule.h
analysissettings.h
cmdlinerunner.h)
-install(FILES ${TRAJECTORYANALYSIS_PUBLIC_HEADERS}
- DESTINATION ${INCL_INSTALL_DIR}/gromacs/trajectoryanalysis
- COMPONENT development)
+gmx_install_headers(trajectoryanalysis ${TRAJECTORYANALYSIS_PUBLIC_HEADERS})
if (BUILD_TESTING)
add_subdirectory(tests)
programinfo.h
stringutil.h
uniqueptr.h)
-install(FILES ${UTILITY_PUBLIC_HEADERS}
- DESTINATION ${INCL_INSTALL_DIR}/gromacs/utility
- COMPONENT development)
-install(FILES ${GENERATED_HEADER_CONFIG}
- DESTINATION ${INCL_INSTALL_DIR}/gromacs/utility
- COMPONENT development)
+gmx_install_headers(utility ${UTILITY_PUBLIC_HEADERS})
+gmx_install_headers(utility ${GENERATED_HEADER_CONFIG})
if (BUILD_TESTING)
add_subdirectory(tests)
if(GMX_FAHCORE)
add_library(fahcore ${MDRUN_SOURCES})
+elseif(GMX_BUILD_MDRUN_ONLY)
+ add_executable(mdrun ${MDRUN_SOURCES} mdrun_main.cpp)
+ target_link_libraries(mdrun
+ ${GMX_EXTRA_LIBRARIES} libgromacs ${GMX_EXE_LINKER_FLAGS})
+ set_target_properties(mdrun PROPERTIES
+ OUTPUT_NAME "mdrun${GMX_BINARY_SUFFIX}"
+ COMPILE_FLAGS "${OpenMP_C_FLAGS}")
+ install(TARGETS mdrun DESTINATION ${BIN_INSTALL_DIR} COMPONENT mdrun)
else()
file(GLOB GMX_EXECUTABLE_SOURCES gmx/*.c gmx/*.cpp)
add_executable(gmx ${GMX_EXECUTABLE_SOURCES} ${MDRUN_SOURCES})
--- /dev/null
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2013, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, 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.
+ */
+#include "mdrun/mdrun_main.h"
+
+#include "gromacs/commandline/cmdlinemodulemanager.h"
+
+int main(int argc, char *argv[])
+{
+ return gmx::CommandLineModuleManager::runAsMainCMain(argc, argv, &gmx_mdrun);
+}