Apple began the transition from Intel processors to Apple silicon (i.e., Apple M1 ARM64) in Mac computers [1]. Thus, the 15-year partnership with Intel is about to be ended [2].
In the other side, Intel introduced Intel oneAPI – an unified and cross-architecture performance programming model [3], without supporting new Apple chips. This challenges developers who need to use Intel Fortran Compiler [4] which only supports products using Intel processors.
A solution just come!
GNU Compiler Collection GCC 12.1 was released on May 6, 2022 [5] that support Fortran compilers on AArch64 (i.e., ARM64) architectures.
How to install GCC 12.1 on macOS M1?
gcc, g++
Open Terminal and check gcc --version
, returns clang
compiler only.
Install Homebrew, see instruction here.
Check brew version: brew --version
.
Install GCC 12.1: brew install gcc@12
.
Check GCC 12.1 installation: gcc-12 --version
.
Go to its install location: cd /opt/homebrew/bin
.
Make soft/symbolic links: ln -s gcc-12 gcc
and ln -s g++-12 g++
.
Check the gcc
and g++
priorities and location: where gcc
.
Exit and reinitiate the terminal, type in gcc --version
returns the GCC 12.1 version through Homebrew installation.
gfortran-12
Check the version of gfortran
: gfortran --version
, still point to old version gfortran-11
within gcc-11
.
Go to its install location: cd /opt/homebrew/bin
.
Make soft/symbolic links: ln -sf gfortran-12 gfortran
. The -f
option remove existing destination files (if any) before creating the link [6].
References:
[1] https://support.apple.com/en-us/HT211814
[2] https://www.cnbc.com/2020/11/10/why-apple-is-breaking-a-15-year-partnership-with-intel-on-its-macs-.html
[3] https://www.intel.com/content/www/us/en/developer/tools/oneapi/overview.html
[4] https://www.intel.com/content/www/us/en/developer/tools/oneapi/fortran-compiler.html
[5] https://gcc.gnu.org/gcc-12/
[6] https://unix.stackexchange.com/questions/207294/create-symlink-overwrite-if-one-exists