Hi all,
I am trying to build from source on Apple Silicon M3. As predicted by several sources (below), `gfortran` fails to build on Apple Silicon.
After running `./configure` from SAGE_ROOT, I see the line:
gfortran: no suitable system package; standard, SPKG version 12.2.0 will be installed
Then when I `make`, the build fails with output:
[gfortran-12.2.0] ********************************************************************************
[gfortran-12.2.0] Error building gfortran-12.2.0
[gfortran-12.2.0] ********************************************************************************
[gfortran-12.2.0]
[gfortran-12.2.0] real 0m49.588s
[gfortran-12.2.0] user 2m35.894s
[gfortran-12.2.0] sys 1m22.419s
[gfortran-12.2.0] ************************************************************************
[gfortran-12.2.0] Error building package gfortran-12.2.0
[gfortran-12.2.0] ************************************************************************
The following lines in config.log seems relevant:
## Checking whether SageMath should install SPKG gfortran... ##
configure:18136: checking the version of gfortran
configure:18172: Installing gfortran because gfortran is version 14, which is too recent for this version of Sage
configure:18206: no suitable system package found for SPKG gfortran
configure:18331: checking whether any of gfortran is installed as or will be installed as SPKG
configure:110356: result: gfortran: no suitable system package; standard, SPKG version 12.2.0 will be installed
Since the build wanted to install SPKG version 12.2.0 and thought 14 was "too recent for this version of Sage" I thought I would try `brew install gcc@12`, so that a "suitable system package" would be available. After running `./configure` again I still see
gfortran: no suitable system package; standard, SPKG version 12.2.0 will be installed
Then `make` fails again as predicted.
How can I use either the homebrew gcc@12 or gcc@14 in the build process? Is this done by setting the `FC` environment variable? If so, to what value should I set it? (I tried FC=gcc@12, and still had the same problem.)
Log files are attached.
Thanks!
-Trevor
Sources predicting that `gfortran` installation will fail: