To quote from the page you downloaded R from:
This release uses Xcode 14.2/14.3 and GNU Fortran 12.2. If you wish to compile
R packages which contain Fortran code, you may need to download the
corresponding GNU Fortran compiler from https://mac.R-project.org/tools.
> On Jul 6, 2023, at 11:50
Hello:
"R CMD build KFAS" under macOS 11.7.8 stopped with:
using C compiler: ‘Apple clang version 12.0.5 (clang-1205.0.22.9)’
sh: gfortran: command not found
using SDK: ‘MacOSX11.3.sdk’
gfortran -arch x86_64 -fPIC -Wall -g -O2 -c approx.f90 -o approx.o
make: gfortran: No such fil