diff --git a/CMakeLists.txt b/CMakeLists.txt index aafe424c6..ead05bae8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -440,6 +440,12 @@ install( DIRECTORY ${PROJECT_SOURCE_DIR}/examples DESTINATION ${CMAKE_INSTALL_PREFIX} ) +if(NOT WIN32) + install( + FILES ${PROJECT_SOURCE_DIR}/scripts/fastdeploy_init.sh + DESTINATION ${CMAKE_INSTALL_PREFIX} + ) +endif() if(BUILD_FASTDEPLOY_PYTHON) add_definitions(-DBUILD_FASTDEPLOY_PYTHON) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 5ab09045e..144d5350f 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -17,7 +17,7 @@ endfunction() function(download_and_decompress url filename decompress_dir) if(NOT EXISTS ${filename}) message("Downloading file from ${url} to ${filename} ...") - file(DOWNLOAD ${url} "${filename}.tmp") + file(DOWNLOAD ${url} "${filename}.tmp" SHOW_PROGRESS) file(RENAME "${filename}.tmp" ${filename}) endif() if(NOT EXISTS ${decompress_dir}) diff --git a/python/scripts/process_libraries.py.in b/python/scripts/process_libraries.py.in index c574ea367..66581e4f0 100644 --- a/python/scripts/process_libraries.py.in +++ b/python/scripts/process_libraries.py.in @@ -31,6 +31,11 @@ def process_on_linux(current_dir): if f.count("fastdeploy") and f.count(".so") > 0: fd_libs.append(filename) + cmake_build_dir = os.path.join(current_dir, ".setuptools-cmake-build") + patchelf_bin_path = os.path.join(cmake_build_dir, "third_libs/patchelf/bin/patchelf") + if not os.path.exists(patchelf_bin_path): + patchelf_bin_path = "patchelf" + third_libs_path = os.path.join(libs_path, "third_libs") # remove some useless opencv file in python wheels to decrease package size @@ -58,7 +63,7 @@ def process_on_linux(current_dir): rpath = "$ORIGIN/" + rel_path rpaths.append(rpath) for lib in fd_libs: - command = "patchelf --set-rpath '{}' {}".format(":".join(rpaths), lib) + command = "{} --set-rpath '{}' {}".format(patchelf_bin_path, ":".join(rpaths), lib) if platform.machine() != 'sw_64' and platform.machine() != 'mips64': assert subprocess.Popen( command,