Skip to content

Commit

Permalink
Merge pull request deepmodeling#263 from njzjz/install_path
Browse files Browse the repository at this point in the history
set RPATH to $ORIGIN
  • Loading branch information
amcadmus authored Oct 2, 2020
2 parents 9d1e10d + 0c510bb commit a2f3390
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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",
Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion source/op/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit a2f3390

Please sign in to comment.