hiddenSymmetries / simsopt

Simons Stellarator Optimizer Code
https://simsopt.readthedocs.io
MIT License
94 stars 45 forks source link

Simsopt fails to run on mac M3 with hardware error - illegal instruction: 4 #386

Closed salomon73 closed 8 months ago

salomon73 commented 9 months ago

Hi,

I managed to install simsopt on my laptop, a macbook with apple silicon M3 processor. I am using conda, installed from brew, and updated to the latest version. I followed M1/M2 installation, and in particular the conda toolchain only installation process.

I bypassed the difficulty to install f90wrap with --no-build-isolation by using the conda-forge channel. The code builds after installing a few additional packages.

However, when trying to any simsopt example script, every single step involving from simsopt import <module_name> fails with the following hardware error: illegal instruction: 4.

Here is what I tried to solve the issue:

Some additional informations:

I solved is using pip install --no-build-isolation pybind11[global].

Let me know if any additional information is requested.

Thank you.

salomon73 commented 8 months ago

To use some packages I installed that are native for Intel and haven't been bridged to Apple silicon, I used my terminal with the Rosetta II emulator when I installed simsopt. The code as then built for arch x86_64, and failed to run on arm64. This might be helpful if people encounter the same issue: when building the code, make sure that Rosetta is disabled. A quick verification:


uname -m 
arm64

Regards.