Skip to content

Instantly share code, notes, and snippets.

@jinalee314
Last active January 13, 2026 00:48
Show Gist options
  • Select an option

  • Save jinalee314/f5f8b735152e594e605e1784c22eb665 to your computer and use it in GitHub Desktop.

Select an option

Save jinalee314/f5f8b735152e594e605e1784c22eb665 to your computer and use it in GitHub Desktop.
Install DeePMD-kit, PLUMED (v2.8.2), and LAMMPS (stable_2Aug2023_update3)
## Works for Della cluster at Princeton University as of 6/27/2024
ssh della-vis1 # use for installation
cd /directory-to-download-your-source-code-to/
## DeePMD-kit installation
git clone https://github.com/deepmodeling/deepmd-kit.git deepmd-kit-new # can choose folder name
cd deepmd-kit-new
deepmd_source_dir=`pwd`
cd ..
module load anaconda3/2024.2
conda create --name dp_plmd python=3.10
conda activate dp_plmd
module load cudatoolkit/12.4 # load when using deepmd-kit in this conda environment
module load cudnn/cuda-11.x/8.2.0 # load when using deepmd-kit in this conda environment
pip install --upgrade tensorflow --no-cache-dir
cd $deepmd_source_dir
export DP_VARIANT=cuda
export CUDAToolkit_ROOT=$CUDA_HOME
pip install .
cd $deepmd_source_dir/source
mkdir build
cd build
deepmd_root=$deepmd_source_dir/deepmd-kit-new/deepmd_root
cmake -DUSE_TF_PYTHON_LIBS=TRUE \
      -DCMAKE_INSTALL_PREFIX=$deepmd_root \
      -DUSE_CUDA_TOOLKIT=TRUE \
      -DCUDAToolkit_ROOT=$CUDA_HOME \
      -DCMAKE_BUILD_TYPE=Release \
      ..
make -j 10
make install
make lammps
## PLUMED installation
cd ..
wget https://github.com/plumed/plumed2/archive/refs/tags/v2.8.2.tar.gz
tar -zxvf v2.8.2.tar.gz
cd plumed2-2.8.2
# IMPORTANT STEP IF YOU HAVE CUSTOM MADE CV: copy any .cpp files for collective variables directly into /src/colvar
./configure --prefix=$CONDA_PREFIX --enable-modules=all CXX=mpicxx CXXFLAGS="-Ofast"
make lib-plumed args="-p $CONDA_PREFIX"
make install
## LAMMPS installation
cd ..
wget https://github.com/lammps/lammps/archive/stable_2Aug2023_update3.tar.gz
tar -zxvf stable_2Aug2023_update3.tar.gz
cd lammps-stable_2Aug2023_update3/src/
cp -r $deepmd_source_dir/source/build/USER-DEEPMD DEEPMD
module load fftw/gcc/3.3.9 # load when using LAMMPS in this environment
module load openmpi/gcc/4.1.2 # load when using LAMMPS in this environment
make yes-kspace
make yes-extra-fix
make yes-deepmd
make yes-molecule
make yes-rigid
make yes-manybody
make yes-extra
make yes-plumed
# add any additional packages needed
make mpi -j 10
make install
# Making a symbolic link to the lmp_mpi executable in the LAMMPS source directory. While this executable is technically
# accessible from any conda environment since it's in ~/.local/bin, it's not guaranteed that the auxiliary packages will work.
ln -s $PWD/lmp_mpi ~/.local/bin/lmp_plmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment