[R-SIG-Mac] gfortran and macos 27

Erich Neuwirth er|ch@neuw|rth @end|ng |rom un|v|e@@c@@t
Sat Oct 3 14:29:07 CEST 2026


Pronblem solved.
I had gcc from homebrew also installed.
Putting

# GNU Fortran for Apple Silicon:
# Work around the toolchain's invalid default macOS 18.0 target.
FC      = /opt/gfortran/bin/gfortran -arch arm64
F77     = /opt/gfortran/bin/gfortran -arch arm64
FFLAGS  += -mmacosx-version-min=15.0
FCFLAGS += -mmacosx-version-min=15.0

# OpenMP via Homebrew libomp
CPPFLAGS += -I/opt/homebrew/opt/libomp/include -Xpreprocessor -fopenmp
LDFLAGS  += -L/opt/homebrew/opt/libomp/lib -lomp


in ~/.R/Makevars solved the problem.	


> On Oct 3, 2026, at 2:06 PM, Erich Neuwirth <erich.neuwirth using univie.ac.at> wrote:
> 
> The problem seems to be buried in clang.
> 
> I reinstalled gfortran 
> and ran the following test (recommended by perplexity)
> 
> ~ /opt/gfortran/bin/gfortran --version
> 
> cat > /tmp/check.f <<'EOF'
>      program check
>      print *, 'OK'
>      end
> EOF
> 
> /opt/gfortran/bin/gfortran -arch arm64 \
>  /tmp/check.f -o /tmp/check
> 
> /tmp/check
> 
> GNU Fortran (GCC) 14.2.0
> Copyright (C) 2024 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> clang: error: invalid version number in '-mmacosx-version-min=18.0'
> zsh: no such file or directory: /tmp/check
> 
> 
> 
> 
> 
> 
> 
> 
>> On Oct 3, 2026, at 12:38 PM, Erich Neuwirth <erich.neuwirth using univie.ac.at> wrote:
>> 
>> Hi Peter,
>> I sett FFLAGS in .Renviron
>>> Sys.getenv("FFLAGS")
>> [1] "-mmacosx-version-min=26.0”
>> 
>> but when compiling still get the error
>> clang: error: invalid version number in '-mmacosx-version-min=18.0'
>> make: *** [qapsim.o] Error 1
>> ERROR: compilation failed for package ‘qap’
>> 
>> 
>> 
>>> On Oct 2, 2026, at 1:43 PM, Peter Dalgaard <pdalgd using gmail.com> wrote:
>>> 
>>> FFLAGS=-mmacosx-version-min=26.0
>> 
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac using r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac



More information about the R-SIG-Mac mailing list