mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
Polish cmake files and runtime apis (#36)
* Add custom operator for onnxruntime ans fix paddle backend * Polish cmake files and runtime apis * Remove copy libraries * fix some issue * fix bug * fix bug
This commit is contained in:
29
setup.py
29
setup.py
@@ -126,7 +126,7 @@ class ONNXCommand(setuptools.Command):
|
||||
pass
|
||||
|
||||
|
||||
def GetAllFiles(dirname):
|
||||
def get_all_files(dirname):
|
||||
files = list()
|
||||
for root, dirs, filenames in os.walk(dirname):
|
||||
for f in filenames:
|
||||
@@ -353,23 +353,22 @@ if sys.argv[1] == "install" or sys.argv[1] == "bdist_wheel":
|
||||
|
||||
if os.path.exists("fastdeploy/libs/third_libs"):
|
||||
shutil.rmtree("fastdeploy/libs/third_libs")
|
||||
shutil.copytree(
|
||||
".setuptools-cmake-build/third_libs/install",
|
||||
"fastdeploy/libs/third_libs",
|
||||
symlinks=True)
|
||||
|
||||
all_files = GetAllFiles("fastdeploy/libs")
|
||||
for f in all_files:
|
||||
package_data[PACKAGE_NAME].append(os.path.relpath(f, "fastdeploy"))
|
||||
# shutil.copytree(
|
||||
# ".setuptools-cmake-build/third_libs/install",
|
||||
# "fastdeploy/libs/third_libs",
|
||||
# symlinks=True)
|
||||
|
||||
if platform.system().lower() == "linux":
|
||||
rpaths = ["${ORIGIN}"]
|
||||
for root, dirs, files in os.walk("fastdeploy/libs/third_libs"):
|
||||
for root, dirs, files in os.walk(
|
||||
".setuptools-cmake-build/third_libs/install"):
|
||||
for d in dirs:
|
||||
if d == "lib":
|
||||
path = os.path.relpath(
|
||||
os.path.join(root, d), "fastdeploy/libs")
|
||||
rpaths.append("${ORIGIN}/" + format(path))
|
||||
os.path.join(root, d),
|
||||
".setuptools-cmake-build/third_libs/install")
|
||||
rpaths.append("${ORIGIN}/" + os.path.join(
|
||||
"libs/third_libs", path))
|
||||
rpaths = ":".join(rpaths)
|
||||
command = "patchelf --set-rpath '{}' ".format(rpaths) + os.path.join(
|
||||
"fastdeploy/libs", pybind_so_file)
|
||||
@@ -379,6 +378,12 @@ if sys.argv[1] == "install" or sys.argv[1] == "bdist_wheel":
|
||||
command) == 0, "patchelf {} failed, the command: {}".format(
|
||||
command, pybind_so_file)
|
||||
|
||||
all_files = get_all_files("fastdeploy/libs")
|
||||
for f in all_files:
|
||||
if f.count("third_libs") > 0:
|
||||
continue
|
||||
package_data[PACKAGE_NAME].append(os.path.relpath(f, "fastdeploy"))
|
||||
|
||||
setuptools.setup(
|
||||
name=PACKAGE_NAME,
|
||||
version=VersionInfo.version,
|
||||
|
||||
Reference in New Issue
Block a user