diff --git a/setup.py b/setup.py index 2e147160e1..858f84aa5a 100644 --- a/setup.py +++ b/setup.py @@ -6,15 +6,6 @@ from os import path, makedirs import os, imp, sys, platform, sysconfig -def get_dp_install_path() : - site_packages_path = sysconfig.get_paths()['purelib'] - dp_scm_version = get_version(root=".", relative_to=__file__) - python_version = 'py' + str(sys.version_info.major + sys.version_info.minor * 0.1) - os_info = sys.platform - machine_info = platform.machine() - dp_pip_install_path = os.path.join(site_packages_path, 'deepmd') - dp_setup_install_path = os.path.join(site_packages_path, 'deepmd_kit-' + dp_scm_version + '-' + python_version + '-' + os_info + '-' + machine_info + '.egg', 'deepmd') - return dp_pip_install_path, dp_setup_install_path readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.md') try: @@ -45,7 +36,6 @@ def get_dp_install_path() : except OSError: pass -dp_pip_install_path, dp_setup_install_path = get_dp_install_path() setup( name="deepmd-kit", @@ -69,8 +59,6 @@ def get_dp_install_path() : '-DBUILD_PY_IF:BOOL=TRUE', '-DBUILD_CPP_IF:BOOL=FALSE', '-DFLOAT_PREC:STRING=high', - '-DDP_PIP_INSTALL_PATH=%s' % dp_pip_install_path, - '-DDP_SETUP_INSTALL_PATH=%s' % dp_setup_install_path, ], cmake_source_dir='source', cmake_minimum_required_version='3.0', diff --git a/source/op/CMakeLists.txt b/source/op/CMakeLists.txt index c4d97cd85a..1ddaaf3255 100644 --- a/source/op/CMakeLists.txt +++ b/source/op/CMakeLists.txt @@ -24,7 +24,7 @@ endif (BUILD_CPP_IF) if (BUILD_PY_IF) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - set(CMAKE_INSTALL_RPATH DESTINATION ${DP_PIP_INSTALL_PATH} ${DP_SETUP_INSTALL_PATH} ${CMAKE_BINARY_DIR}/op/cuda) + set(CMAKE_INSTALL_RPATH $ORIGIN) if (USE_CUDA_TOOLKIT) add_library(op_abi SHARED ${OP_SRC} ${OP_LIB}) add_library(op_grads SHARED ${OP_GRADS_SRC})