]> Creatis software - creaToolsTools.git/commitdiff
#3083 creaToolsTools Bug New Normal - Not compiling in CentOS 2.6
authorEduardo DAVILA <davila@CreaTools-CentOS.(none)>
Sun, 19 Mar 2017 17:32:01 +0000 (18:32 +0100)
committerEduardo DAVILA <davila@CreaTools-CentOS.(none)>
Sun, 19 Mar 2017 17:32:01 +0000 (18:32 +0100)
Linux/scripts/LocalFunctions.sh
Linux/scripts/ThirdParty-install-Base-rpm.sh
Linux/scripts/ThirdParty-install-ITK.sh
Linux/scripts/ThirdParty-install-VTK.sh
Linux/scripts/ThirdParty-install-gdcm.sh

index 90624a24f2901c36625ebf4fe142fc741f9113bf..a09a466cd52d83d017873e227651fcc1d1181877 100644 (file)
@@ -51,7 +51,7 @@ function bigDisplay {
 ###########################################
 function checkDistrib {
     local OS=$1
-    if [ "`checkVal $OS MacOS Fedora Ubuntu Mandriva`" == "false" ] ; then
+    if [ "`checkVal $OS MacOS Fedora Ubuntu Mandriva CentOS`" == "false" ] ; then
         echo "Operating System not supported: $OS"
         echo "Currently supported system: Fedora Ubuntu MacOS"
         exit 1
@@ -79,17 +79,35 @@ function getDistribVersion {
       if [ "$DISTRIB" == MacOS ] ; then OSVesion=VOID_Darwin_EED;
     elif [ "$DISTRIB" == Fedora  ] ; then OSVersion=`awk 'NR==1{print $3}' /etc/system-release`
     elif [ "$DISTRIB" == Ubuntu  ] ; then OSVersion=`awk 'NR==1{print $2}' /etc/issue`
+    elif [ "$DISTRIB" == CentOS  ] ; then OSVersion=`awk 'NR==1{print $3}' /etc/issue`
     else OSVersion="VOID_EED"
     fi
     echo $OSVersion
 }
 
+###########################################
+function getKernelVersion {
+    local DISTRIB=`getDistrib`
+
+      if [ "$DISTRIB" == MacOS ] ; then KernelVesion=VOID_Darwin_EED;
+    elif [ "$DISTRIB" == Fedora  ] ; then KernelVersion=$(uname -a | awk '{print $3}')
+    elif [ "$DISTRIB" == Ubuntu  ] ; then KernelVersion=$(uname -a | awk '{print $3}')
+    elif [ "$DISTRIB" == CentOS  ] ; then KernelVersion=$(uname -a | awk '{print $3}')
+    else KernelVersion="VOID_EED"
+    fi
+    echo $KernelVersion
+}
+
+
+
+
 ###########################################
 function getDownloadCommand {
     local DISTRIB=`getDistrib`
 
       if [ "$DISTRIB" == MacOS ] ; then downloadCommand=curl;
     elif [ "$DISTRIB" == Fedora  ] ; then downloadCommand='aria2c -x 16'
+    elif [ "$DISTRIB" == CentOs  ] ; then downloadCommand='aria2c -x 16'
     elif [ "$DISTRIB" == Ubuntu  ] ; then downloadCommand=wget
     else downloadCommand="VOID_EED"
     fi
index 022fcbe6fddd2ea2b254ffbeac86984ee500879a..4439ccbd176a70a07039d606f993d7f1828dc7be 100644 (file)
@@ -89,6 +89,32 @@ then
      yum install fcgi                 -y
      yum install fcgi-devel           -y
 
+     ;;
+  CentOS)
+     yum install aria2                -y
+     yum install wget                 -y
+     yum install unzip                -y
+     yum install cmake                -y
+     yum install cmake-gui            -y
+     yum install doxygen              -y
+     yum install graphviz             -y
+     yum install texlive              -y
+     yum install latex2html           -y
+     yum install wxGTK-devel wxBase   -y
+     yum install boost-devel          -y
+     yum install sqlite-devel         -y
+     yum install qt-devel             -y
+     yum install mesa-libOSMesa-devel -y
+     yum install gcc                  -y
+     yum install gcc-c++              -y
+     yum install redhat-rpm-config    -y
+     yum install xerces-c-devel       -y
+     yum install git                  -y
+     yum install qtwebkit-devel       -y
+     yum install patch                -y
+     yum install fcgi                 -y
+     yum install fcgi-devel           -y
+
      ;;
   Ubuntu)
      apt-get --yes install aria2
index e6aaafa92738b467ee4c2892ca3140894595def0..91e06a75958320ed91ead68b4dd6a283bac59dda 100644 (file)
@@ -69,6 +69,17 @@ source $PWD/scripts/CreaTools-configure.sh
    echo "------"
 
 
+#EED 2017-03-24
+  source $PWD/scripts/LocalFunctions.sh
+  if [ `getDistrib` == "CentOS" ] && [ `getKernelVersion` < "2.6.34" ]
+  then
+       stdCompiler=c++98
+  else
+       stdCompiler=c++03
+  fi
+
+
+
 scriptDir=$PWD
 sourcesDir=$generationdir/thirdparty_sources
 binDir=$generationdir/thirdparty_bin
@@ -164,7 +175,7 @@ then
   then
      cmake -D ITKV3_COMPATIBILITY:BOOL=ON -D ITKGroup_Nonunit:BOOL=ON -D  ITKGroup_IO:BOOL=ON  -D Module_ITK-Deprecated:BOOL=ON -D Module_ITK-Review:BOOL=ON  CMakeCache.txt        
   fi
-  cmake -D CMAKE_CXX_FLAGS:STRING='-std=c++03' CMakeCache.txt
+  cmake -D CMAKE_CXX_FLAGS:STRING=-std=${stdCompiler} CMakeCache.txt
 
   #uncomment following line if you want to use the bleeding edge of GDCM2!
   #cmake -D ITK_USE_SYSTEM_GDCM:BOOL=ON CMakeCache.txt
index 1c65f683689f089531a907e7e823abeda99ba15c..c8b269ca1b5d0ecbdbc3801d3b6a059457ecce15 100644 (file)
@@ -64,6 +64,17 @@ source $PWD/scripts/CreaTools-configure.sh
    echo "------"
 
 
+#EED 2017-03-24
+  source $PWD/scripts/LocalFunctions.sh
+  if [ `getDistrib` == "CentOS" ] && [ `getKernelVersion` < "2.6.34" ]
+  then
+       stdCompiler=c++98
+  else
+       stdCompiler=c++03
+  fi
+
+
+
 scriptDir=$PWD
 sourcesDir=$generationdir/thirdparty_sources
 binDir=$generationdir/thirdparty_bin
@@ -175,7 +186,7 @@ then
   fi
 
   cmake -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON -D VTK_USE_QT:BOOL=ON CMakeCache.txt
-  cmake -D CMAKE_CXX_FLAGS:STRING='-std=c++03' CMakeCache.txt
+  cmake -D CMAKE_CXX_FLAGS:STRING=-std=${stdCompiler} CMakeCache.txt
 
 ##EED 2016-12-22  make -j $corenumber
   make -j $corenumber
index 3ede261d24e760b1af9338e6d12566dda32d11d6..b3aa011fc3f5a6ba3f08fe2226a249d3d5b99791 100644 (file)
 fi
 
 source $PWD/scripts/CreaTools-configure.sh
+#EED 2017-03-24
+  source $PWD/scripts/LocalFunctions.sh
+  if [ `getDistrib` == "CentOS" ] && [ `getKernelVersion` < "2.6.34" ]
+  then
+       stdCompiler=c++98
+  else
+       stdCompiler=c++03
+  fi
+
 
    echo "------"
    echo $PWD/scripts/CreaTools-configure.sh
@@ -130,7 +139,7 @@ then
   cmake -D CMAKE_BUILD_TYPE:STRING=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
   cmake -D VTK_DIR:PATH=$VTK_DIR CMakeCache.txt
   cmake -D GDCM_VTK:BOOL=ON -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt
-  cmake -D CMAKE_CXX_FLAGS:STRING='-std=c++03' CMakeCache.txt
+  cmake -D CMAKE_CXX_FLAGS:STRING=-std=${stdCompiler} CMakeCache.txt
   make -j $corenumber
   make -j $corenumber install
   cd ..