Skip to content

Commit

Permalink
bump LAMMPS to stable_2Aug2023_update3 (#3399)
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
(cherry picked from commit 7af9e20)
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Apr 6, 2024
1 parent 0ce3be0 commit be311e0
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion backend/dynamic_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
22 changes: 11 additions & 11 deletions doc/install/install-lammps.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ 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.

### With make

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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand All @@ -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 }""",
Expand Down
7 changes: 6 additions & 1 deletion source/install/build_cc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 .

Expand Down
2 changes: 1 addition & 1 deletion source/install/build_from_c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/install/build_lammps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/install/test_cc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 7 additions & 1 deletion source/install/test_cc_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit be311e0

Please sign in to comment.