dfm / python-fsps

Python bindings to Charlie Conroy's Flexible Stellar Population Synthesis (FSPS) Fortran code
https://python-fsps.readthedocs.io
MIT License
65 stars 38 forks source link

Not able to change isochrone on Mac M1 #248

Closed Yilunium closed 3 months ago

Yilunium commented 9 months ago

I set up an intel architecture on my Mac M1 (there is some other portion of my code that only runs in this intel architecture so I could not switch to an arm64 environment unfortunately...)

Following a previously closed issue (176), I installed minforge on my computer, ran pip install fsps, and the installation and import-to-python were successful.

However, when I tried to switch the isochrones with

pip uninstall fsps
FFLAGS="-DMIST=0 -DPADOVA=1 -DMILES=0 -DBASEL=1" python -m pip install fsps --no-binary fsps

and import fsps in python, i got this error:

dlopen(/Users/ym/opt/anaconda3_x86/envs/pymultinest/lib/python3.9/site-packages/fsps/_fsps.cpython-39-darwin.so, 0x0002): tried: '/Users/ym/opt/anaconda3_x86/envs/pymultinest/lib/python3.9/site-packages/fsps/_fsps.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/ym/opt/anaconda3_x86/envs/pymultinest/lib/python3.9/site-packages/fsps/_fsps.cpython-39-darwin.so' (no such file), '/Users/ym/opt/anaconda3_x86/envs/pymultinest/lib/python3.9/site-packages/fsps/_fsps.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

Is there a solution to this? Thank you.

dfm commented 9 months ago

It looks like you're trying to run in an x86 emulated environment (it's called anaconda3_x86). You should make sure that you're using an ARM Python installation, because we haven't had any luck cross compiling Fortran on Mac.