gfortran 12.2-darwin-r0 universal binary
This build is a fully universal binary of Iain Sandoe's release of GNU Fortran 12.2-darwin-r0 for macOS 11 (Big Sur) and higher.
It installs into /opt/gfortran
and /opt/gfortran/bin
must be on the PATH
for it to work properly. The /opt/gfortran/SDK
symlink must point to the desired SDKROOT
. E.g., you can update it with
ln -sfn $(xcrun --show-sdk-path) /opt/gfortran/SDK
Fully universal means that it runs on both arm64
and x86_64
architectures and it can produce code for both arm64
and x86_64
(technically, it consists of two native compilers and two cross-compilers - see build/README for details).
Note: this binary includes gcc
as well, which is not strictly necessary, but the only driver-driver gfortran
(which dispatches to the corresponding *-apple-darwin20.0-gfortran
driver) is on the PATH
. It does not support in-flight lipo
(i.e. multiple -arch
switches at once), so either use the experimental driver shell script or compile for each architecture separately. Other tools don't have driver-drivers, but can be used via the full <arch>-apple-darwin20.0-<tool>
name if desired.