-
Notifications
You must be signed in to change notification settings - Fork 18
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
Error building cpymad on M1 Apple Silicon - "-march=core2" not supported #120
Comments
Hey,
you mean the one outlined in #114? I'm not good with Apple, but regarding the last part of the question:
You can try simply invoking the compiler manually, just copy the whole line and replace what you think needs to be changed. If you succeed in building the I'm currently also working on getting M1 wheels via cross-compilation as recommended in #113. |
I actually followed the instructions listed here: https://xsuite.readthedocs.io/en/latest/installation.html#install-on-apple-silicon along with what can be found here: https://github.com/hibtc/cpymad/blob/master/doc/installation/macos.rst since the mention of running I tried your suggestion above and ran the compiler manually: I got 6 warning messages related to |
I'm not sure I can help here, however I have succeeded in cross-compiling for M1 now. You may try the M1 wheels that will be arriving shortly with cpymad 1.12.0. The main thing that needed to be changed with respect to the x86_64 build was to change the relevant argument to - -DCMAKE_OSX_ARCHITECTURES=x86_64
+ -DCMAKE_OSX_ARCHITECTURES=arm64 in the cmake command. Other than that, make to install a suitable gfortran compiler, set sudo xcode-select -switch /Applications/Xcode_12.5.1.app
export SDKROOT="$(xcrun --show-sdk-path)"
export ARCHFLAGS="-arch arm64"
export _PYTHON_HOST_PLATFORM="macosx-11.0-arm64"
export MACOSX_DEPLOYMENT_TARGET="11.0"
LIBDIR="path to folder that contains libgfortran.so"
export LDFLAGS="-L$LIBDIR -Wl,-rpath,$LIBDIR" Some care needs to be taken to use compatible versions of deployment target, xcode version and gfortran. See also the updated github action starting here: cpymad/.github/workflows/build.yml Lines 185 to 223 in c8156cb
If you take the compiler line from above and just modify the parts that need changing, it should place the .o file in the correct location (see Anyway, this route is not really recommended if it can be avoided in any way. Otherwise, see how we do it for the windows build: cpymad/.github/build/windows/cpymad.sh Lines 64 to 86 in c8156cb
|
Thanks for the detailed reply; turns out that it had to do with the environment the
by replacing |
Ok, so I assume this is resolved (except maybe improved installation instructions)? |
I followed the new installation procedure for Apple Silicon (M1 in this case) and successfully built MAD-X, however when running:
I get the following error message:
Some context:
[$username]
and[$MADXDIR]
are generic names I am using here instead of the actual paths on the disk;-arch arm64
, why is the compilation still calling for the-march
and-mtune
flags? Any chance I can edit those out somewhere and replace them both with-mcpu=apple-m1
as I was able to do when building MAD-X? So far I have not been able to find where those flags are available...The text was updated successfully, but these errors were encountered: