]> Creatis software - creaToolsTools.git/commitdiff
#3446 vtk8itk5wx3-macos in Linux
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 1 Dec 2021 21:42:01 +0000 (22:42 +0100)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 1 Dec 2021 21:42:01 +0000 (22:42 +0100)
1  2 
Linux/installscript
Linux/scripts/CreaTools-configure.sh
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
Linux/scripts/creaMaracasVariables.sh
Linux/scripts/creaVariables.sh
Linux/scripts/creaVtkVariables.sh

index b61cd9f980eea7992f4a7f9959081062f01fecb4,cac6ea6760b1a861e9846e8eaa67631ce9627d4e..70923a20445dc8c083870434eadfcf40107db897
  
  #!/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 {
index 0000000000000000000000000000000000000000,bce150b87b54dcefba718b19f7075012e1721a62..804697bf4fe2b61913d74658723fde39c135d1e7
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,19 +1,20 @@@
 -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
Simple merge
index f247a065b5dd1e5dd15127bd59955073603d131d,71af642fe966d8134d792a56d9f1473a54c7f882..56c72bcaf5aeae2003d861206f30629b316036a4
@@@ -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
index 19edf304d4d87533c10d315b513e2c7d8a2a3a9d,ebb66383d13752271206c3bd4085370e7e8d3aa0..b35b8bfe30742aa9a44e1b84964fb9e36ca25c39
@@@ -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
index 7cabb283b52b2b9d16e2004f79157ee33854e25c,a8ad7f4f1e97941de90efa932e290b25234af419..f15de634604fabd8102c445af805dbb98c7e0746
  ## 
  ##  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
index b0ecff749141cbfca83309b68451d3930c8b63ce,12265a6dd987a684d088562b1f0819c35be5b65a..fb97632963a0e26a12a7f8ca75508c52596fe72c
  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
index 5e3b8247165eea368deea3f454c8b3c38c6300e7,5156a7de467e05661daba5b9b2463294a1a5a22c..b21641218247fbcc3e1fcee3b91ac105692ca970
@@@ -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
index e755593d703f0d8b9b0e9dce522ef7638383d1e4,0f349678ff5ba0738a6e2de6a5f8f2858b02aac9..932b660113395bc9b6f0642db1c3c312c2b77ea7
@@@ -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
  
 -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
  
index 25e647eaf0a4db359e3dbeec593df8eae557a4ee,a03f86d9e20f0add11bfd4c840bd267001632fa5..66387ba377ce3f22040bed381a20c36520e6b7cb
@@@ -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