Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix python compilation on windows #61

Merged
merged 6 commits into from
Jul 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fastdeploy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def add_dll_search_dir(dir_path):
add_dll_search_dir(third_libs_dir)
for root, dirs, filenames in os.walk(third_libs_dir):
for d in dirs:
if d == "lib":
if d == "lib" or d == "bin":
add_dll_search_dir(os.path.join(dirname, root, d))

from .fastdeploy_main import Frontend, Backend, FDDataType, TensorInfo, Device
Expand Down
14 changes: 13 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,19 @@ def run(self):
"fastdeploy/libs/third_libs",
symlinks=True)

third_party_path = os.path.join(".setuptools-cmake-build", "third_party")
if os.path.exists(third_party_path):
for f in os.listdir(third_party_path):
lib_dir_name = os.path.join(third_party_path, f)
if os.path.isfile(lib_dir_name):
continue
for f1 in os.listdir(lib_dir_name):
release_dir = os.path.join(lib_dir_name, f1)
if f1 == "Release" and not os.path.isfile(release_dir):
if os.path.exists(os.path.join("fastdeploy/libs/third_libs", f)):
shutil.rmtree(os.path.join("fastdeploy/libs/third_libs", f))
shutil.copytree(release_dir, os.path.join("fastdeploy/libs/third_libs", f, "lib"))

if platform.system().lower() == "windows":
release_dir = os.path.join(".setuptools-cmake-build", "Release")
for f in os.listdir(release_dir):
Expand Down Expand Up @@ -428,7 +441,6 @@ def run(self):
all_files = get_all_files("fastdeploy/libs")
for f in all_files:
package_data[PACKAGE_NAME].append(os.path.relpath(f, "fastdeploy"))

setuptools.setup(
name=PACKAGE_NAME,
version=VersionInfo.version,
Expand Down