# LAMMPS build recipe ## ENV prepare apps/tmux/tmux module load intel/2023_2 module load miniconda3 cd ~/src/lammps wget https://github.com/lammps/lammps/archive/refs/tags/stable_2Aug2023_update2.tar.gz tar -zxv -f stable_2Aug2023_update2.tar.gz git clone https://github.com/lammps/lammps.git cd lammps git tag -l git checkout <tag_name> ## Building QUIP git clone --recursive https://github.com/libAtoms/QUIP.git git pull export QUIP_ROOT=/home/p00acy00/src/lammps/QUIP export QUIP_ARCH=linux_x86_64_ifort_icc_openmp cd ${QUIP_ROOT} make config make libquip 給LAMMPS用的QUIP不能編mpi版本,也不要編openmp版本的,因為lib/quip/Makefile.lammps裡偵測F95的程式沒寫好,會一直找不到fortran compiler。 QUIP_ARCH選linux_x86_64_ifort_icc_openmp的話,要新增F95=ifort,還要把每個FLAGS裡的-openmp改成-qopenmp。 ## Building n2p2 git clone --recursive https://github.com/CompPhysVienna/n2p2.git git pull cd n2p2/src make libnnpif MODE=static COMP=intel ln -s /home/lammps/src/auxlib/n2p2/include includelink ln -s /home/lammps/src/auxlib/n2p2/lib liblink ## Building LAMMPS cd lammps-stable_2Aug2023_update3/src/MAKE cp OPTIONS/Makefile.intel_cpu_intelmpi . ``` ``` cd .. make yes-most make yes-intel make yes-openmp make yes-ml-quip make pu make clean-all make intel_cpu_intelmpi ## Test LAMMPS with QUIP cd lammps-stable_2Aug2023_update2/examples/PACKAGES/quip/ lmp_intel_cpu_intelmpi -in in.sw lmp_intel_cpu_intelmpi -in in.molecular lmp_intel_cpu_intelmpi -in in.GAP module load intel/2024_01_46 cd src/lammps/gsl-2.7.1 ./configure --prefix=$HOME/apps/gsl-2.7.1 CC=icx CXX=icpx ## > Atom IDs are not required for atomic systems which do not store bond topology information, though IDs are enabled by default. The atom_modify id no command will turn them off. Atom IDs are required for molecular systems with bond topology (bonds, angles, dihedrals, etc). Similarly, some force or compute or fix styles require atom IDs. Thus, if you model a molecular system or use one of those styles with more than 2 billion atoms, you need the “bigbig” setting. n2p2適用stable_29Oct2020.tar.gz 更新的版本使用要改 1. src/neigh_request.h 這檔案把一些變數改宣告成protected,所以要把nnp會用到的class宣告成friend class, 在第30行新增 friend class PairNNP; 2. src/Makefile.package lammps新版不再使用USER-XXX方式擴充, 所以無法使用make yes-user-xxx方式, 要手動copy檔案, 並修改Makefile.package, 要確定有nnp的include(PKG_INC)和lib(PKG_PATH)路徑, 還要加上PKG_LIB = -lnnpif -lnnp 或是依據../../lib/nnp/lib/Makefile.lammps-extra所定義的名稱 修改 PKG_SYSINC = $(hdnnp_SYSINC) PKG_SYSLIB = $(hdnnp_SYSLIB) PKG_SYSPATH = $(hdnnp_SYSPATH) PKG_SYSINC = $(plugin_SYSINC) PKG_SYSLIB = $(plugin_SYSLIB) PKG_SYSPATH = $(plugin_SYSPATH) 3.編譯n2p2 lammps的interface In n2p2 folder cd src make libnnpif 4.到lammps資料夾建立nnp lib的連結 cd lib ln -s <path-to-n2p2> nnp cp phononlifetime-r108/src/compute_sed.* cp phononlifetime-r108/src/memory.* cp n2p2/src/interface/LAMMPS/src/USER-NNP/pair_nnp.*