Skip to content

Commit 5ab5f98

Browse files
authored
[build] Silence non-fatal gfortran: command not found errors (#44554)
We build without `gfortran` pretty regularly these days, let's make it slightly less annoying to build without a `gfortran` available on the path.
1 parent efa2430 commit 5ab5f98

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Make.inc

+2-2
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,8 @@ ifeq ($(OS),FreeBSD)
647647
ifneq (,$(findstring gfortran,$(FC)))
648648

649649
# First let's figure out what version of GCC we're dealing with
650-
_GCCMAJOR := $(shell $(FC) -dumpversion | cut -d'.' -f1)
651-
_GCCMINOR := $(shell $(FC) -dumpversion | cut -d'.' -f2)
650+
_GCCMAJOR := $(shell $(FC) -dumpversion 2>/dev/null | cut -d'.' -f1)
651+
_GCCMINOR := $(shell $(FC) -dumpversion 2>/dev/null | cut -d'.' -f2)
652652

653653
# The ports system uses major and minor for GCC < 5 (e.g. gcc49 for GCC 4.9), otherwise major only
654654
ifeq ($(_GCCMAJOR),4)

deps/csl.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Interrogate the fortran compiler (which is always GCC based) on where it is keeping its libraries
2-
STD_LIB_PATH := $(shell LANG=C $(FC) -print-search-dirs | grep '^programs: =' | sed -e "s/^programs: =//")
3-
STD_LIB_PATH += :$(shell LANG=C $(FC) -print-search-dirs | grep '^libraries: =' | sed -e "s/^libraries: =//")
2+
STD_LIB_PATH := $(shell LANG=C $(FC) -print-search-dirs 2>/dev/null | grep '^programs: =' | sed -e "s/^programs: =//")
3+
STD_LIB_PATH += :$(shell LANG=C $(FC) -print-search-dirs 2>/dev/null | grep '^libraries: =' | sed -e "s/^libraries: =//")
44
ifneq (,$(findstring CYGWIN,$(BUILD_OS))) # the cygwin-mingw32 compiler lies about it search directory paths
55
STD_LIB_PATH := $(shell echo '$(STD_LIB_PATH)' | sed -e "s!/lib/!/bin/!g")
66
endif

0 commit comments

Comments
 (0)