From e536c77f4dc693aafc48af910b4fd86b487e900d Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Wed, 25 Jan 2023 14:06:33 -0800 Subject: [PATCH] Silence missing gfortran errors in `Make.inc` (#48403) When we attempt to invoke `gfortran` to determine the local `libgfortran` ABI version that we should attempt to mimic, if `gfortran` is not installed we get a harmless error printed out to `stderr`: ``` /bin/sh: line 1: gfortran: command not found ``` This should silence these errors, as they're not useful to us. --- Make.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Make.inc b/Make.inc index ddea0733be6a7..bb1922c32bc44 100644 --- a/Make.inc +++ b/Make.inc @@ -1125,7 +1125,7 @@ USE_BINARYBUILDER ?= 0 endif # Auto-detect triplet once, create different versions that we use as defaults below for each BB install target -FC_VERSION := $(shell $(FC) -dM -E - < /dev/null | grep __GNUC__ | cut -d' ' -f3) +FC_VERSION := $(shell $(FC) -dM -E - < /dev/null 2>/dev/null | grep __GNUC__ | cut -d' ' -f3) ifeq ($(USEGCC)$(FC_VERSION),1) FC_OR_CC_VERSION := $(shell $(CC) -dumpfullversion -dumpversion 2>/dev/null | cut -d'.' -f1) # n.b. clang's __GNUC__ macro pretends to be gcc 4.2.1, so leave it as the empty string here if the compiler is not certain to be GCC