【Linux】编译安装Lammps-23Jun2022

老规矩 操作系统为Rocky Linux 9.2,首先安装依赖:

sudo dnf install git clang clang-tools-extra
sudo dnf install epel-release
sudo dnf config-manager --enable crb # epel,epel-next,
sudo dnf install -y https://download1.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm
sudo dnf install -y https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-9.noarch.rpm
sudo dnf install ffmpeg

解压包,开始cmake编译:

cd lammps/build
cmake ../cmake -D BUILD_MPI=yes -D BUILD_OMP=yes
cmake --build .
make install

make编译模块:

cd lammps/src
make yes-manybody
make yes-kspace
make yes-molecule
make mpi -j 10

将生成的lmp_mpi 复制到需要的目录下:

export PATH=/home/chn/bin:$PATH

害~又是编译的一天,这次终于可以多线程编译了~