From d3fa23cdd313b5209461d6011a4aeb306350aff8 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Sun, 19 Mar 2017 18:32:01 +0100 Subject: [PATCH] #3083 creaToolsTools Bug New Normal - Not compiling in CentOS 2.6 --- Linux/scripts/LocalFunctions.sh | 20 ++++++++++++++- Linux/scripts/ThirdParty-install-Base-rpm.sh | 26 ++++++++++++++++++++ Linux/scripts/ThirdParty-install-ITK.sh | 13 +++++++++- Linux/scripts/ThirdParty-install-VTK.sh | 13 +++++++++- Linux/scripts/ThirdParty-install-gdcm.sh | 11 ++++++++- 5 files changed, 79 insertions(+), 4 deletions(-) diff --git a/Linux/scripts/LocalFunctions.sh b/Linux/scripts/LocalFunctions.sh index 90624a2..a09a466 100644 --- a/Linux/scripts/LocalFunctions.sh +++ b/Linux/scripts/LocalFunctions.sh @@ -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 diff --git a/Linux/scripts/ThirdParty-install-Base-rpm.sh b/Linux/scripts/ThirdParty-install-Base-rpm.sh index 022fcbe..4439ccb 100644 --- a/Linux/scripts/ThirdParty-install-Base-rpm.sh +++ b/Linux/scripts/ThirdParty-install-Base-rpm.sh @@ -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 diff --git a/Linux/scripts/ThirdParty-install-ITK.sh b/Linux/scripts/ThirdParty-install-ITK.sh index e6aaafa..91e06a7 100644 --- a/Linux/scripts/ThirdParty-install-ITK.sh +++ b/Linux/scripts/ThirdParty-install-ITK.sh @@ -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 diff --git a/Linux/scripts/ThirdParty-install-VTK.sh b/Linux/scripts/ThirdParty-install-VTK.sh index 1c65f68..c8b269c 100644 --- a/Linux/scripts/ThirdParty-install-VTK.sh +++ b/Linux/scripts/ThirdParty-install-VTK.sh @@ -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 diff --git a/Linux/scripts/ThirdParty-install-gdcm.sh b/Linux/scripts/ThirdParty-install-gdcm.sh index 3ede261..b3aa011 100644 --- a/Linux/scripts/ThirdParty-install-gdcm.sh +++ b/Linux/scripts/ThirdParty-install-gdcm.sh @@ -39,6 +39,15 @@ 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 .. -- 2.47.1