Before following this section, DeePMD-kit C++ interface should have be installed.
Download source code of a supported gromacs version (2020.2) from https://manual.gromacs.org/2020.2/download.html. Run the following command:
export PATH=$PATH:$deepmd_kit_root/bin
dp_gmx_patch -d $gromacs_root -v $version -p
where deepmd_kit_root
is the directory where the latest version of deepmd-kit is installed, and gromacs_root
refers to the source code directory of gromacs. And version
represents the version of gromacs, only support 2020.2 now. If attempting to patch another version of gromacs you will still need to set version
to 2020.2
as this is the only supported version, we cannot guarantee that patching other versions of gromacs will work.
The C++ interface of deepmd-kit 2.x
and tensorflow 2.x
are required. And be aware that only deepmd-kit with high precision is supported now, since we cannot ensure single precision is enough for a GROMACS simulation. Here is a sample compile script:
#!/bin/bash
export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
export CMAKE_PREFIX_PATH="/path/to/fftw-3.3.9" # fftw libraries
mkdir build
cd build
cmake3 .. -DCMAKE_CXX_STANDARD=14 \ # not required, but c++14 seems to be more compatible with higher version of tensorflow
-DGMX_MPI=ON \
-DGMX_GPU=CUDA \ # Gromacs on ROCm has not been fully developed yet
-DCUDA_TOOLKIT_ROOT_DIR=/path/to/cuda \
-DCMAKE_INSTALL_PREFIX=/path/to/gromacs-2020.2-deepmd
make -j
make install