提交 8419057b 编写于 作者: M MRXLT

add rpath by cmake

上级 4bcac735
if(CLIENT)
add_subdirectory(pybind11)
pybind11_add_module(serving_client src/general_model.cpp src/pybind_general_model.cpp)
target_link_libraries(serving_client PRIVATE -Wl,--whole-archive utils sdk-cpp pybind python -Wl,--no-whole-archive -lpthread -lcrypto -lm -lrt -lssl -ldl -lz)
target_link_libraries(serving_client PRIVATE -Wl,--whole-archive utils sdk-cpp pybind python -Wl,--no-whole-archive -lpthread -lcrypto -lm -lrt -lssl -ldl -lz -Wl,-rpath,'$ORIGIN'/lib)
endif()
......@@ -112,7 +112,6 @@ class Client(object):
self.feed_shapes_ = {}
self.feed_types_ = {}
self.feed_names_to_idx_ = {}
self.rpath()
self.pid = os.getpid()
self.predictor_sdk_ = None
self.producers = []
......@@ -121,16 +120,6 @@ class Client(object):
self.all_numpy_input = True
self.has_numpy_input = False
def rpath(self):
lib_path = os.path.dirname(paddle_serving_client.__file__)
client_path = os.path.join(lib_path, 'serving_client.so')
lib_path = os.path.join(lib_path, 'lib')
ld_path = os.getenv('LD_LIBRARY_PATH')
if ld_path == None:
os.environ['LD_LIBRARY_PATH'] = lib_path
elif ld_path not in lib_path:
os.environ['LD_LIBRARY_PATH'] = ld_path + ':' + lib_path
def load_client_config(self, path):
from .serving_client import PredictorClient
from .serving_client import PredictorRes
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册