From: Eduardo DAVILA Date: Wed, 1 Dec 2021 21:42:01 +0000 (+0100) Subject: #3446 vtk8itk5wx3-macos in Linux X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=6320e5eeb3a49e2fec039cfa4040bee15a18899c;p=creaToolsTools.git #3446 vtk8itk5wx3-macos in Linux --- 6320e5eeb3a49e2fec039cfa4040bee15a18899c diff --cc Linux/installscript index b61cd9f,cac6ea6..70923a2 --- a/Linux/installscript +++ b/Linux/installscript @@@ -23,23 -23,16 +23,37 @@@ #!/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" @@@ -58,9 -53,8 +73,9 @@@ loginUserName=$USE loginGroupName=`groups | awk '{print $1}'` buildType=Release gdcmVersion=GDCM1 - ITKVersion=ITK3 + ITKVersion=ITK4 export ETC_BASHRC=`getbashrc` +TDx=OFF function usage { diff --cc Linux/scripts/CreaTools-configure.sh index 0000000,bce150b..804697b mode 000000,100644..100644 --- a/Linux/scripts/CreaTools-configure.sh +++ b/Linux/scripts/CreaTools-configure.sh @@@ -1,0 -1,19 +1,20 @@@ + #!/bin/bash + + #File generated by 'installscript' + #DO NOT edit ! + #(except if you *do* know what you do) + -OperatingSystem=Fedora -corenumber=6 -generationdir=/home/davila/Creatis/C11 -installPrefix=/home/davila/Creatis/C11/ci -installPrefixThird=/home/davila/Creatis/C11/tpli ++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 -loginGroupName=davila ++loginGroupName=staff + buildType=Release + gdcmVersion=GDCM1 + ITKVersion=ITK4 -ETC_BASHRC=/home/davila/.bashrc ++ETC_BASHRC=/Users/davila/.bashrc ++TDx=ON diff --cc Linux/scripts/ThirdParty-install-Base-rpm.sh index f247a06,71af642..56c72bc --- a/Linux/scripts/ThirdParty-install-Base-rpm.sh +++ b/Linux/scripts/ThirdParty-install-Base-rpm.sh @@@ -148,10 -154,6 +154,11 @@@ the ;; 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 diff --cc Linux/scripts/ThirdParty-install-ITK.sh index 19edf30,ebb6638..b35b8bf --- a/Linux/scripts/ThirdParty-install-ITK.sh +++ b/Linux/scripts/ThirdParty-install-ITK.sh @@@ -174,23 -176,28 +174,24 @@@ the 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 diff --cc Linux/scripts/ThirdParty-install-VTK.sh index 7cabb28,a8ad7f4..f15de63 --- a/Linux/scripts/ThirdParty-install-VTK.sh +++ b/Linux/scripts/ThirdParty-install-VTK.sh @@@ -151,11 -150,9 +150,27 @@@ f ## ## 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 @@@ -207,8 -204,8 +222,7 @@@ #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/ @@@ -218,14 -215,13 +232,16 @@@ 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" ] @@@ -233,13 -229,11 +249,12 @@@ 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 diff --cc Linux/scripts/ThirdParty-install-gdcm.sh index b0ecff7,12265a6..fb97632 --- a/Linux/scripts/ThirdParty-install-gdcm.sh +++ b/Linux/scripts/ThirdParty-install-gdcm.sh @@@ -39,15 -39,7 +39,16 @@@ 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 @@@ -123,6 -115,6 +124,14 @@@ f ## # 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 @@@ -147,6 -137,6 +154,7 @@@ the 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 diff --cc Linux/scripts/creaMaracasVariables.sh index 5e3b824,5156a7d..b216412 --- a/Linux/scripts/creaMaracasVariables.sh +++ b/Linux/scripts/creaMaracasVariables.sh @@@ -32,20 -32,15 +32,27 @@@ currentdir=$ 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 diff --cc Linux/scripts/creaVariables.sh index e755593,0f34967..932b660 --- a/Linux/scripts/creaVariables.sh +++ b/Linux/scripts/creaVariables.sh @@@ -34,17 -33,13 +34,20 @@@ cd $binfolde if [[ "$OSTYPE" == "linux-gnu" ]]; then - cxxFlags='-fPIC' + cxxFlags='-fPIC ' + elif [[ "$OSTYPE" == "darwin" ]]; then + cxxFlags='-fPIC -ObjC++C' fi +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 -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 diff --cc Linux/scripts/creaVtkVariables.sh index 25e647e,a03f86d..66387ba --- a/Linux/scripts/creaVtkVariables.sh +++ b/Linux/scripts/creaVtkVariables.sh @@@ -32,18 -32,7 +32,17 @@@ currentdir=$ 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