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"
26 if [ $# = 0 || $# != 4 ]
29 echo "sh install_thirdparty_all.sh <nameOfTheGenerationDirectory> <installPrefix> <buildType> <OperatingSystem>"
30 echo "with 'OperatingSystem' in {Fedora, Ubuntu, MacOS}"
31 echo "with 'installPrefix' : /usr/local or <directory where you want to install> "
33 echo "ex : sh install_thirdparty_all.sh /tmp/gendir /tmp/gendir/thirdparty_install Debug Ubuntu"
44 sourcesDir=$generationdir/thirdparty_sources
45 binDir=$generationdir/thirdparty_bin
52 rm $installPrefix/share/creatools_third_party_library_config.sh
57 # the following stupid test is used at debug time; Please don't remove!
64 yum install cmake-gui -y
65 yum install doxygen -y
66 yum install graphviz -y
67 yum install texlive -y
68 yum install latex2html -y
69 yum install wxGTK-devel wxBase -y
70 yum install boost-devel -y
71 yum install sqlite-devel -y
72 yum install qt-devel -y
73 yum install mesa-libOSMesa-devel -y
76 apt-get --yes install build-essential # esta linea instala las librerias necesarias para compilar en ubuntu, g++ gcc etc etc etc.
77 apt-get --yes install cmake
78 apt-get --yes install cmake-gui
79 apt-get --yes install cmake-curses-gui
80 apt-get --yes install doxygen
81 apt-get --yes install graphviz
82 apt-get --yes install texlive
83 apt-get --yes install latex2html
84 apt-get --yes install libgtk2.0-dev #GTK
85 apt-get --yes install libwxgtk2.8-dev #Wx GTK
86 apt-get --yes install libwxbase2.8-dev #Wx solito
87 apt-get --yes install libboost-dev #Boost
88 apt-get --yes install libboost-all-dev #Boost
89 apt-get --yes install libqt4-dev #QT4
90 apt-get --yes install sqlite
91 apt-get --yes install libsqlite0-dev
92 apt-get --yes install libosmesa6-dev #Mesa6
93 apt-get --yes install uuid-dev # uuid para la instalacion de itk
94 apt-get --yes install libxaw7-dev # X11
97 # QUESTION : is -y mandatory?
100 port install cmake-gui -y
101 port install doxygen -y
102 port install graphviz -y
103 port install texlive -y
104 port install latex2html -y
105 port install wxGTK-devel wxBase -y
106 port install boost-devel -y
107 port install sqlite-devel -y
108 port install qt-devel -y
109 port install mesa-libOSMesa-devel -y
112 #echo " '$OS' : Unknown (for us...) Operating Sytem "
113 echo " Allowed values are (right now) Fedora, Ubuntu, MacOS "
121 # the following stupid test is used at debug time; Please don't remove!
124 rm -rf $sourcesDir/VTK*
125 rm -rf $sourcesDir/vtk*
126 rm -rf $sourcesDir/InsightToolkit*
127 rm -rf $sourcesDir/gdcm*
128 rm -rf $sourcesDir/tth*
130 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/vtk-5.6.1.tar.gz
131 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_08_Dic_2009.tar.gz
132 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
133 wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_Developer_Tools/All_Versions/tth/tth_linux/tth
135 tar -xvzf vtk-5.6.1.tar.gz
136 tar -xvzf gdcm_08_Dic_2009.tar.gz
137 tar -xvzf InsightToolkit-3.20.0.tar.gz
142 if [ $buildType = "Debug" ]
153 dirInstall=$binDir/$libname-Bin
154 dirInstallVTK=$dirInstall
155 VTK_DIR=$installPrefix/lib/vtk-5.6/
157 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
158 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
159 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefix CMakeCache.txt
160 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
169 dirInstall=$binDir/$libname-Bin
170 GDCM_DIR=$installPrefix/lib/gdcm/
173 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
174 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
175 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefix CMakeCache.txt
176 cmake -D VTK_DIR:PATH=$dirInstallVTK CMakeCache.txt
177 cmake -D GDCM_VTK:BOOL=ON -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt
185 libname=InsightToolkit-3.20.0
186 dirInstall=$binDir/$libname-Bin
187 ITK_DIR=$installPrefix/lib/InsightToolkit/
190 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
191 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
192 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefix CMakeCache.txt
193 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
204 cp tth $installPrefix/bin
207 #deal with create creatools_third_party_libraries_config.sh
209 touch $installPrefix/share/creatools_third_party_library_config.sh
210 chmod 666 $installPrefix/share/creatools_third_party_library_config.sh
212 echo export PATH='$'PATH:$installPrefix/bin >> $installPrefix/share/creatools_third_party_library_config.sh
213 echo export VTK_DIR=$installPrefix/lib/vtk-5.6 >> $installPrefix/share/creatools_third_party_library_config.sh
214 echo export ITK_DIR=$installPrefix/lib/InsightToolkit >> $installPrefix/share/creatools_third_party_library_config.sh
215 echo export GDCM_DIR=$installPrefix/lib/gdcm >> $installPrefix/share/creatools_third_party_library_config.sh
216 echo export TTH=$installPrefix/bin/tth >> $installPrefix/share/creatools_third_party_library_config.sh
217 echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$GDCM_DIR >> $installPrefix/share/creatools_third_party_library_config.sh
218 echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$ITK_DIR >> $installPrefix/share/creatools_third_party_library_config.sh
219 echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR >> $installPrefix/share/creatools_third_party_library_config.sh
222 # - remove line 'sh $installPrefix/share/creatools_third_party_library_config.sh' if any (with accurate value for ???)
223 sed -i -e '/.*creatools_third_party_library_config.*/ d' /etc/bashrc
225 # - add line 'sh $installPrefix/share/creatools_third_party_library_config.sh' (with accurate value for ???)
226 echo source $installPrefix/share/creatools_third_party_library_config.sh >> /etc/bashrc