PySolid
PySolid copied to clipboard
`f2py` appears to skip code in `solid.for` that is not supported for Mac M2s
forwarded from Paul Rosen (on trying to install it on an M2 machine):
F2py appears to be skipping code in solid.fort that is not supported, in my case an implied DO in a DATA statement that is common in old fortran. A possible solution is to modify the setup to use –std=legacy in gfortran, but I don’t know how robust that is for all compilers and all machines.
More details
Pip failed until I had Michael Aivazis guide me through what is actually happening with pip and we got the code to rebuild the source with the right pip command line switch (--no-binary). I ran f2py by hand in verbose mode and it told me that the compiler did not understand a particular implied do array definition so it was skipping the code! So I have no confidence that the code is actually correctly compiled. According to Aivazis, you must use –std=legacy to get old code like this to compile properly, but I have no idea how to do that with the pip infrastructure.
it might be solved now that you can Conda install it even for osx-arm
... but it's probably a bad sign for future stability that a new macbook causes the standard compilation to fail.
Thank you @scottstanie for the info and forwarding. Could you update the notes regarding the --no-binary
and -std=legacy
options?
The long-term solution would be to translate the fotran code to python completely, as Piyush suggested before. This should not be a big project. UPDATE: I will try to work on this after #72.
I am a little bit hesitant going in this direction because the official code from IERS is still also in Fortran, based on which the solid.for
is modified. Having a pure Python version seems to make it difficult to update together with the IERS version, although we have never done it in the current Fortran version neither.