-
Notifications
You must be signed in to change notification settings - Fork 75
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
PDD installation fails on Apple M1 architecture #209
Comments
@dalonsoa I think I might be able to solve this, but I am not that familiar with how the PDD solver is compiled and just searching the codebase indicates that |
Thanks for pointing this issue and sorry for not being too responsive lately. The compilation options are set here: Lines 46 to 53 in 883a31a
That |
Update (for myself): there appear to be a more general issue with compiling Fortran on the new Apple silicon chips. Currently trying to see if one of these experimental releases will work. |
Ok, sort of resolved. For reasons I do not understand, Homebrew gfortran (part of gcc, version 12.0.0 20211218 Target: aarch64-apple-darwin21) completely fails to compile the Fortran source files. It gives a bunch of errors with a similar format like:
This happens whether I try to run the compilation through setup.py, or by calling f2py directly (this is a very small selection from probably hundreds of similar errors). However, downloading an experimental release for ARM macOS 12 (Monterey) from the link in my previous comment, specifically the 19 December 2021 release, did work. However, I am not sure how to specify the path of gfortran manually for f2py, so to get this to work (after installing the experimental gfortran release - follow the instructions given in the README file provided with the download, you need to install the Xcode app and command line tools first), I had to do:
After this, I was able to run examples involving the PDD, however they DID NOT work if trying to import anything involving the PDD when the working directory is the Solcore directory (in fact this is an issue I have had before and have helped others with, we should add it to the documentation). Obviously this is annoying because it means having to download Xcode (which is like 10GB) and a specific gfortran only to install the PDD. I have no idea if this will get resolved with future gcc/gfortran versions available through a simpler channel like Homebrew. Hopefully I can at least modify setup.py so it selects the correct gfortran if an Apple silicon/ARM chip is detected (but again, I don't currently know how to do this). |
Update: this issue appears to be fixed using current Homebrew gcc/gfortran (gcc 12.2.0). Documentation should be updated to reflect this. |
Describe the bug
Installing Solcore with the PDD fails on new-generation MacBook (Apple M1 Max chip). This appears to be due to the
-march=native
flag used during compilation of the Fortran code.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expected Solcore to install with the PDD solver.
Result
A long error message is produced, but the key issue appears to be the following:
Desktop (please complete the following information):
Additional context
This problem has been noted elsewhere and also occurs when building S4. In that case, it was fixed by replacing the
-march=native
flag bymcpu=apple-m1
, but I am not sure where the march=native flag even comes from in the case of Solcore.The text was updated successfully, but these errors were encountered: