From 8a8df530e296144e041d0c26d976dfae5c9019fe Mon Sep 17 00:00:00 2001 From: l00546269 Date: Sat, 7 Mar 2020 10:14:33 +0800 Subject: [PATCH] [OpenBLAS]:modifed the Makefile [Description]: check the compiler version and show the detail info --- Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 018855a..c7ba1ff 100644 --- a/Makefile +++ b/Makefile @@ -56,11 +56,21 @@ ifneq ($(INTERFACE64), 0) @echo " Use 64 bits int (equivalent to \"-i8\" in Fortran) " endif endif - @cverinfo=`$(CC) --version | sed -n '1p'`; \ - echo " C compiler ... $(C_COMPILER) (cmd & version : $${cverinfo})" + @$(CC) --version > /dev/null 2>&1;\ + if [ $$? -eq 0 ]; then \ + cverinfo=`$(CC) --version | sed -n '1p'`; \ + echo " C compiler ... $(C_COMPILER) (cmd & version : $${cverinfo})";\ + else \ + echo " C compiler ... $(C_COMPILER) (command line : $(CC))";\ + fi ifeq ($(NOFORTRAN), $(filter 0,$(NOFORTRAN))) - @fverinfo=`$(FC) --version | sed -n '1p'`; \ - echo " Fortran compiler ... $(F_COMPILER) (cmd & version : $${fverinfo})" + @$(FC) --version > /dev/null 2>&1;\ + if [ $$? -eq 0 ]; then \ + fverinfo=`$(FC) --version | sed -n '1p'`; \ + echo " Fortran compiler ... $(F_COMPILER) (cmd & version : $${fverinfo})";\ + else \ + echo " Fortran compiler ... $(F_COMPILER) (command line : $(FC))";\ + fi endif ifneq ($(OSNAME), AIX) @echo -n " Library Name ... $(LIBNAME)" -- 2.7.4