From e138a94f0a786b2e76ebe0387f3bc9bbb5f6fb44 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 19 May 2023 19:54:43 -0400 Subject: [PATCH 1/3] use pypi lammps to test lammps plugin Save the time to build lammps Signed-off-by: Jinzhe Zeng --- .github/workflows/test_cc.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_cc.yml b/.github/workflows/test_cc.yml index 0c9b2ed487..a7ca5b0992 100644 --- a/.github/workflows/test_cc.yml +++ b/.github/workflows/test_cc.yml @@ -11,6 +11,10 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.11' + - name: Setup MPI + uses: mpi4py/setup-mpi@v1 + with: + mpi: mpich - run: python -m pip install tensorflow - run: source/install/test_cc_local.sh env: @@ -19,10 +23,9 @@ jobs: TF_INTER_OP_PARALLELISM_THREADS: 1 tensorflow_root: /usr/local # test lammps - - run: source/install/build_lammps.sh - run: | python -m pip install -U pip - python -m pip install -e .[cpu,test] + python -m pip install -e .[cpu,test,lmp] env: DP_BUILD_TESTING: 1 - run: pytest --cov=deepmd source/lmp/tests From 89fc3969bace1b93b19722b26434d6d741e78833 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 19 May 2023 21:30:29 -0400 Subject: [PATCH 2/3] set _GLIBCXX_USE_CXX11_ABI to 0 --- .github/workflows/test_cc.yml | 2 +- source/lmp/plugin/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_cc.yml b/.github/workflows/test_cc.yml index a7ca5b0992..37061658ab 100644 --- a/.github/workflows/test_cc.yml +++ b/.github/workflows/test_cc.yml @@ -21,7 +21,7 @@ jobs: OMP_NUM_THREADS: 1 TF_INTRA_OP_PARALLELISM_THREADS: 1 TF_INTER_OP_PARALLELISM_THREADS: 1 - tensorflow_root: /usr/local + LMP_CXX11_ABI_0: 1 # test lammps - run: | python -m pip install -U pip diff --git a/source/lmp/plugin/CMakeLists.txt b/source/lmp/plugin/CMakeLists.txt index b76635e5f7..500ad239ac 100644 --- a/source/lmp/plugin/CMakeLists.txt +++ b/source/lmp/plugin/CMakeLists.txt @@ -64,7 +64,7 @@ if(DEFINED LAMMPS_SOURCE_ROOT OR DEFINED LAMMPS_VERSION) target_link_libraries(${libname} PUBLIC ${LIB_DEEPMD_C}) target_precompile_headers(${libname} PUBLIC [["deepmd.hpp"]]) remove_definitions(-D_GLIBCXX_USE_CXX11_ABI=${OP_CXX_ABI}) - if("$ENV{CIBUILDWHEEL}" STREQUAL "1") + if("$ENV{CIBUILDWHEEL}" STREQUAL "1" OR "$ENV{LMP_CXX11_ABI_0}" STREQUAL "1") add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) endif() else() From 1ac79d43fd56f1ec92f3592393e2a28412e181c0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 21 May 2023 02:18:13 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- source/lmp/plugin/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/lmp/plugin/CMakeLists.txt b/source/lmp/plugin/CMakeLists.txt index 500ad239ac..ce879764ee 100644 --- a/source/lmp/plugin/CMakeLists.txt +++ b/source/lmp/plugin/CMakeLists.txt @@ -64,7 +64,8 @@ if(DEFINED LAMMPS_SOURCE_ROOT OR DEFINED LAMMPS_VERSION) target_link_libraries(${libname} PUBLIC ${LIB_DEEPMD_C}) target_precompile_headers(${libname} PUBLIC [["deepmd.hpp"]]) remove_definitions(-D_GLIBCXX_USE_CXX11_ABI=${OP_CXX_ABI}) - if("$ENV{CIBUILDWHEEL}" STREQUAL "1" OR "$ENV{LMP_CXX11_ABI_0}" STREQUAL "1") + if("$ENV{CIBUILDWHEEL}" STREQUAL "1" OR "$ENV{LMP_CXX11_ABI_0}" STREQUAL + "1") add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) endif() else()