diff --git a/setup.py b/setup.py index c9fde59..e584ae4 100644 --- a/setup.py +++ b/setup.py @@ -104,7 +104,9 @@ def patch_rpath(executable_path: str): # show the altered rpath p = subprocess.run( ["otool", "-l", executable_path], - check=True, capture_output=True, text=True, + check=True, + capture_output=True, + text=True, ) print(f"Output of otool:\n{p.stdout}") elif platform.system() == "Linux": @@ -120,7 +122,9 @@ def patch_rpath(executable_path: str): # show the altered rpath p = subprocess.run( ["patchelf", "--print-rpath", executable_path], - check=True, capture_output=True, text=True, + check=True, + capture_output=True, + text=True, ) print(f"Output of patchelf:\n{p.stdout}") @@ -136,6 +140,11 @@ def patch_rpath(executable_path: str): dirs_exist_ok=True, ) + # In manylinux container, the lib directory will be set as lib64, we need to change it to lib + lib64dir = os.path.join(temp_dir, dist_name, "lib64") + if os.path.exists(lib64dir): + shutil.move(lib64dir, os.path.join(temp_dir, dist_name, "lib")) + # patch rpath if os.name != "nt": executable_path = os.path.join(temp_dir, dist_name, "bin", "highs")