From d6e542e53b21a765cdeb4b151ade72b11c53ebd3 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 3 Feb 2023 15:08:25 -0500 Subject: [PATCH] fix the installation path of `dp_ipi` Fix a bug in #2186: `dp_ipi` had the wrong paths in the installation directory. Add a simple test to check these libraries and the executable are in the correct directory. --- .github/workflows/build_cc.yml | 9 +++++++++ source/ipi/CMakeLists.txt | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index e1dcf089a1..0ebb80fa98 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -60,6 +60,15 @@ jobs: CC: clang CXX: clang++ if: matrix.variant == 'clang' + - name: Test files exist + run: | + test -f dp/bin/dp_ipi && + test -f dp/lib/libdeepmd_cc.so && + test -f dp/lib/libdeepmd_c.so && + test -f dp/lib/libdeepmd_op.so && + test -f dp/lib/libdeepmd_ipi.so && + test -f dp/lib/libdeepmd_lmp.so && + test -f dp/lib/libdeepmd.so pass: name: Pass building C++ needs: [buildcc] diff --git a/source/ipi/CMakeLists.txt b/source/ipi/CMakeLists.txt index af291c5451..69ba1f400c 100644 --- a/source/ipi/CMakeLists.txt +++ b/source/ipi/CMakeLists.txt @@ -31,11 +31,11 @@ function(_add_ipi_variant variant_name prec_def) endif() if(BUILD_PY_IF) - install(TARGETS ${libipiname} DESTINATION lib/) - install(TARGETS ${ipiname} DESTINATION bin/) - else(BUILD_PY_IF) install(TARGETS ${libipiname} DESTINATION deepmd/op/) install(TARGETS ${ipiname} DESTINATION deepmd/op/) + else(BUILD_PY_IF) + install(TARGETS ${libipiname} DESTINATION lib/) + install(TARGETS ${ipiname} DESTINATION bin/) endif(BUILD_PY_IF) endfunction() _add_ipi_variant("${HIGH_PREC_VARIANT}" "${HIGH_PREC_DEF}")