#!/bin/bash -e
-
- #This code is Mac
- function EEDreadlink() {
- DIR="${1%/*}"
- (cd "$DIR" && echo "$(pwd -P)")
- }
-#EED 2018-08-26
++# <<<<<<< HEAD
++#
++# #This code is for Mac
++# function EEDreadlink() {
++# DIR="${1%/*}"
++# (cd "$DIR" && echo "$(pwd -P)")
++# }
++#
++#
++# #EED 2120-08-25 This code is not working in MacOS so we use EEDreadlink()
++# #EED scriptDirName=$(dirname $(Ereadlink -f $0) )
++# scriptDirName=$(dirname $(Ereadlink $0) )/Linux
++# =======
++# #EED 2018-08-26
++#
++# #scriptDirName=$(dirname $(readlink -f $0) )
++# scriptDirName=$(pwd)
++# >>>>>>> origin/vtk8itk5wx3-mingw64
++ scriptDirName=$(pwd)
-#scriptDirName=$(dirname $(readlink -f $0) )
-scriptDirName=$(pwd)
- #EED 2120-08-25 This code is not working in MacOS so we use EEDreadlink()
- #EED scriptDirName=$(dirname $(Ereadlink -f $0) )
- scriptDirName=$(dirname $(Ereadlink $0) )/Linux
-
#########################################################################
############ Local Functions #######################################
#########################################################################
++echo scriptDirName $scriptDirName
++
++
++
++
source scripts/LocalFunctions.sh
configureFile="scripts/CreaTools-configure.sh"
# default configuration parameters
OperatingSystem=`getDistrib`
corenumber=`getncore`
-echo "hola1"
-generationdir=$HOME/Creatis/creaTools
+generationdir=$HOME/Creatis/C11
installPrefixThird=
installPrefix=
docgeneration=OFF
sourcesFrom=GIT
+
loginUserName=$USER
loginGroupName=`groups | awk '{print $1}'`
buildType=Release
gdcmVersion=GDCM1
- ITKVersion=ITK3
+ ITKVersion=ITK4
export ETC_BASHRC=`getbashrc`
+TDx=OFF
function usage {
##################################################################################
############################ check configuration parameters
-# check distrib
+# check distribÒ
checkDistrib $OperatingSystem
# complete default install prefix
echo "gdcmVersion=$gdcmVersion" >> $configureFile
echo "ITKVersion=$ITKVersion" >> $configureFile
echo "ETC_BASHRC=$ETC_BASHRC" >> $configureFile
+ echo "TDx=$TDx" >> $configureFile
fi
# install packaged dependencies as root
if [ `checkVal $command all 3rd 3rd-base` == true ] ; then
bigDisplay "INSTALL PACKAGES DEPENDENCIES"
- source scripts/CreaTools-configure.sh
+ bash scripts/CreaTools-configure.sh
cd scripts
source ThirdParty-install-Base-Stuff.sh $OperatingSystem
cd ..
# vtk
if [ `checkVal $command all 3rd 3rd-vtk` == true ] ; then
- bigDisplay "INSTALL VTK"
- source scripts/ThirdParty-install-VTK.sh
- cd $scriptDirName
+ bigDisplay "INSTALL VTK"
+ bash scripts/ThirdParty-install-VTK.sh
+ cd $scriptDirName
fi
# gdcm
if [ `checkVal $command all 3rd 3rd-gdcm` == true ] ; then
bigDisplay "INSTALL $gdcmVersion"
- source scripts/ThirdParty-install-gdcm.sh
+ bash scripts/ThirdParty-install-gdcm.sh
+ pwd
+ echo $scriptDirName
cd $scriptDirName
fi
# itk
if [ `checkVal $command all 3rd 3rd-itk` == true ] ; then
- bigDisplay "INSTALL $ITKVersion"
- bash scripts/ThirdParty-install-ITK.sh
+ bigDisplay "INSTALL $ITKVersion"
+ bash scripts/ThirdParty-install-ITK.sh
cd $scriptDirName
fi
# wt
if [ `checkVal $command all 3rd 3rd-wt` == true ] ; then
bigDisplay "INSTALL WT"
- source scripts/ThirdParty-install-WT.sh
+ bash scripts/ThirdParty-install-WT.sh
cd $scriptDirName
fi
--- /dev/null
-OperatingSystem=Fedora
-corenumber=6
-generationdir=/home/davila/Creatis/C11
-installPrefix=/home/davila/Creatis/C11/ci
-installPrefixThird=/home/davila/Creatis/C11/tpli
+ #!/bin/bash
+
+ #File generated by 'installscript'
+ #DO NOT edit !
+ #(except if you *do* know what you do)
+
-loginGroupName=davila
++OperatingSystem=MacOS
++corenumber=8
++generationdir=/Users/davila/Creatis/C11
++installPrefix=/Users/davila/Creatis/C11/ci
++installPrefixThird=/Users/davila/Creatis/C11/tpli
+ docgeneration=OFF
+ sourcesFrom=GIT
+ loginUserName=davila
-ETC_BASHRC=/home/davila/.bashrc
++loginGroupName=staff
+ buildType=Release
+ gdcmVersion=GDCM1
+ ITKVersion=ITK4
++ETC_BASHRC=/Users/davila/.bashrc
++TDx=ON
###########################################
function checkDistrib {
local OS=$1
- if [ "`checkVal $OS MacOS Fedora Ubuntu Mandriva CentOS`" == "false" ] ; then
+ if [ "`checkVal $OS MacOS Fedora Ubuntu Mandriva CentOS Debian`" == "false" ] ; then
echo "Operating System not supported: $OS"
echo "Currently supported system: Fedora Ubuntu MacOS"
exit 1
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`
+ elif [ "$DISTRIB" == Debian ] ; then OSVersion=`awk 'NR==1{print $3}' /etc/issue`
else OSVersion="VOID_EED"
fi
echo $OSVersion
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}')
+ elif [ "$DISTRIB" == Debian ] ; then KernelVersion=$(uname -a | awk '{print $3}')
else KernelVersion="VOID_EED"
fi
echo $KernelVersion
elif [ "$DISTRIB" == Fedora ] ; then downloadCommand='aria2c -x 16'
elif [ "$DISTRIB" == CentOs ] ; then downloadCommand='aria2c -x 16'
elif [ "$DISTRIB" == Ubuntu ] ; then downloadCommand=wget
+ elif [ "$DISTRIB" == Debian ] ; then downloadCommand=wget
else downloadCommand="VOID_EED"
fi
echo $downloadCommand
echo " Build type : $buildType"
echo " Gdcm version : $gdcmVersion"
echo " ITK version : $ITKVersion"
+ echo " TDx : $TDx"
echo
}
yum install mesa-libOSMesa-devel -y
yum install gcc -y
yum install gcc-c++ -y
+ yum install make -y
yum install redhat-rpm-config -y
yum install xerces-c-devel -y
yum install git -y
apt-get --yes install graphviz
apt-get --yes install texlive
apt-get --yes install latex2html
- apt-get --yes install libgtk2.0-dev #GTK
- apt-get --yes install libwxgtk2.8-dev #Wx GTK
- apt-get --yes install libwxbase2.8-dev #Wx solito
+
+ # apt-get --yes install libgtk2.0-dev #GTK
+ apt-get --yes install libgtk-3-dev #GTK
+ # apt-get --yes install libwxgtk2.8-dev #Wx GTK
+ apt-get --yes install libwxgtk3.0-dev #Wx GTK
+ # apt-get --yes install libwxbase2.8-dev #Wx solito
+ apt-get --yes install libwxbase3.0-dev #Wx solito
apt-get --yes install wx-common #wxrc
+
apt-get --yes install libboost-dev #Boost
apt-get --yes install libboost-all-dev #Boost
apt-get --yes install libqt4-dev #QT4
;;
MacOS)
port selfupdate
+ port -N install cairo -y
+ port -N install libomp -y
+# port -f activate libomp -y
+ port -f activate libomp-devel -y
++
port -N install wget -y
port -N install cmake -y
port -N install doxygen -y
echo
exit 0
fi
-echo $PWD/scripts/CreaTools-configure.sh
-echo --- beg
-more $PWD/scripts/CreaTools-configure.sh
-echo --- end
+
source $PWD/scripts/CreaTools-configure.sh
echo "------"
fi
cd $sourcesDir
-## if [ $ITKVersion = ITK3 ]
-## then
-## # deal with ITK3
-## #EED itkfile=InsightToolkit-3.20.0.patchCreatis.tar.gz
-## #EED libname=InsightToolkit-3.20.0
-##
-## #EED itkfile=InsightToolkit-3.20.1.tar.gz
-## #EED libname=InsightToolkit-3.20.1
-##
-## itkfile=InsightToolkit-3.20.1-patchCreatis.tgz
-## libname=InsightToolkit-3.20.1-patchCreatis
-##
-## else
-## # deal with ITK4
-## itkfile=InsightToolkit-4.13.1.zip
-## libname=InsightToolkit-4.13.1
-## fi
+ echo "we download new stuff"
+# if [ $ITKVersion = ITK3 ]
+# then
+# # deal with ITK3
+# #EED itkfile=InsightToolkit-3.20.0.patchCreatis.tar.gz
+# #EED libname=InsightToolkit-3.20.0
+#
+# #EED itkfile=InsightToolkit-3.20.1.tar.gz
+# #EED libname=InsightToolkit-3.20.1
+#
+# itkfile=InsightToolkit-3.20.1-patchCreatis.tgz
+# libname=InsightToolkit-3.20.1-patchCreatis
+#
+# else
+# # deal with ITK4
+# itkfile=InsightToolkit-4.13.1.zip
+# libname=InsightToolkit-4.13.1
+# fi
itkfile=InsightToolkit-5.0.1.zip
libname=InsightToolkit-5.0.1
cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
cmake -D CMAKE_BUILD_TYPE:STRING=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
-
cmake -D BUILD_SHARED_LIBS:BOOL=ON -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF CMakeCache.txt
-## if [ $ITKVersion = ITK3 ]
-## then
-## cmake -D ITK_USE_REVIEW:BOOL=ON CMakeCache.txt
-## fi
-
-## if [ $ITKVersion = ITK4 ]
-## then
-
-## ##EED ITK4.0
-## # 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
-##
-## ##EED ITK4.12
-## # -D ITK_USE_SYSTEM_GDCM=ON
-## cmake -D ITKV3_COMPATIBILITY:BOOL=ON -D Module_ITKReview:BOOL=ON CMakeCache.txt
-##
-## fi
-
- cmake -D Module_ITKReview:BOOL=ON CMakeCache.txt
- cmake -D ITKV4_COMPATIBILITY:BOOL=ON CMakeCache.txt
- cmake -D CMAKE_CXX_FLAGS:STRING=-std=${stdCompiler} CMakeCache.txt
+# if [ $ITKVersion = ITK3 ]
+# then
+# cmake -D ITK_USE_REVIEW:BOOL=ON CMakeCache.txt
+# fi
+# if [ $ITKVersion = ITK4 ]
+# then
+###EED ITK4.0
+## 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
+#
+###EED ITK4.12
+## -D ITK_USE_SYSTEM_GDCM=ON
+# cmake -D ITKV3_COMPATIBILITY:BOOL=ON -D Module_ITKReview:BOOL=ON CMakeCache.txt
+# fi
+
+ cmake -D Module_ITKReview:BOOL=ON CMakeCache.txt
++# cmake -D ITKV4_COMPATIBILITY:BOOL=ON 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
if [ `getDistrib` == "CentOS" ] && [ `getKernelVersion` < "2.6.34" ]
then
stdCompiler=c++98
- else
- stdCompiler=c++03
+ # else
+ # stdCompiler=c++03
fi
-
scriptDir=$PWD
sourcesDir=$generationdir/thirdparty_sources
binDir=$generationdir/thirdparty_bin
##
## fi
- wget https://www.vtk.org/files/release/8.1/VTK-8.1.1.zip
- unzip VTK-8.1.1.zip
+## wget https://www.vtk.org/files/release/8.2/VTK-8.2.0.zip
+## unzip VTK-8.2.0.zip
+
- wget http://www.creatis.insa-lyon.fr/~davila/creatools_back_site/crea_ThirdParty_Libraries/source/VTK-8.2.0-Patch.zip
- unzip VTK-8.2.0-Patch.zip
++
++cxxFlags=' '
++if [ $TDx == "ON" ]
++then
++ cxxFlags=$cxxFlags'-F/Library/Frameworks -DVTK_USE_TDX '
++ libname=VTK-8.2.0-Patch-TDx
++else
++ libname=VTK-8.2.0-Patch
++fi
++
++wget http://www.creatis.insa-lyon.fr/~davila/creatools_back_site/crea_ThirdParty_Libraries/source/$libname.zip
++unzip $libname.zip
++
++
++
++
++
+
#if [ $buildType = "Debug" ]
#then
#if [ true = false ]
if [ true = true ]
then
- libname=VTK-8.2.0-Patch
- libname=VTK-8.1.1
- libnameB=vtk-8.1
+ libnameB=vtk-8.2
dirInstall=$binDir/$libname-Bin
## export VTK_DIR=$installPrefixThird/lib/vtk-5.6/
export VTK_DIR=$installPrefixThird/lib/cmake/$libnameB/
cd $dirInstall
# See EED why we have to do this
-- if [ $OperatingSystem = "MacOS" ]
-- then
-- cmake -D CMAKE_CXX_COMPILER:FILE=/usr/bin/g++
- echo
-- fi
++# if [ $OperatingSystem = "MacOS" ]
++# then
++# cmake -D CMAKE_CXX_COMPILER:FILE=/usr/bin/g++
++# echo
++# fi
cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
++
++ cmake -D CMAKE_CXX_FLAGS:STRING="$cxxFlags" CMakeCache.txt
cmake -D CMAKE_BUILD_TYPE:STRING=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
if [ $OperatingSystem = "MacOS" ]
cmake -D BUILD_SHARE_LIBS:BOOL=ON -D VTK_USE_CARBON:BOOL=OFF -D VTK_USE_COCOA:BOOL=ON CMakeCache.txt
cmake -D VTK_USE_TCL:BOOL=OFF CMakeCache.txt
CMakeCache.txt
+ echo
fi
- cmake -D VTK_Group_Views:BOOL=ON -D VTK_Group_Qt:BOOL=ON CMakeCache.txt
- cmake -D VTK_Group_Views:BOOL=ON -D VTK_Group_Qt:BOOL=ON CMakeCache.txt
++ cmake -D VTK_Group_Views:BOOL=ON -D VTK_Group_Qt:BOOL=OFF CMakeCache.txt
cmake -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON CMakeCache.txt
-- cmake -D VTK_Group_Views:BOOL=ON -D VTK_Group_Qt:BOOL=OFF CMakeCache.txt
- cmake -D CMAKE_INSTALL_LIBDIR:STRING="lib" CMakeCache.txt
++ cmake -D CMAKE_INSTALL_LIBDIR:STRING="lib" CMakeCache.txt
make -j $corenumber
make -j $corenumber install
fi
source $PWD/scripts/CreaTools-configure.sh
+
+#EED 2021-11-15
+ source $PWD/scripts/LocalFunctions.sh
+ if [ `getDistrib` == "CentOS" ] && [ `getKernelVersion` < "2.6.34" ]
+ then
+ stdCompiler=c++98
+ else
+ stdCompiler=c++11
+ fi
+
echo "------"
echo $PWD/scripts/CreaTools-configure.sh
## # tar -xvzf gdcm13_2018_05_28_vtk8.tar.gz
## fi
++
++cxxFlags=' '
++if [ $TDx == "ON" ]
++then
++ cxxFlags=$cxxFlags'-F/Library/Frameworks -DVTK_USE_TDX '
++fi
++
++
wget http://www.creatis.insa-lyon.fr/~davila/creatools_back_site/crea_ThirdParty_Libraries/source/gdcm13_2019_06_17_vtk8.zip
unzip gdcm13_2019_06_17_vtk8.zip
- # mv gdcm13_2018_05_28_vtk8 gdcm
-
if [ $buildType = "Debug" ]
then
debug="ON"
cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
++ cmake -D CMAKE_CXX_FLAGS:STRING="$cxxFlags" CMakeCache.txt
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=${stdCompiler} CMakeCache.txt
+
+ #EED 2017-03-24
+ source $PWD/scripts/LocalFunctions.sh
+ if [ `getDistrib` == "CentOS" ] && [ `getKernelVersion` < "2.6.34" ]
+ then
+ cmake -D CMAKE_CXX_FLAGS:STRING=-std=c++98 CMakeCache.txt
+ fi
+
make -j $corenumber
make -j $corenumber install
cd ..
binfolder=$2/creatools_bin/$1Bin
cd $binfolder
+ if [ $OperatingSystem = "MacOS" ]
+ then
+ cmake -D CMAKE_CXX_COMPILER:FILE=/usr/bin/g++
+
+ ## /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
+
+ fi
-cmake -D CMAKE_CXX_FLAGS:STRING=-fPIC -D CMAKE_CXX_FLAGS:STRING=-fopenmp CMakeCache.txt
+TDx=$4
+
+# this line is not working in MacOs
+#cxxFlags='-fPIC -fopenmp '
+cxxFlags='-fPIC '
+
+# TDx is declared in: CreaTools-configure.sh
+if [ "$TDx" == "ON" ]; then
+ cxxFlags=$cxxFlags'-F/Library/Frameworks -DVTK_USE_TDX '
+fi
+
+
+cmake -D CMAKE_CXX_FLAGS:STRING="$cxxFlags" CMakeCache.txt
cmake -D BBTK_DIR:PATH=$currentdir/creatools_bin/bbtkBin CMakeCache.txt
cmake -D crea_DIR:PATH=$currentdir/creatools_bin/creaBin CMakeCache.txt
cmake -D BUILD_BBTK_PACKAGE_creaMaracasVisu:BOOL=ON CMakeCache.txt
# $1 : bbtk
# $2 : generationdir
# $3 : ON/OFF (generate doc) --> Not used
+# $4 : ON/OFF TDx
binfolder=$2/creatools_bin/$1Bin
cd $binfolder
if [[ "$OSTYPE" == "linux-gnu" ]]; then
- cxxFlags='-fPIC'
+ cxxFlags='-fPIC '
+ elif [[ "$OSTYPE" == "darwin" ]]; then
+ cxxFlags='-fPIC -ObjC++C'
fi
-cmake -D CMAKE_CXX_FLAGS:STRING=$cxxFlags -D CREA_BUILD_VTK:BOOL=ON -D CREA_BUILD_WX:BOOL=ON CMakeCache.txt
+TDx=$4
+# TDx is declared in: CreaTools-configure.sh
+if [ "$TDx" == "ON" ]; then
+ cxxFlags=$cxxFlags'-F/Library/Frameworks -DVTK_USE_TDX '
+#Borrame cmake -D VTK_USE_TDX:BOOL=ON CMakeCache.txt
+fi
+
+cmake -D CMAKE_CXX_FLAGS:STRING="$cxxFlags" -D CREA_BUILD_VTK:BOOL=ON -D CREA_BUILD_WX:BOOL=ON CMakeCache.txt
+
cmake CMakeCache.txt
cmake CMakeCache.txt
binfolder=$2/creatools_bin/$1Bin
cd $binfolder
-cmake -D CMAKE_CXX_FLAGS:STRING=-fPIC -fopenmp CMakeCache.txt
+TDx=$4
+#This line es not working in MacOs
+#cxxFlags='-fPIC -fopenmp '
+cxxFlags='-fPIC '
+
+# TDx is declared in: CreaTools-configure.sh
+if [ "$TDx" == "ON" ]; then
+ cxxFlags=$cxxFlags'-F/Library/Frameworks '
+fi
+
-
+cmake -D CMAKE_CXX_FLAGS:STRING="$cxxFlags" CMakeCache.txt
cmake -D BBTK_DIR:PATH=$currentdir/creatools_bin/bbtkBin CMakeCache.txt
cmake -D crea_DIR:PATH=$currentdir/creatools_bin/creaBin CMakeCache.txt
cmake -D BUILD_BBTK_PACKAGE_creaVtk:BOOL=ON CMakeCache.txt