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

libmadx error installing on M1/M2 Apple Silicon #113

Closed
ab-gh opened this issue Oct 4, 2022 · 7 comments
Closed

libmadx error installing on M1/M2 Apple Silicon #113

ab-gh opened this issue Oct 4, 2022 · 7 comments

Comments

@ab-gh
Copy link
Contributor

ab-gh commented Oct 4, 2022

When attempting to install cpymad on a MacOS System with arm64 (M1), the following error is generated:

src/cern/cpymad/libmadx.c:776:10: fatal error: 'madX/mad_def.h' file not found
#include "madX/mad_def.h"
         ^~~~~~~~~~~~~~~~

MAD-X its self has installed correctly, so I'm not sure what this error relates to. Are there any plans to release macos-arm64 binaries?

@ab-gh
Copy link
Contributor Author

ab-gh commented Oct 4, 2022

Potentially solved with #114

@fsoubelet
Copy link

While I am not good enough to handle compiling the necessary parts for Apple silicon, I can only suggest making use of cibuildwheel to produce all wanted wheels conveniently within CI pipelines.

A working example can be found within the scikit-learn workflows, with more listed on the cibuildwheels website itself.

I can only add that I'd be very happy to see Apple Silicon wheels for cpymad :)

@coldfix
Copy link
Member

coldfix commented Dec 5, 2022

Sounds amazing! This might greatly simplify cpymad's actions configuration. On the other hand, it might not help with building madx itself.

@coldfix
Copy link
Member

coldfix commented Jan 24, 2023

I was just checking up on the possibility of providing upstream cpymad wheels for M1. Apparently, github actions doesn't host M1 runners yet, although they're planning to support it, at some point. This means it would have to be built using cross-compilation, virtualization, or a self-hosted runner. The easiest option would be to wait for now.

Possibly, cibuildwheel already does this for us using cross-compilation, but I'll have to check in more detail. In particular, there might be difficulties with the need for a fortran compiler (as always), so I expect windows build won't work as easily using this tool.

@fsoubelet
Copy link

Regarding macOS it seems that indeed cibuildwheel uses XCode command line tools to perform cross-compilation: https://cibuildwheel.readthedocs.io/en/stable/faq/#apple-silicon

@coldfix
Copy link
Member

coldfix commented Feb 2, 2023

Hi,

I succeeded in cross-compiling some wheels for M1. These are, however, completely untested because github doesn't provide any hosted runners for this platform. Also, there are tons of warnings during linking.

These experimental wheels will be released shortly (in about an hour or so) with cpymad v1.12.0. I would appreciate any feedback if those things work :)

This might be interesting for any of you @fsoubelet @ab-gh @GuillaumeRD, @pbelange.

Best, Thomas

@fsoubelet
Copy link

fsoubelet commented Feb 2, 2023

Hey @coldfix,

I just tested quite a few of my scripts / tests in a new 3.11 environment with your wheels and it all seems fine as far as I can see! :D

Thanks a lot, it's very nice to have these and not need to compile ourselves 👍

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

3 participants