7 # echo "sh install_thirdparty_all.sh <nameOfTheGenerationDirectory> <installPrefix> <buildType> <OperatingSystem>"
8 # echo "with 'OperatingSystem' in {Fedora, Ubuntu, MacOS}"
9 # echo "with 'installPrefix' : /usr/local or <directory where you want to install>/thirdparty_install
11 # echo "ex : sh install_thirdparty_all.sh /tmp/gendir /tmp/gendir/thirdparty_install Debug Ubuntu"
24 if [ $# = 0 || $# != 4 ]
27 echo "sh install_thirdparty_all.sh <nameOfTheGenerationDirectory> <installPrefix> <buildType> <OperatingSystem>"
28 echo "with 'OperatingSystem' in {Fedora, Ubuntu, MacOS}"
29 echo "with 'installPrefix' : /usr/local or <directory where you want to install>
31 echo "ex : sh install_thirdparty_all.sh /tmp/gendir /tmp/gendir/thirdparty_install Debug Ubuntu"
42 sourcesDir=$generationdir/thirdparty_sources
43 binDir=$generationdir/thirdparty_bin
49 # the following stupid test is used at debug time; Please don't remove!
55 sudo yum install cmake -y
56 sudo yum install cmake-gui -y
57 sudo yum install doxygen -y
58 sudo yum install graphviz -y
59 sudo yum install texlive -y
60 sudo yum install latex2html -y
61 sudo yum install wxGTK-devel wxBase -y
62 sudo yum install boost-devel -y
63 sudo yum install sqlite-devel -y
64 sudo yum install qt-devel -y
65 sudo yum install mesa-libOSMesa-devel -y
68 sudo apt-get --yes install build-essential # esta linea instala las librerias necesarias para compilar en ubuntu, g++ gcc etc etc etc.
69 sudo apt-get --yes install cmake
70 sudo apt-get --yes install cmake-gui
71 sudo apt-get --yes install cmake-curses-gui
72 sudo apt-get --yes install doxygen
73 sudo apt-get --yes install graphviz
74 sudo apt-get --yes install texlive
75 sudo apt-get --yes install latex2html
76 sudo apt-get --yes install libgtk2.0-dev #GTK
77 sudo apt-get --yes install libwxgtk2.8-dev #Wx GTK
78 sudo apt-get --yes install libwxbase2.8-dev #Wx solito
79 sudo apt-get --yes install libboost-dev #Boost
80 sudo apt-get --yes install libboost-all-dev #Boost
81 sudo apt-get --yes install libqt4-dev #QT4
82 sudo apt-get --yes install sqlite
83 sudo apt-get --yes install libosmesa6-dev #Mesa6
84 sudo apt-get --yes install uuid-dev # uuid para la instalacion de itk
85 sudo apt-get --yes install libxaw7-dev # X11
88 echo "MacOS not yet dealt with ..."
92 echo " '$OS' : Unknown (for us...) Operating Sytem "
93 echo " Allowed values are (right now) Fedora, Ubuntu, MacOS "
101 # the following stupid test is used at debug time; Please don't remove!
106 rm -rf $sources/InsightToolkit*
107 rm -rf $sources/gdcm*
109 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/vtk-5.6.1.tar.gz
110 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_08_Dic_2009.tar.gz
111 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
112 tar -xvzf vtk-5.6.1.tar.gz
113 tar -xvzf gdcm_08_Dic_2009.tar.gz
114 tar -xvzf InsightToolkit-3.20.0.tar.gz
119 if [ $buildType = "Debug" ]
130 dirInstall=$binDir/$libname-Bin
131 dirInstallVTK=$dirInstall
134 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
135 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
136 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefix CMakeCache.txt
137 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
146 dirInstall=$binDir/$libname-Bin
149 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
150 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
151 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefix CMakeCache.txt
152 cmake -D VTK_DIR:PATH=$dirInstallVTK CMakeCache.txt
153 cmake -D GDCM_VTK:BOOL=ON -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt
161 libname=InsightToolkit-3.20.0
162 dirInstall=$binDir/$libname-Bin
165 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
166 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
167 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefix CMakeCache.txt
168 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
175 #deal with create creatools_third_party_libraries_config.sh
177 THIRDPARTY_INSTALL_DIR=$installPrefix/thirdparty_install
178 sudo rm $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
180 sudo echo export PATH=$PATH:$THIRDPARTY_INSTALL_DIR/bin >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
181 sudo echo export VTK_DIR=$THIRDPARTY_INSTALL_DIR/lib/vtk-5.6 >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
182 sudo echo export ITK_DIR=$THIRDPARTY_INSTALL_DIR/lib/InsightToolkit >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
183 sudo echo export GDCM_DIR=$THIRDPARTY_INSTALL_DIR/lib/gdcm >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
184 sudo echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GDCM_DIR >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
185 sudo echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ITK_DIR >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
186 sudo echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$VTK_DIR >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
189 # - remove line 'sh $installPrefix/thirdparty_install/share/creatools_third_party_libraries_config.sh' if any (with accurate value for ???)
190 sed -i -e 's/.*creatools_third_party_libraries_config.*/ /g' ~/.bashrc
192 # - add line 'sh $installPrefix/thirdparty_install/share/creatools_third_party_libraries_config.sh' (with accurate value for ???)
193 echo sh $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_libraries_config.sh >> ~/.bashrc