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"
45 sourcesDir=$generationdir/thirdparty_sources
46 binDir=$generationdir/thirdparty_bin
53 sudo rm $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
58 # the following stupid test is used at debug time; Please don't remove!
64 sudo yum install cmake -y
65 sudo yum install cmake-gui -y
66 sudo yum install doxygen -y
67 sudo yum install graphviz -y
68 sudo yum install texlive -y
69 sudo yum install latex2html -y
70 sudo yum install wxGTK-devel wxBase -y
71 sudo yum install boost-devel -y
72 sudo yum install sqlite-devel -y
73 sudo yum install qt-devel -y
74 sudo yum install mesa-libOSMesa-devel -y
77 sudo apt-get --yes install build-essential # esta linea instala las librerias necesarias para compilar en ubuntu, g++ gcc etc etc etc.
78 sudo apt-get --yes install cmake
79 sudo apt-get --yes install cmake-gui
80 sudo apt-get --yes install cmake-curses-gui
81 sudo apt-get --yes install doxygen
82 sudo apt-get --yes install graphviz
83 sudo apt-get --yes install texlive
84 sudo apt-get --yes install latex2html
85 sudo apt-get --yes install libgtk2.0-dev #GTK
86 sudo apt-get --yes install libwxgtk2.8-dev #Wx GTK
87 sudo apt-get --yes install libwxbase2.8-dev #Wx solito
88 sudo apt-get --yes install libboost-dev #Boost
89 sudo apt-get --yes install libboost-all-dev #Boost
90 sudo apt-get --yes install libqt4-dev #QT4
91 sudo apt-get --yes install sqlite
92 sudo apt-get --yes install libsqlite0-dev
93 sudo apt-get --yes install libosmesa6-dev #Mesa6
94 sudo apt-get --yes install uuid-dev # uuid para la instalacion de itk
95 sudo apt-get --yes install libxaw7-dev # X11
98 # QUESTION : is -y mandatory?
100 sudo port install cmake -y
101 sudo port install cmake-gui -y
102 sudo port install doxygen -y
103 sudo port install graphviz -y
104 sudo port install texlive -y
105 sudo port install latex2html -y
106 sudo port install wxGTK-devel wxBase -y
107 sudo port install boost-devel -y
108 sudo port install sqlite-devel -y
109 sudo port install qt-devel -y
110 sudo port install mesa-libOSMesa-devel -y
113 #echo " '$OS' : Unknown (for us...) Operating Sytem "
114 echo " Allowed values are (right now) Fedora, Ubuntu, MacOS "
122 # the following stupid test is used at debug time; Please don't remove!
127 rm -rf $sources/InsightToolkit*
128 rm -rf $sources/gdcm*
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 tar -xvzf vtk-5.6.1.tar.gz
134 tar -xvzf gdcm_08_Dic_2009.tar.gz
135 tar -xvzf InsightToolkit-3.20.0.tar.gz
140 if [ $buildType = "Debug" ]
151 dirInstall=$binDir/$libname-Bin
152 dirInstallVTK=$dirInstall
155 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
156 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
157 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefix CMakeCache.txt
158 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
167 dirInstall=$binDir/$libname-Bin
170 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
171 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
172 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefix CMakeCache.txt
173 cmake -D VTK_DIR:PATH=$dirInstallVTK CMakeCache.txt
174 cmake -D GDCM_VTK:BOOL=ON -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt
182 libname=InsightToolkit-3.20.0
183 dirInstall=$binDir/$libname-Bin
186 cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
187 ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
188 cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefix CMakeCache.txt
189 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
196 #deal with create creatools_third_party_libraries_config.sh
198 sudo touch $installPrefix/share/creatools_third_party_library_config.sh
199 sudo chmod 666 $installPrefix/share/creatools_third_party_library_config.sh
201 sudo echo export PATH='$'PATH:$THIRDPARTY_INSTALL_DIR/bin >> $installPrefix/share/creatools_third_party_library_config.sh
202 sudo echo export VTK_DIR=$THIRDPARTY_INSTALL_DIR/lib/vtk-5.6 >> $installPrefix/share/creatools_third_party_library_config.sh
203 sudo echo export ITK_DIR=$THIRDPARTY_INSTALL_DIR/lib/InsightToolkit >> $installPrefix/share/creatools_third_party_library_config.sh
204 sudo echo export GDCM_DIR=$THIRDPARTY_INSTALL_DIR/lib/gdcm >> $installPrefix/share/creatools_third_party_library_config.sh
205 sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$GDCM_DIR >> $installPrefix/share/creatools_third_party_library_config.sh
206 sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$ITK_DIR >> $installPrefix/share/creatools_third_party_library_config.sh
207 sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR >> $installPrefix/share/creatools_third_party_library_config.sh
210 # - remove line 'sh $installPrefix/share/creatools_third_party_library_config.sh' if any (with accurate value for ???)
211 sed -i -e '/.*creatools_third_party_library_config.*/ d' ~/.bashrc
213 # - add line 'sh $installPrefix/share/creatools_third_party_library_config.sh' (with accurate value for ???)
214 echo source $installPrefix/share/creatools_third_party_library_config.sh >> ~/.bashrc