From ce75fcb863856d8340a1e5fe160ee00e2909c4c9 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 27 Oct 2023 05:54:01 -0400 Subject: [PATCH] fix ase tarball url and testing C library (#2950) fix the CI error --------- Signed-off-by: Jinzhe Zeng Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/workflows/test_cc.yml | 2 +- .github/workflows/test_cuda.yml | 2 +- examples/infer_water/convert_model.c | 7 +++++++ source/install/docker_test_package_c.sh | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 examples/infer_water/convert_model.c diff --git a/.github/workflows/test_cc.yml b/.github/workflows/test_cc.yml index fa37009730..a98afa7a94 100644 --- a/.github/workflows/test_cc.yml +++ b/.github/workflows/test_cc.yml @@ -30,7 +30,7 @@ jobs: # TODO: remove ase version when ase has new release - run: | python -m pip install -U pip - python -m pip install -e .[cpu,test,lmp] "ase @ https://github.com/rosswhitfield/ase/archive/edd03571aff6944b77b4a4b055239f3c3e4eeb66.zip" + python -m pip install -e .[cpu,test,lmp] "ase @ https://gitlab.com/ase/ase/-/archive/8c5aa5fd6448c5cfb517a014dccf2b214a9dfa8f/ase-8c5aa5fd6448c5cfb517a014dccf2b214a9dfa8f.tar.gz" env: DP_BUILD_TESTING: 1 - run: pytest --cov=deepmd source/lmp/tests diff --git a/.github/workflows/test_cuda.yml b/.github/workflows/test_cuda.yml index 7b95e6d37b..ca72a32277 100644 --- a/.github/workflows/test_cuda.yml +++ b/.github/workflows/test_cuda.yml @@ -36,7 +36,7 @@ jobs: - name: Set PyPI mirror for Aliyun cloud machine run: python -m pip config --user set global.index-url https://mirrors.aliyun.com/pypi/simple/ - run: python -m pip install -U "pip>=21.3.1,!=23.0.0" - - run: python -m pip install -v -e .[gpu,test,lmp,cu11] "ase @ https://github.com/rosswhitfield/ase/archive/edd03571aff6944b77b4a4b055239f3c3e4eeb66.zip" + - run: python -m pip install -v -e .[gpu,test,lmp,cu11] "ase @ https://gitlab.com/ase/ase/-/archive/8c5aa5fd6448c5cfb517a014dccf2b214a9dfa8f/ase-8c5aa5fd6448c5cfb517a014dccf2b214a9dfa8f.tar.gz" env: DP_BUILD_TESTING: 1 DP_VARIANT: cuda diff --git a/examples/infer_water/convert_model.c b/examples/infer_water/convert_model.c new file mode 100644 index 0000000000..3fc2d74b65 --- /dev/null +++ b/examples/infer_water/convert_model.c @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +#include "deepmd/c_api.h" + +int main() { + DP_ConvertPbtxtToPb("../../source/tests/infer/deeppot.pbtxt", "graph.pb"); + return 0; +} diff --git a/source/install/docker_test_package_c.sh b/source/install/docker_test_package_c.sh index ada1799953..ed3b265821 100755 --- a/source/install/docker_test_package_c.sh +++ b/source/install/docker_test_package_c.sh @@ -5,11 +5,11 @@ SCRIPT_PATH=$(dirname $(realpath -s $0)) # assume libdeepmd_c.tar.gz has been created -wget "https://drive.google.com/uc?export=download&id=1xldLhzm4uSkq6iPohSycNWAsWqKAenKX" -O ${SCRIPT_PATH}/../../examples/infer_water/"graph.pb" - docker run --rm -v ${SCRIPT_PATH}/../..:/root/deepmd-kit -w /root/deepmd-kit \ gcc:4.9 \ /bin/sh -c "tar vxzf libdeepmd_c.tar.gz \ && cd examples/infer_water \ + && gcc convert_model.c -std=c99 -L ../../libdeepmd_c/lib -I ../../libdeepmd_c/include -Wl,--no-as-needed -ldeepmd_c -Wl,-rpath=../../libdeepmd_c/lib -o convert_model \ && gcc infer_water.c -std=c99 -L ../../libdeepmd_c/lib -I ../../libdeepmd_c/include -Wl,--no-as-needed -ldeepmd_c -Wl,-rpath=../../libdeepmd_c/lib -o infer_water \ + && ./convert_model \ && ./infer_water"