Skip to content

Commit 00327cc

Browse files
author
Han Wang
committed
fix(ci): use SHARED_LIB_DIR to find correct custom op install path
The script was copying libdeepmd_op_pt.so to os.path.dirname(deepmd.__file__)+"/lib" which resolves to the workspace source tree, but cxx_op.py loads from SHARED_LIB_DIR (deepmd.lib.__path__) which resolves to site-packages. For editable installs these diverge, so the custom ops were never loaded and ENABLE_CUSTOMIZED_OP was False. This caused 10 C++ test failures: - 8 DPA2 .pth tests: tabulate_fusion_se_t_tebd has no Python fallback - 2 DPA3 .pth NoPbc tests: border_op fallback raises NotImplementedError
1 parent dd75039 commit 00327cc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

source/install/test_cc_local.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cmake --install .
3939
# This prevents double-registration crashes when gen scripts also search build dirs.
4040
_OP_SO=$(find ${BUILD_TMP_DIR} -name 'libdeepmd_op_pt.so' 2>/dev/null | head -1)
4141
if [ -n "${_OP_SO}" ]; then
42-
_DEEPMD_LIB=$(python -c 'import deepmd,os;print(os.path.join(os.path.dirname(deepmd.__file__),"lib"))' 2>/dev/null)
42+
_DEEPMD_LIB=$(python -c 'from deepmd.env import SHARED_LIB_DIR; print(SHARED_LIB_DIR)' 2>/dev/null)
4343
if [ -n "${_DEEPMD_LIB}" ]; then
4444
mkdir -p "${_DEEPMD_LIB}"
4545
cp "${_OP_SO}" "${_DEEPMD_LIB}/"

0 commit comments

Comments
 (0)