View Issue Details

IDProjectCategoryView StatusLast Update
0000452OpenFOAMBugpublic2015-01-31 22:38
Reporteruser377Assigned Tohenry  
PrioritynormalSeveritytrivialReproducibilityalways
Status resolvedResolutionfixed 
PlatformALL OSLinuxOS VersionN.A.
Summary0000452: foamInstallationTest does not check the right compiler
DescriptionRuning foamInstallationTest fails if the C compiler is not gcc.
Line 461 of foamInstallationTest replace:

reportExecutable gcc
with
reportExecutable "$WM_CC"

to solve the problem.
Steps To Reproducerun foamInstallationTest when OpenFoam is not compiled with gcc but another compiler: icc, gcc44, ....etc.
TagsNo tags attached.

Activities

wyldckat

2015-01-31 19:24

updater  

check_g++_and_any_gcc.patch (1,794 bytes)   
diff --git a/bin/foamInstallationTest b/bin/foamInstallationTest
index e904e3d..2188e2e 100755
--- a/bin/foamInstallationTest
+++ b/bin/foamInstallationTest
@@ -232,7 +232,7 @@ reportExecutable()
         echo "`fixlen "$1" 9`" "*** not installed ***"
         VERSION=""
         case "$1" in
-        gcc | $foamTestApp)
+        gcc* | $foamTestApp)
             echo "          CRITICAL ERROR"
             criticalError=`expr $criticalError + 1`
             ;;
@@ -249,10 +249,19 @@ reportExecutable()
         VERSION=`$1 --version /dev/null 2>&1      \
             | sed -ne 's/flex \([0-9][0-9.]*\).*/\1/p' `
         ;;
-    gcc)
+    gcc* | g++*)
         VERSION=`$1 -v 2>&1 \
             | sed -ne 's/^gcc version \([0-9][0-9.]*\).*/\1/p' `
 
+        case "$1" in
+        gcc*)
+            BINARYCODENAME=gcc
+            ;;
+        g++*)
+            BINARYCODENAME=g++
+            ;;
+        esac
+
         MINV1=`echo $MIN_VERSION_GCC | cut -d. -f1`
         MINV2=`echo $MIN_VERSION_GCC | cut -d. -f2`
         MINV3=`echo $MIN_VERSION_GCC | cut -d. -f3`
@@ -285,14 +294,13 @@ reportExecutable()
         fi
 
         if [ "$gccOk" != "" ]; then
-            echo "ERROR: gcc version is too old for this release of OpenFOAM"
+            echo "ERROR: $BINARYCODENAME version is too old for this release of OpenFOAM"
             echo "    User version    : $VERSION"
             echo "    Minimum required: $MIN_VERSION_GCC"
             echo ""
             fatalError=`expr $fatalError + 1`
         fi
 
-
         ;;
     gtar)
         VERSION=`$APP_PATH --version | head -1`
@@ -458,6 +466,7 @@ echo "$COL1 $COL2 $COL3"
 hline
 reportExecutable flex
 reportExecutable "$WM_CC"
+reportExecutable "$WM_CXX"
 reportExecutable gzip
 if [ "$OSTYPE" = Linux ]
 then
check_g++_and_any_gcc.patch (1,794 bytes)   

wyldckat

2015-01-31 19:26

updater   ~0003635

Well, technically the reported fix was implemented in OpenFOAM 2.3.0.

But the problem is that this is not checking for the actual "gcc" format, in order to confirm the version and validate it.
In addition, when it comes to GCC, the actual compiler binary to be used is "g++", which sometimes users forget to install.

Attached is the file "check_g++_and_any_gcc.patch" fixes the check for any "gcc*" prefixed application and adds the check for "g++".

Nonetheless, the proposed patch does not add the check for compatible Intel compiler versions, nor clang versions :(

henry

2015-01-31 20:09

manager   ~0003636

Thanks for the patch for gcc/g++. I will make the change and close.

At the moment we cannot support the Intel compiler as it is no longer generally available. If Intel release version 15 as they did earlier releases we will test and maintain support for it.

henry

2015-01-31 22:38

manager   ~0003639

Thanks for the patch.
Resolved by commit a170d0b054d19ef3a31addced7181bf41207f237

Issue History

Date Modified Username Field Change
2012-03-08 08:24 user377 New Issue
2015-01-31 19:24 wyldckat File Added: check_g++_and_any_gcc.patch
2015-01-31 19:26 wyldckat Note Added: 0003635
2015-01-31 20:09 henry Note Added: 0003636
2015-01-31 22:38 henry Note Added: 0003639
2015-01-31 22:38 henry Status new => resolved
2015-01-31 22:38 henry Resolution open => fixed
2015-01-31 22:38 henry Assigned To => henry