Skip to content

Commit

Permalink
Add Colvars module version 2023-10-23
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomofiorin committed Nov 14, 2023
1 parent f4c99a1 commit 8e74589
Show file tree
Hide file tree
Showing 123 changed files with 52,864 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,10 @@ include(gmxManageLmfit)

include(gmxManageMuparser)

include(gmxManageColvars)

include(gmxManageLepton)

##################################################
# Process SIMD instruction settings
##################################################
Expand Down
1,008 changes: 1,008 additions & 0 deletions CMakeLists.txt.orig

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions api/legacy/include/gromacs/mdtypes/inputrec.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ struct gmx_enfrot;
struct gmx_enfrotgrp;
struct pull_params_t;

class colvarproxy_gromacs;

namespace gmx
{
class Awh;
Expand Down Expand Up @@ -587,6 +589,10 @@ struct t_inputrec // NOLINT (clang-analyzer-optin.performance.Padding)

//! KVT for storing simulation parameters that are not part of the mdp file.
std::unique_ptr<gmx::KeyValueTreeObject> internalParameters;

/* COLVARS */
bool bColvars = false; /* Do we do colvars calculations ? */
colvarproxy_gromacs *colvars_proxy = nullptr; /* The object for the colvars calculations */
};

int tcouple_min_integration_steps(TemperatureCoupling etc);
Expand Down
57 changes: 57 additions & 0 deletions cmake/gmxManageColvars.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# This file is part of the GROMACS molecular simulation package.
#
# Copyright 2023- The GROMACS Authors
# and the project initiators Erik Lindahl, Berk Hess and David van der Spoel.
# Consult the AUTHORS/COPYING files and https://www.gromacs.org for details.
#
# 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
# https://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 https://www.gromacs.org.
#
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out https://www.gromacs.org.

# Build Colvars library as bundled in a GROMACS worktree; not supporting external linkage yet
gmx_option_multichoice(GMX_USE_COLVARS
"Build the collective variables (Colvars) library interfaced with GROMACS"
INTERNAL
INTERNAL NONE)
mark_as_advanced(GMX_USE_COLVARS)

function(gmx_manage_colvars)
if(GMX_USE_COLVARS STREQUAL "INTERNAL")
file(GLOB COLVARS_SOURCES ${PROJECT_SOURCE_DIR}/src/external/colvars/*.cpp)
add_library(colvars OBJECT ${COLVARS_SOURCES})
# Set correctly the value of __cplusplus, which MSVC doesn't do by default
target_compile_options(colvars PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus>)
set(HAVE_COLVARS 1 CACHE INTERNAL "Is Colvars available?")
else()
set(HAVE_COLVARS 0 CACHE INTERNAL "Is Colvars available?")
endif()
endfunction()

function(gmx_include_colvars_headers)
if(GMX_USE_COLVARS STREQUAL "INTERNAL")
target_include_directories(libgromacs PRIVATE ${PROJECT_SOURCE_DIR}/src/external/colvars)
endif()
endfunction()
22 changes: 22 additions & 0 deletions cmake/gmxManageLepton.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file is part of the Collective Variables module (Colvars).
# The original version of Colvars and its updates are located at:
# https://github.com/Colvars/colvars
# Please update all Colvars source files before making any changes.
# If you wish to distribute your changes, please submit them to the
# Colvars repository at GitHub.

function(gmx_manage_lepton)

# Add Lepton library, which is developed and distributed as part of OpenMM:
# https://github.com/openmm/openmm

file(GLOB LEPTON_SOURCES ${PROJECT_SOURCE_DIR}/src/external/lepton/src/*.cpp)
add_library(lepton OBJECT ${LEPTON_SOURCES})

target_include_directories(lepton PRIVATE ${PROJECT_SOURCE_DIR}/src/external/lepton/include)
target_compile_options(lepton PRIVATE -DLEPTON_BUILDING_STATIC_LIBRARY)

# Set flags so that Colvars can leverage Lepton functionality
target_include_directories(colvars PRIVATE ${PROJECT_SOURCE_DIR}/src/external/lepton/include)
target_compile_options(colvars PRIVATE -DLEPTON -DLEPTON_USE_STATIC_LIBRARIES)
endfunction()
2 changes: 1 addition & 1 deletion cmake/gmxVersionInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ set(REGRESSIONTEST_MD5SUM "15b29966b53accf5306c9a3d7e009963" CACHE INTERNAL "MD5
# If you are distributing a patch to GROMACS, then this change would
# be great as part of your patch. Otherwise for personal use, you can
# also just set a CMake cache variable.
set(GMX_VERSION_STRING_OF_FORK "" CACHE INTERNAL
set(GMX_VERSION_STRING_OF_FORK "Colvars-2023-10-23" CACHE INTERNAL
"Version string for forks of GROMACS to set to describe themselves")
mark_as_advanced(GMX_VERSION_STRING_OF_FORK)
if (GMX_VERSION_STRING_OF_FORK)
Expand Down
Loading

0 comments on commit 8e74589

Please sign in to comment.