-
-
Notifications
You must be signed in to change notification settings - Fork 589
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2058 from pybamm-team/i2047-linux-wheel
I2047 linux wheel
- Loading branch information
Showing
4 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
Removes the rpath from libcasadi.dylib in the casadi python install | ||
and uses a fixed path | ||
Used when building the wheels for macos | ||
""" | ||
import casadi | ||
import os | ||
import subprocess | ||
|
||
casadi_dir = casadi.__path__[0] | ||
print('Removing rpath references in python casadi install at', casadi_dir) | ||
|
||
libcpp_name = "libc++.1.dylib" | ||
libcppabi_name = "libc++abi.dylib" | ||
libcasadi_name = "libcasadi.dylib" | ||
install_name_tool_args = [ | ||
"-change", | ||
os.path.join("@rpath", libcpp_name), | ||
os.path.join(casadi_dir, libcpp_name), | ||
os.path.join(casadi_dir, libcasadi_name), | ||
] | ||
subprocess.run(["otool"] + ["-L", os.path.join(casadi_dir, libcasadi_name)]) | ||
print(' '.join(["install_name_tool"] + install_name_tool_args)) | ||
subprocess.run(["install_name_tool"] + install_name_tool_args) | ||
subprocess.run(["otool"] + ["-L", os.path.join(casadi_dir, libcasadi_name)]) | ||
install_name_tool_args = [ | ||
"-change", | ||
os.path.join("@rpath", libcppabi_name), | ||
os.path.join(casadi_dir, libcppabi_name), | ||
os.path.join(casadi_dir, libcpp_name), | ||
] | ||
subprocess.run(["otool"] + ["-L", os.path.join(casadi_dir, libcpp_name)]) | ||
print(' '.join(["install_name_tool"] + install_name_tool_args)) | ||
subprocess.run(["install_name_tool"] + install_name_tool_args) | ||
subprocess.run(["otool"] + ["-L", os.path.join(casadi_dir, libcpp_name)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters