1.3. Install LAMMPS

您所在的位置:网站首页 deepmd安装 1.3. Install LAMMPS

1.3. Install LAMMPS

2024-06-02 10:47| 来源: 网络整理| 查看: 265

1.3. Install LAMMPS

There are two ways to install LAMMPS: the built-in mode and the plugin mode. The built-in mode builds LAMMPS along with the DeePMD-kit and DeePMD-kit will be loaded automatically when running LAMMPS. The plugin mode builds LAMMPS and a plugin separately, so one needs to use plugin load command to load the DeePMD-kit’s LAMMPS plugin library.

1.3.1. Install LAMMPS’s DeePMD-kit module (built-in mode)

DeePMD-kit provides a module for running MD simulation with LAMMPS. Now make the DeePMD-kit module for LAMMPS.

cd $deepmd_source_dir/source/build make lammps

DeePMD-kit will generate a module called USER-DEEPMD in the build directory. If you need the low precision version, move env_low.sh to env.sh in the directory. Now download the LAMMPS code (29Oct2020 or later), and uncompress it:

cd /some/workspace wget https://github.com/lammps/lammps/archive/stable_29Sep2021_update2.tar.gz tar xf stable_29Sep2021_update2.tar.gz

The source code of LAMMPS is stored in directory lammps-stable_29Sep2021_update2. Now go into the LAMMPS code and copy the DeePMD-kit module like this

cd lammps-stable_29Sep2021_update2/src/ cp -r $deepmd_source_dir/source/build/USER-DEEPMD .

Now build LAMMPS

make yes-kspace make yes-user-deepmd make mpi -j4

If everything works fine, you will end up with an executable lmp_mpi.

./lmp_mpi -h

The DeePMD-kit module can be removed from LAMMPS source code by

make no-user-deepmd 1.3.2. Install LAMMPS (plugin mode)

Starting from 8Apr2021, LAMMPS also provides a plugin mode, allowing one to build LAMMPS and a plugin separately.

Now download the LAMMPS code (8Apr2021 or later), and uncompress it:

cd /some/workspace wget https://github.com/lammps/lammps/archive/stable_29Sep2021_update2.tar.gz tar xf stable_29Sep2021_update2.tar.gz

The source code of LAMMPS is stored in directory lammps-stable_29Sep2021_update2. Now go into the LAMMPS directory and create a directory called build

mkdir -p lammps-stable_29Sep2021_update2/build/ cd lammps-stable_29Sep2021_update2/build/

Now build LAMMPS. Note that PLUGIN and KSPACE package must be enabled, and BUILD_SHARED_LIBS must be set to yes. You can install any other package you want.

cmake -D PKG_PLUGIN=ON -D PKG_KSPACE=ON -D LAMMPS_INSTALL_RPATH=ON -D BUILD_SHARED_LIBS=yes -D CMAKE_INSTALL_PREFIX=${deepmd_root} -D CMAKE_INSTALL_LIBDIR=lib -D CMAKE_INSTALL_FULL_LIBDIR=${deepmd_root}/lib ../cmake make -j4 make install

If everything works fine, you will end up with an executable ${deepmd_root}/bin/lmp.

${deepmd_root}/bin/lmp -h


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3