From be311e00066bd8d264acb8c03669a16aacdcd74d Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sun, 3 Mar 2024 02:36:40 -0500 Subject: [PATCH] bump LAMMPS to stable_2Aug2023_update3 (#3399) Signed-off-by: Jinzhe Zeng (cherry picked from commit 7af9e20a3456eedc28524f81334411c7093f1ece) Signed-off-by: Jinzhe Zeng --- backend/dynamic_metadata.py | 2 +- doc/install/install-lammps.md | 22 +++++++++++----------- pyproject.toml | 7 +++---- source/install/build_cc.sh | 7 ++++++- source/install/build_from_c.sh | 2 +- source/install/build_lammps.sh | 2 +- source/install/test_cc.sh | 2 +- source/install/test_cc_local.sh | 8 +++++++- 8 files changed, 31 insertions(+), 21 deletions(-) diff --git a/backend/dynamic_metadata.py b/backend/dynamic_metadata.py index ab955c3cf8..c0b91d9372 100644 --- a/backend/dynamic_metadata.py +++ b/backend/dynamic_metadata.py @@ -57,7 +57,7 @@ def dynamic_metadata( "sphinxcontrib-bibtex", ], "lmp": [ - "lammps~=2023.8.2.2.0", + "lammps~=2023.8.2.3.0", *find_libpython_requires, ], "ipi": [ diff --git a/doc/install/install-lammps.md b/doc/install/install-lammps.md index 5dbf690c67..21e1e72dd1 100644 --- a/doc/install/install-lammps.md +++ b/doc/install/install-lammps.md @@ -14,10 +14,10 @@ make lammps DeePMD-kit will generate a module called `USER-DEEPMD` in the `build` directory, which supports either double or single float precision interface. Now download the LAMMPS code, and uncompress it. ```bash cd /some/workspace -wget https://github.com/lammps/lammps/archive/stable_2Aug2023_update2.tar.gz -tar xf stable_2Aug2023_update2.tar.gz +wget https://github.com/lammps/lammps/archive/stable_2Aug2023_update3.tar.gz +tar xf stable_2Aug2023_update3.tar.gz ``` -The source code of LAMMPS is stored in the directory `lammps-stable_2Aug2023_update2`. +The source code of LAMMPS is stored in the directory `lammps-stable_2Aug2023_update3`. Then, you can [build LAMMPS](https://docs.lammps.org/Build.html) with either make or CMake. @@ -25,7 +25,7 @@ Then, you can [build LAMMPS](https://docs.lammps.org/Build.html) with either mak Now go into the LAMMPS code and copy the DeePMD-kit module like this ```bash -cd lammps-stable_2Aug2023_update2/src/ +cd lammps-stable_2Aug2023_update3/src/ cp -r $deepmd_source_dir/source/build/USER-DEEPMD . make yes-kspace make yes-extra-fix @@ -51,8 +51,8 @@ make no-user-deepmd Now go into the LAMMPS directory and create a directory called `build`: ```bash -mkdir -p lammps-stable_2Aug2023_update2/build/ -cd lammps-stable_2Aug2023_update2/build/ +mkdir -p lammps-stable_2Aug2023_update3/build/ +cd lammps-stable_2Aug2023_update3/build/ ``` Patch the LAMMPS `CMakeLists.txt` file: @@ -81,15 +81,15 @@ Starting from `8Apr2021`, LAMMPS also provides a plugin mode, allowing one to bu Now download the LAMMPS code (`8Apr2021` or later), and uncompress it: ```bash cd /some/workspace -wget https://github.com/lammps/lammps/archive/stable_2Aug2023_update2.tar.gz -tar xf stable_2Aug2023_update2.tar.gz +wget https://github.com/lammps/lammps/archive/stable_2Aug2023_update3.tar.gz +tar xf stable_2Aug2023_update3.tar.gz ``` -The source code of LAMMPS is stored in the directory `lammps-stable_2Aug2023_update2`. The directory of the source code should be specified as the CMAKE argument `LAMMPS_SOURCE_ROOT` during installation of the DeePMD-kit C++ interface. Now go into the LAMMPS directory and create a directory called `build` +The source code of LAMMPS is stored in the directory `lammps-stable_2Aug2023_update3`. The directory of the source code should be specified as the CMAKE argument `LAMMPS_SOURCE_ROOT` during installation of the DeePMD-kit C++ interface. Now go into the LAMMPS directory and create a directory called `build` ```bash -mkdir -p lammps-stable_2Aug2023_update2/build/ -cd lammps-stable_2Aug2023_update2/build/ +mkdir -p lammps-stable_2Aug2023_update3/build/ +cd lammps-stable_2Aug2023_update3/build/ ``` Now build LAMMPS. Note that `PLUGIN` must be enabled, and `BUILD_SHARED_LIBS` must be set to `yes`. You can install any other package you want. ```bash diff --git a/pyproject.toml b/pyproject.toml index d7ac479d2f..fbc49da7ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -139,10 +139,9 @@ manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64:2022-11-19-1b19e81" manylinux-aarch64-image = "manylinux_2_28" [tool.cibuildwheel.macos] -environment = { PIP_PREFER_BINARY="1", DP_LAMMPS_VERSION="stable_2Aug2023_update2", DP_ENABLE_IPI="1" } +environment = { PIP_PREFER_BINARY="1", DP_LAMMPS_VERSION="stable_2Aug2023_update3", DP_ENABLE_IPI="1" } before-all = [ - # enable MPI for macos-arm64 in the next lammps release for compatibility - """if [[ "$CIBW_BUILD" != *macosx_arm64* ]]; then brew install mpich; fi""", + """brew install mpich""", ] repair-wheel-command = """delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} --ignore-missing-dependencies""" @@ -155,7 +154,7 @@ environment-pass = [ "DP_PKG_NAME", "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DEEPMD-KIT-CU11", ] -environment = { PIP_PREFER_BINARY="1", DP_LAMMPS_VERSION="stable_2Aug2023_update2", DP_ENABLE_IPI="1", MPI_HOME="/usr/lib64/mpich", PATH="/usr/lib64/mpich/bin:$PATH" } +environment = { PIP_PREFER_BINARY="1", DP_LAMMPS_VERSION="stable_2Aug2023_update3", DP_ENABLE_IPI="1", MPI_HOME="/usr/lib64/mpich", PATH="/usr/lib64/mpich/bin:$PATH" } before-all = [ """if [ ! -z "${DP_PKG_NAME}" ]; then sed -i "s/name = \\"deepmd-kit\\"/name = \\"${DP_PKG_NAME}\\"/g" pyproject.toml; fi""", """{ if [ "$(uname -m)" = "x86_64" ] ; then yum config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo && yum install -y cuda-nvcc-${CUDA_VERSION/./-} cuda-cudart-devel-${CUDA_VERSION/./-}; fi }""", diff --git a/source/install/build_cc.sh b/source/install/build_cc.sh index fef9e82ebc..55c0369a08 100755 --- a/source/install/build_cc.sh +++ b/source/install/build_cc.sh @@ -20,7 +20,12 @@ NPROC=$(nproc --all) BUILD_TMP_DIR=${SCRIPT_PATH}/../build mkdir -p ${BUILD_TMP_DIR} cd ${BUILD_TMP_DIR} -cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DUSE_TF_PYTHON_LIBS=TRUE ${CUDA_ARGS} -DLAMMPS_VERSION=stable_2Aug2023_update2 .. +cmake -D ENABLE_TENSORFLOW=ON \ + -D CMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ + -D USE_TF_PYTHON_LIBS=TRUE \ + ${CUDA_ARGS} \ + -D LAMMPS_VERSION=stable_2Aug2023_update3 \ + .. cmake --build . -j${NPROC} cmake --install . diff --git a/source/install/build_from_c.sh b/source/install/build_from_c.sh index c1188252ab..e8dcee945d 100755 --- a/source/install/build_from_c.sh +++ b/source/install/build_from_c.sh @@ -13,7 +13,7 @@ NPROC=$(nproc --all) BUILD_TMP_DIR=${SCRIPT_PATH}/../build mkdir -p ${BUILD_TMP_DIR} cd ${BUILD_TMP_DIR} -cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DDEEPMD_C_ROOT=${DEEPMD_C_ROOT} -DLAMMPS_VERSION=stable_2Aug2023_update2 .. +cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DDEEPMD_C_ROOT=${DEEPMD_C_ROOT} -DLAMMPS_VERSION=stable_2Aug2023_update3 .. cmake --build . -j${NPROC} cmake --install . cmake --build . --target=lammps diff --git a/source/install/build_lammps.sh b/source/install/build_lammps.sh index 2b5bf0a643..fca3b3e5ad 100755 --- a/source/install/build_lammps.sh +++ b/source/install/build_lammps.sh @@ -14,7 +14,7 @@ BUILD_TMP_DIR=${SCRIPT_PATH}/../build_lammps mkdir -p ${BUILD_TMP_DIR} cd ${BUILD_TMP_DIR} # download LAMMMPS -LAMMPS_VERSION=stable_2Aug2023_update2 +LAMMPS_VERSION=stable_2Aug2023_update3 if [ ! -d "lammps-${LAMMPS_VERSION}" ]; then curl -L -o lammps.tar.gz https://github.com/lammps/lammps/archive/refs/tags/${LAMMPS_VERSION}.tar.gz tar vxzf lammps.tar.gz diff --git a/source/install/test_cc.sh b/source/install/test_cc.sh index 0dd35f5615..8c75b00762 100755 --- a/source/install/test_cc.sh +++ b/source/install/test_cc.sh @@ -17,7 +17,7 @@ INSTALL_PREFIX=${SCRIPT_PATH}/../../dp_test BUILD_TMP_DIR=${SCRIPT_PATH}/../build_tests mkdir -p ${BUILD_TMP_DIR} cd ${BUILD_TMP_DIR} -cmake -DINSTALL_TENSORFLOW=TRUE -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DTENSORFLOW_ROOT=${INSTALL_PREFIX} -DBUILD_TESTING:BOOL=TRUE -DLAMMPS_VERSION=stable_2Aug2023_update2 ${CUDA_ARGS} .. +cmake -DINSTALL_TENSORFLOW=TRUE -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DTENSORFLOW_ROOT=${INSTALL_PREFIX} -DBUILD_TESTING:BOOL=TRUE -DLAMMPS_VERSION=stable_2Aug2023_update3 ${CUDA_ARGS} .. cmake --build . -j${NPROC} cmake --install . ctest --output-on-failure diff --git a/source/install/test_cc_local.sh b/source/install/test_cc_local.sh index 22d22a27f6..390abef488 100755 --- a/source/install/test_cc_local.sh +++ b/source/install/test_cc_local.sh @@ -18,7 +18,13 @@ INSTALL_PREFIX=${SCRIPT_PATH}/../../dp_test BUILD_TMP_DIR=${SCRIPT_PATH}/../build_tests mkdir -p ${BUILD_TMP_DIR} cd ${BUILD_TMP_DIR} -cmake -DINSTALL_TENSORFLOW=FALSE -DUSE_TF_PYTHON_LIBS=TRUE -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DBUILD_TESTING:BOOL=TRUE -DLAMMPS_VERSION=stable_2Aug2023_update2 ${CUDA_ARGS} .. +cmake \ + -D INSTALL_TENSORFLOW=FALSE \ + -D USE_TF_PYTHON_LIBS=TRUE \ + -D CMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ + -D BUILD_TESTING:BOOL=TRUE \ + -D LAMMPS_VERSION=stable_2Aug2023_update3 \ + ${CUDA_ARGS} .. cmake --build . -j${NPROC} cmake --install . ctest --output-on-failure