#!/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"
loginGroupName=`groups | awk '{print $1}'`
buildType=Release
gdcmVersion=GDCM1
- ITKVersion=ITK3
+ ITKVersion=ITK4
export ETC_BASHRC=`getbashrc`
+TDx=OFF
function usage {
--- /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
;;
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
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
##
## 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
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
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
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