From f3005d8fb0e33a060b2943d1dffb841e5f3f5bf5 Mon Sep 17 00:00:00 2001 From: Benjamin Demaille Date: Tue, 8 Sep 2026 15:39:16 +0200 Subject: [PATCH] Makefiles: make FC default to gfortran again `FC ?= gfortran` never takes effect: GNU make already defines FC as `f77` as a built-in, and `?=` only assigns when the variable is undefined. A build that does not set FC in the environment therefore stops at: make: f77: No such file or directory make: *** [mvt.o] Error 1 Use `$(origin FC)` so gfortran is used when make supplied the default, while an FC given on the command line or in the environment is still respected. Co-Authored-By: Claude Opus 5 --- external_libs/mvtnorm/Makefile | 5 ++++- external_libs/quadpack/Makefile | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/external_libs/mvtnorm/Makefile b/external_libs/mvtnorm/Makefile index 29f883db..ad0b1090 100644 --- a/external_libs/mvtnorm/Makefile +++ b/external_libs/mvtnorm/Makefile @@ -2,7 +2,10 @@ FLAG =-O2 -DNDEBUG -fPIC AR ?= ar CXX ?= g++ CC ?= gcc -FC ?= gfortran +# make defines FC as `f77` itself, so `?=` would never take effect here. +ifeq ($(origin FC),default) +FC := gfortran +endif UNAME_S := $(shell uname -s) UNAME_M := $(shell uname -m) diff --git a/external_libs/quadpack/Makefile b/external_libs/quadpack/Makefile index f70f0b1f..9971d0e7 100644 --- a/external_libs/quadpack/Makefile +++ b/external_libs/quadpack/Makefile @@ -1,6 +1,9 @@ FLAG=-O2 -DNDEBUG -fPIC -std=legacy AR ?= ar -FC ?= gfortran +# make defines FC as `f77` itself, so `?=` would never take effect here. +ifeq ($(origin FC),default) +FC := gfortran +endif UNAME_S := $(shell uname -s) UNAME_M := $(shell uname -m)