From 9823920ffaede415c7e5ea4bfb8e9d77916620ef Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Wed, 15 Jun 2011 14:24:00 +0000 Subject: [PATCH] split ThirdParty-install.sh into elementary steps (usefull at debug time...) --- .../scripts/ThirdParty-install-Base-Stuff.sh | 109 ++++++++++++++++++ Linux/scripts/ThirdParty-install-Finalize.sh | 73 ++++++++++++ Linux/scripts/ThirdParty-install-ITK.sh | 84 ++++++++++++++ Linux/scripts/ThirdParty-install-VTK.sh | 93 +++++++++++++++ 4 files changed, 359 insertions(+) create mode 100644 Linux/scripts/ThirdParty-install-Base-Stuff.sh create mode 100644 Linux/scripts/ThirdParty-install-Finalize.sh create mode 100644 Linux/scripts/ThirdParty-install-ITK.sh create mode 100644 Linux/scripts/ThirdParty-install-VTK.sh diff --git a/Linux/scripts/ThirdParty-install-Base-Stuff.sh b/Linux/scripts/ThirdParty-install-Base-Stuff.sh new file mode 100644 index 0000000..c2d69a5 --- /dev/null +++ b/Linux/scripts/ThirdParty-install-Base-Stuff.sh @@ -0,0 +1,109 @@ +#!/bin/bash + if [ ! -f $PWD/scripts/CreaTools-configure.sh ] + then + echo + echo "..ERROR.." + echo "===================================================" + echo "REMEMBER !" + echo "" + echo "YOU NEED TO RUN 'Configure' (0) First !" + echo "===================================================" + echo + echo + exit 0 +fi + + +scriptDir=$PWD +sourcesDir=$generationdir/thirdparty_sources +binDir=$generationdir/thirdparty_bin + +if [ ! -e $generationdir ] +then + mkdir $generationdir + chown $loginUserName $generationdir + chgrp $loginGroupName $generationdir + +fi +if [ ! -e $sourcesDir ] +then + mkdir $sourcesDir + #was : (pb on MacOS?) + #chown $loginUserName:$loginGroupName $sourcesDir + chown $loginUserName $sourcesDir + chgrp $loginGroupName $sourcesDir +fi + +if [ ! -e $binDir ] +then + mkdir $binDir + chown $loginUserName $binDir + chgrp $loginGroupName $binDir +fi + +# the following stupid test is used at debug time; Please don't remove! +if [ true = true ] +#if [ true = false ] +then + # ///\TODO what about SuSE? Debian? Mandriva? Gentoo? + case "$OperatingSystem" in + Fedora) + 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 + ;; + Ubuntu) + apt-get --yes install build-essential # esta linea instala las librerias necesarias para compilar en ubuntu, g++ gcc etc etc etc. + apt-get --yes install cmake + apt-get --yes install cmake-gui + apt-get --yes install cmake-curses-gui + apt-get --yes install doxygen + 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 libboost-dev #Boost + apt-get --yes install libboost-all-dev #Boost + apt-get --yes install libqt4-dev #QT4 + apt-get --yes install sqlite + apt-get --yes install libsqlite0-dev + apt-get --yes install libosmesa6-dev #Mesa6 + apt-get --yes install uuid-dev # uuid para la instalacion de itk + apt-get --yes install libxaw7-dev # X11 + ;; + MacOS) + port selfupdate + port install cmake -y + port install doxygen -y + port install graphviz -y + # port install tetex -y (replaced by texlive) # cf EED : http://www.creatis.insa-lyon.fr/site/fr/CreatoolsInstallInstructionsv2.0.1MacOsv10.5.6-Developpers + port install texlive -y + port install latex2html -y + port install wxGTK -y + port install boost -y + ln -s libboost_signals-xgcc40-mt-1_38.dylib libboost_signals.dylib /opt/local/lib # cf EED : http://www.creatis.insa-lyon.fr/site + ln -s libboost_signals-xgcc40-mt-1_38.dylib libboost_signals.dylib /opt/local/lib # cf EED + ln -s libboost_filesystem-xgcc40-mt-1_38.dylib libboost_filesystem.dylib /opt/local/lib # cf EE + ln -s libboost_system-xgcc40-mt-1_38.dylib libboost_system.dylib /opt/local/lib # cf EE + port install sqlite3 -y + port install qt4-mac -y + ln -s qmake-mac qmake /opt/local/bin # cf EED + port install mesa -y + ;; + *) + #echo " '$OperatingSystem' : Unknown (for us...) Operating Sytem " + echo " Allowed values are (right now) Fedora, Ubuntu, MacOS " + exit 0 + ;; + esac +fi diff --git a/Linux/scripts/ThirdParty-install-Finalize.sh b/Linux/scripts/ThirdParty-install-Finalize.sh new file mode 100644 index 0000000..b12af96 --- /dev/null +++ b/Linux/scripts/ThirdParty-install-Finalize.sh @@ -0,0 +1,73 @@ +#!/bin/bash + + if [ ! -f $PWD/scripts/CreaTools-configure.sh ] + then + echo + echo "..ERROR.." + echo "===================================================" + echo "REMEMBER !" + echo "" + echo "YOU NEED TO RUN 'Configure' (0) First !" + echo "===================================================" + echo + echo + exit 0 +fi + +source $PWD/scripts/CreaTools-configure.sh + +#deal with create creatools_third_party_libraries_config.sh + +if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ] +then + rm $installPrefixThird/share/creatools_third_party_library_config.sh +fi + +if [ ! -e $installPrefixThird/share ] +then + mkdir $installPrefixThird/share +fi +touch $installPrefixThird/share/creatools_third_party_library_config.sh +chmod 755 $installPrefixThird/share/creatools_third_party_library_config.sh + +echo export PATH='$'PATH:$installPrefixThird/bin >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo export VTK_DIR=$installPrefixThird/lib/vtk-5.6 >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo export ITK_DIR=$installPrefixThird/lib/InsightToolkit >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo export GDCM_DIR=$installPrefixThird/lib/gdcm >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo export TTH=$installPrefixThird/bin/tth >> $installPrefixThird/share/creatools_third_party_library_config.sh + +if [ $OperatingSystem = "MacOS" ] +then +echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$GDCM_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$ITK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$VTK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh +else +echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$GDCM_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$ITK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh +echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR >> $installPrefixThird/share/creatools_third_party_library_config.sh +fi + + case "$OperatingSystem" in + Fedora) + export ETC_BASHRC=$HOME/.bashrc + ;; + Ubuntu) + export ETC_BASHRC=$HOME/.bashrc + ;; + MacOS) + export ETC_BASHRC=$HOME/.profile + ;; + esac + + sed -i -e '/.*installPrefixThird*/ d' $ETC_BASHRC + sed -i -e '/.*creatools_third_party_library_config.*/ d' $ETC_BASHRC + + +# - add line 'bash $installPrefixThird/share/creatools_third_party_library_config.sh' (with accurate value for ???) +echo installPrefixThird=$installPrefixThird >> $ETC_BASHRC +echo '[ -f "$installPrefixThird/share/creatools_third_party_library_config.sh" ] && source $installPrefixThird/share/creatools_third_party_library_config.sh' >> $ETC_BASHRC + + + +chown -R $loginUserName $generationdir +chgrp -R $loginGroupName $generationdir diff --git a/Linux/scripts/ThirdParty-install-ITK.sh b/Linux/scripts/ThirdParty-install-ITK.sh new file mode 100644 index 0000000..9a8f3e3 --- /dev/null +++ b/Linux/scripts/ThirdParty-install-ITK.sh @@ -0,0 +1,84 @@ +#!/bin/bash + if [ ! -f $PWD/scripts/CreaTools-configure.sh ] + then + echo + echo "..ERROR.." + echo "===================================================" + echo "REMEMBER !" + echo "" + echo "YOU NEED TO RUN 'Configure' (0) First !" + echo "===================================================" + echo + echo + exit 0 +fi + + +scriptDir=$PWD +sourcesDir=$generationdir/thirdparty_sources +binDir=$generationdir/thirdparty_bin + +if [ ! -e $generationdir ] +then + mkdir $generationdir + chown $loginUserName $generationdir + chgrp $loginGroupName $generationdir + +fi +if [ ! -e $sourcesDir ] +then + mkdir $sourcesDir + #was : (pb on MacOS?) + #chown $loginUserName:$loginGroupName $sourcesDir + chown $loginUserName $sourcesDir + chgrp $loginGroupName $sourcesDir +fi + +if [ ! -e $binDir ] +then + mkdir $binDir + chown $loginUserName $binDir + chgrp $loginGroupName $binDir +fi + + echo "we remove old stuff" + rm -rf $sourcesDir/InsightToolkit* + + cd $sourcesDir + + if [ $OperatingSystem = "MacOS" ] + then + curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz # MacOS, clever enough to understand it *has* to uncompress, doesn't understand tar -z :-( + tar -xvf InsightToolkit-3.20.0.tar.gz + else + wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz + fi + +if [ $buildType = "Debug" ] +then + debug="ON" +else + debug="OFF" +fi + +# the following stupid test is used at debug time; Please don't remove! +#if [ true = false ] +if [ true = true ] +then + libname=InsightToolkit-3.20.0 + dirInstall=$binDir/$libname-Bin + export ITK_DIR=$installPrefixThird/lib/InsightToolkit/ + mkdir $dirInstall + cd $dirInstall + cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/ + ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/ + cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt + cmake -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON -D ITK_USE_REVIEW:BOOL=ON 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 + cmake CMakeCache.txt + make -j $corenumber + make install + cd .. +fi + diff --git a/Linux/scripts/ThirdParty-install-VTK.sh b/Linux/scripts/ThirdParty-install-VTK.sh new file mode 100644 index 0000000..5d2bf7e --- /dev/null +++ b/Linux/scripts/ThirdParty-install-VTK.sh @@ -0,0 +1,93 @@ +#!/bin/bash + if [ ! -f $PWD/scripts/CreaTools-configure.sh ] + then + echo + echo "..ERROR.." + echo "===================================================" + echo "REMEMBER !" + echo "" + echo "YOU NEED TO RUN 'Configure' (0) First !" + echo "===================================================" + echo + echo + exit 0 +fi + + +scriptDir=$PWD +sourcesDir=$generationdir/thirdparty_sources +binDir=$generationdir/thirdparty_bin + +if [ ! -e $generationdir ] +then + mkdir $generationdir + chown $loginUserName $generationdir + chgrp $loginGroupName $generationdir + +fi +if [ ! -e $sourcesDir ] +then + mkdir $sourcesDir + #was : (pb on MacOS?) + #chown $loginUserName:$loginGroupName $sourcesDir + chown $loginUserName $sourcesDir + chgrp $loginGroupName $sourcesDir +fi + +if [ ! -e $binDir ] +then + mkdir $binDir + chown $loginUserName $binDir + chgrp $loginGroupName $binDir +fi + + echo "we remove old stuff" + rm -rf $sourcesDir/VTK* + rm -rf $sourcesDir/vtk* + rm -rf $binDir/VTK* + + cd $sourcesDir + + if [ $OperatingSystem = "MacOS" ] + then + curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/VTK-5.6.1.patchCreatis.tar.gz + # MacOS, clever enough to understand it *has* to uncompress, doesn't understand tar -z :-( + tar -xvf VTK-5.6.1.patchCreatis.tar.gz + else + wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/VTK-5.6.1.patchCreatis.tar.gz + fi + +if [ $buildType = "Debug" ] +then + debug="ON" +else + debug="OFF" +fi + +# the following stupid test is used at debug time; Please don't remove! +#if [ true = false ] +if [ true = true ] +then + libname=VTK + dirInstall=$binDir/$libname-Bin + dirInstallVTK=$dirInstall + export VTK_DIR=$installPrefixThird/lib/vtk-5.6/ + mkdir $dirInstall + cd $dirInstall + + cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/ + ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/ + cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt + + if [ $OperatingSystem = "MacOS" ] + then + cmake -D BUILD_SHARE_LIBS:BOOL=ON -D VTK_USE_CARBON:BOOL=ON -D VTK_USE_COCOA:BOOL=OFF CMakeCache.txt + cmake -D VTK_USE_TCL:BOOL=OFF CMakeCache.txt + cmake -D CMAKE_CXX_COMPILER:FILE=/usr/bin/g++ CMakeCache.txt + 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 + make -j $corenumber + make install + cd .. +fi + -- 2.45.1