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

Set MACOSX_DEPLOYMENT_TARGET to 11.0 for CasADi v3.6.5 on arm64 macOS – libcasadi.3.7.dylib requires 11.1 and breaks linkage #3698

Open
agriyakhetarpal opened this issue May 16, 2024 · 1 comment

Comments

@agriyakhetarpal
Copy link

Description

Hi there! Thanks for CasADi. We use CasADi as a dependency for our macOS wheels and we've been seeing failures related to libcasadi.3.7.dylib requiring a macOS version of 11.1, which is not supported by Python packaging standards, i.e., wheels that link to CasADi cannot be installed by pip:

Tap to expand
pip3.9 debug --verbose | grep -E -o 'macosx_\d+_\d+' | sort | uniq 
WARNING: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.
macosx_10_10
macosx_10_11
macosx_10_12
macosx_10_13
macosx_10_14
macosx_10_15
macosx_10_16
macosx_10_4
macosx_10_5
macosx_10_6
macosx_10_7
macosx_10_8
macosx_10_9
macosx_11_0
macosx_12_0
macosx_13_0
macosx_14_0

Here are some workflow logs which can help: https://github.com/agriyakhetarpal/PyBaMM/actions/runs/9116260227/job/25064471991#step:5:3260

I notice that CasADi is not using delocate to repair the macOS wheels and it isn't setting a minimum MACOSX_DEPLOYMENT_TARGET either in the source code (C++14 or C++17 can usually use 10.13 and above but even lower versions can work: https://github.com/pypa/cibuildwheel/blob/main/docs/cpp_standards.md)

This makes it slightly difficult for Python libraries linking against CasADi dylibs to publish compiled wheels, since delocate is now hardened and raises errors by checking against all dependencies for a particular shared object for a CPython extension module.

Possible solution

Set the MACOSX_DEPLOYMENT_TARGET environment variable to 11.0 for arm64 macOS wheels and at least 10.13 for the amd64 macOS wheels, in the GitHub Actions steps from where wheels are built in CI and published.

Additional context

xref: pybamm-team/PyBaMM#4092

@agriyakhetarpal agriyakhetarpal changed the title Set MACOSX_DEPLOYMENT_TARGET to 11_0 for CasADi v3.6.5 – libcasadi.3.7.dylib requires 11.1 Set MACOSX_DEPLOYMENT_TARGET to 11.0 for CasADi v3.6.5 – libcasadi.3.7.dylib requires 11.1 – breaks linkage May 16, 2024
@agriyakhetarpal agriyakhetarpal changed the title Set MACOSX_DEPLOYMENT_TARGET to 11.0 for CasADi v3.6.5 – libcasadi.3.7.dylib requires 11.1 – breaks linkage Set MACOSX_DEPLOYMENT_TARGET to 11.0 for CasADi v3.6.5 on arm64 macOS – libcasadi.3.7.dylib requires 11.1 and breaks linkage May 16, 2024
@agriyakhetarpal
Copy link
Author

Note: I'm not sure whether this is as easy as setting an environment variable (it should be, though, unless CasADi is doing something complicated), but I'm happy to put up a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant