-
-
Save pyhope/c205cb21667aa009f02968e7fead00c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Works as tested on Princeton Della Cluster on April 16, 2023. | |
| module load anaconda3/2021.5 | |
| conda create -n dpdev python=3.10 # Customize a name (e.g. dpdev, deepmd, ...) for this conda environment | |
| conda activate dpdev | |
| export CONDA_OVERRIDE_CUDA=11.6 | |
| # install libtensorflow_cc gpu version (Note that only libtensorflow_cc in the deepmodeling channel enables GPU. The libtensorflow_cc library in the conda-forge channel can only be used on GPU.) | |
| conda install -c deepmodeling libtensorflow_cc=*=cuda11* | |
| # install gcc compiler (Note that only pkgs/main works. The conda-forge does not work due to GLIBC version issues. Do not include openmpi-mpicc and openmpi-mpicxx here, or only the cos6 gcc will be installed, and then DeePMD-kitv2.0.3 will not be successfully built. 10/29/2021) | |
| conda install -c pkgs/main gcc_linux-64 gxx_linux-64 gfortran_linux-64 openmpi | |
| # install cudatoolkit-dev (Note that cudatoolkit package does not include an nvcc compiler. To have nvcc installed, cudatoolkit-dev is needed.) | |
| conda install -c conda-forge cudatoolkit-dev cudnn | |
| conda install numpy cmake fftw | |
| conda install -c deepmodeling tensorflow=*=*cuda* | |
| # download source code | |
| wget https://github.com/deepmodeling/deepmd-kit/archive/refs/tags/v2.1.5.tar.gz | |
| tar -zxvf v2.1.5.tar.gz | |
| wget https://github.com/lammps/lammps/archive/refs/tags/stable_23Jun2022_update4.tar.gz | |
| tar -zxvf stable_23Jun2022_update4.tar.gz | |
| wget https://github.com/plumed/plumed2/archive/refs/tags/v2.6.6.tar.gz | |
| tar -zxvf v2.6.6.tar.gz | |
| cd deepmd-kit-2.1.5 | |
| # install dp python interface | |
| pip install . | |
| # install dp C++ interface | |
| cd source | |
| mkdir build | |
| cd build | |
| cmake ../ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DTENSORFLOW_ROOT=$CONDA_PREFIX -DUSE_CUDA_TOOLKIT=true -DCUDA_TOOLKIT_ROOT_DIR=$CONDA_PREFIX -DLAMMPS_VERSION_NUMBER=20220915 | |
| make -j32 install | |
| make lammps | |
| cp -r USER-DEEPMD ../../../lammps-stable_23Jun2022_update4/src/DEEPMD | |
| cd ../../../ | |
| # install plumed | |
| cd plumed2-2.6.6 | |
| ./configure --prefix=$CONDA_PREFIX CXX=mpic++ CXXFLAGS="-O3 -Wl,-rpath=$CONDA_PREFIX/lib -Wl,-rpath-link=$CONDA_PREFIX/lib" | |
| make -j 32 | |
| make install | |
| cd ../ | |
| # install lammps | |
| cd lammps-stable_23Jun2022_update4 | |
| sed -i '/set(STANDARD_PACKAGES/a\ DEEPMD' cmake/CMakeLists.txt | |
| mkdir build | |
| cd build | |
| cmake ../cmake -DPKG_KSPACE=on -DPKG_REPLICA=on -DPKG_DEEPMD=on -DPKG_MANYBODY=on -DPKG_EXTRA-FIX=on -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_CXX_FLAGS="-std=c++14 -DHIGH_PREC -I${CONDA_PREFIX}/include -L${CONDA_PREFIX}/lib -Wl,--no-as-needed -lrt -ldeepmd_op -ldeepmd_op_cuda -ldeepmd -ldeepmd_cc -ltensorflow_cc -ltensorflow_framework -Wl,-rpath=${CONDA_PREFIX}/lib -Wl,-rpath-link=${CONDA_PREFIX}/lib -DLAMMPS_VERSION_NUMBER=20220915" -DPKG_PLUMED=on -DPLUMED_MODE=runtime | |
| make -j32 install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment