Fortran installation in Mac OS (Apple Silicon M1/M2/M3)

If you are reading this section, it is because you have an Apple Silicon chip and encountered the following error when trying to access any variable, class or function of the package:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/acuna/anaconda3/envs/GASTLI_norosetta/lib/python3.10/site-packages/gastli/dimensions.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace (_f2pyinitdimensions_)

There are two options to fix this error: 1) using an Intel emulation with Rosetta, or 2) using a disk image. We explain both options below.

2) Installation with disk image

François-Xavier Coudert’s github repository provides gfortran disk images (.dmg) that allow you to install gfortran via an installation wizard on the Apple Silicon (M1, M2, M3) chips. Follow the installation instructions provided in FX Coudert’s repository.

Ensure you download and install the version of gfortran compatible with your operating system (M1, M2 or M3) and architecture (ARM64). After installation, verify the default gfortran binary by running the command which gfortran in your terminal. This command should return the path to the ARM64 binary you just installed.

If the returned path does not point to the installed ARM64 binary, you may need to update your system’s PATH to prioritize the correct binary location.