]> Creatis software - creaToolsTools.git/blob - Linux/scripts/CreaTools-compile.sh
Allow user to specify number of cores
[creaToolsTools.git] / Linux / scripts / CreaTools-compile.sh
1 #!/bin/bash
2
3 if [ ! -f $PWD/scripts/CreaTools-configure.sh ]
4 then 
5    echo
6    echo "..ERROR.."
7    echo "==================================================="
8    echo "REMEMBER !"
9    echo ""
10    echo "YOU NEED TO RUN 'Configure' (0) FIRST !"
11    echo "==================================================="
12    echo
13    echo
14    exit 0
15 fi
16
17 # Set all local variables
18  
19  source $PWD/scripts/CreaTools-configure.sh
20  source $PWD/scripts/CreaTools-names.sh
21
22    echo "------"
23    echo $PWD/scripts/CreaTools-configure.sh
24    echo --generationdir--
25    echo $generationdir
26    echo --corenumber--
27    echo $corenumber   
28    echo --docgeneration--
29    echo $docgeneration
30    echo --installPrefix--
31    echo $installPrefix
32    echo --installPrefixThird--
33    echo $installPrefixThird   
34    echo --buildType-- 
35    echo $buildType
36    echo --gdcmVersion--
37    echo $gdcmVersion
38    echo --sourcesFrom--
39    echo $sourcesFrom
40    echo --scriptDir--
41    echo $scriptDir
42    echo --start_point--
43    echo $start_point
44    echo "------"
45
46 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
47 then
48  echo missing  $installPrefixThird/share/creatools_third_party_library_config.sh
49    echo
50    echo "..ERROR.."
51    echo "==================================================="
52    echo "REMEMBER !"
53    echo ""
54    echo "YOU NEED TO RUN 'Install Third Party Libraries' (1) FIRST !"
55    echo "==================================================="
56    echo
57    echo "Hit any key to continue"
58    read a
59    exit 0
60 fi
61
62  if [ ! -e $generationdir/creatools_source ]
63  then 
64  echo missing  $generationdir/creatools_source
65    echo
66    echo "..ERROR.."
67    echo "==================================================="
68    echo "REMEMBER !"
69    echo ""
70    echo "YOU NEED TO RUN 'Load' (2) FIRST !"
71    echo "==================================================="
72    echo
73    echo
74    exit 0
75 fi
76
77
78 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
79 then
80  echo missing  $installPrefixThird/share/creatools_third_party_library_config.sh
81    echo
82    echo "..ERROR.."
83    echo "==================================================="
84    echo "REMEMBER !"
85    echo ""
86    echo "YOU NEED TO RUN 'Load' (2) FIRST !"
87    echo "==================================================="
88    echo
89    echo
90    exit 0
91 fi
92
93  cd $generationdir
94  if [ -e creatools_bin ]
95  then
96     rm -rf creatools_bin
97  fi
98  mkdir creatools_bin
99
100 cd $scriptDir
101
102 # -------------------------
103 #        start_point =  2 : CREA
104 #-------------------------
105 if [ $start_point -le 2 ]
106 then
107 # CREA
108 # the following stupid test is used at debug time; Please don't remove!
109 #if [ true = false ]
110 if [ true = true ]
111 then
112  bash $scriptDir/cmakemod.sh                  $creasource $generationdir $installPrefix $buildType 
113  bash $scriptDir/creaVariables.sh             $creasource $generationdir $docgeneration
114  bash $scriptDir/compilemod.sh     $buildType $creasource $generationdir $corenumber
115  bash $scriptDir/ctestmod.sh                  $creasource $generationdir
116 fi
117 fi
118  creadll=$generationdir/creatools_bin/creaBin
119  LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH
120  export crea_DIR=$generationdir/creatools_bin/creaBin
121
122 # -------------------------
123 #        start_point =  3 : BBTK
124 #-------------------------
125 if [ $start_point -le 3 ]
126 then
127 # the following stupid test is used at debug time; Please don't remove!
128 #if [ true = false ]
129 if [ true = true ]
130 then
131 # BBTK
132 echo ========================================================= $bbtksource $generationdir $installPrefix $buildType
133  bash $scriptDir/cmakemod.sh               $bbtksource $generationdir $installPrefix $buildType
134  bash $scriptDir/bbtkVariables.sh          $bbtksource $generationdir $docgeneration $gdcmVersion
135  bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber
136  bash $scriptDir/ctestmod.sh               $bbtksource $generationdir
137 fi
138 fi
139  bbtkdll=$generationdir/creatools_bin/bbtkBin
140  LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
141  export BBTK_DIR=$generationdir/creatools_bin/bbtkBin
142
143 # -------------------------
144 #        start_point =  4 : creaMaracasVisu
145 #-------------------------
146 if [ $start_point -le 4 ]
147 then
148 # the following stupid test is used at debug time; Please don't remove!
149 #if [ true = false ]
150 if [ true = true ]
151 then
152 # creaMaracasVisu
153  bash $scriptDir/cmakemod.sh              $creamaracassource $generationdir $installPrefix $buildType 
154  bash $scriptDir/creaMaracasVariables.sh  $creamaracassource $generationdir $docgeneration
155  bash $scriptDir/compilemod.sh $buildType $creamaracassource $generationdir $corenumber
156  bash $scriptDir/ctestmod.sh              $creamaracassource $generationdir
157 fi
158 fi
159  creamaracasdll=$generationdir/creatools_bin/creaMaracasVisuBin
160  LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_PATH
161  export creaMaracasVisu_DIR=$generationdir/creatools_bin/creaMaracasVisuBin
162
163 # -------------------------
164 #        start_point =  5 : creaEnvironment
165 #-------------------------
166 if [ $start_point -le 5 ]
167 then
168 # the following stupid test is used at debug time; Please don't remove!
169 #if [ true = false ]
170 if [ true = true ]
171 then
172 # creaEnvironment
173  bash $scriptDir/cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
174  bash $scriptDir/creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
175  bash $scriptDir/compilemod.sh    $buildType $creaenvironmentsource $generationdir $corenumber 
176  bash $scriptDir/ctestmod.sh                 $creaenvironmentsource $generationdir
177 fi
178 fi
179  creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
180  LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_PATH
181  export creaEnvironment_DIR=$generationdir/creatools_bin/creaEnvironmentBin
182
183 # -------------------------
184 #        start_point =  6 : creaBruker
185 #-------------------------
186 if [ $start_point -le 6 ]
187 then
188 # the following stupid test is used at debug time; Please don't remove!
189 #if [ true = false ]
190 if [ true = true ]
191 then
192 # creaBruker
193  bash $scriptDir/cmakemod.sh              $creabrukersource $generationdir $installPrefix $buildType 
194  bash $scriptDir/creaBrukerVariables.sh   $creabrukersource $generationdir $docgeneration $gdcmVersion
195  bash $scriptDir/compilemod.sh $buildType $creabrukersource $generationdir $corenumber
196  bash $scriptDir/ctestmod.sh              $creabrukersource $generationdir
197 fi
198 fi
199  creabrukerdll=$generationdir/creatools_bin/creabrukerBin
200  LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_PATH
201  export creaBruker_DIR=$generationdir/creatools_bin/creaBrukerBin
202
203 # -------------------------
204 #        start_point =  7 : creaImageIO
205 #-------------------------
206 if [ $start_point -le 7 ]
207 then
208  # the following stupid test is used at debug time; Please don't remove!
209 #if [ true = false ]
210 if [ true = true ]
211 then
212 # creaImageIO
213  bash $scriptDir/cmakemod.sh              $creaimagesource $generationdir $installPrefix $buildType 
214  bash $scriptDir/creaImageIOVariables.sh  $creaimagesource $generationdir $docgeneration $gdcmVersion
215  bash $scriptDir/compilemod.sh $buildType $creaimagesource $generationdir $corenumber
216  bash $scriptDir/ctestmod.sh              $creaimagesource $generationdir
217 fi
218 fi
219  creaimagedll=$generationdir/creatools_bin/creaimageBin
220  LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_PATH
221 export creaImageIO_DIR=$generationdir/creatools_bin/creaImageIOBin
222
223 # -------------------------
224 #        start_point =  8 : creaContour
225 #-------------------------
226 if [ $start_point -le 8 ]
227 then
228 # the following stupid test is used at debug time; Please don't remove!
229 #if [ true = false ]
230 if [ true = true ]
231 then
232 # creaContours
233  bash $scriptDir/cmakemod.sh              $creacontourssource $generationdir $installPrefix $buildType 
234  bash $scriptDir/creaContoursVariables.sh $creacontourssource $generationdir $docgeneration
235  bash $scriptDir/compilemod.sh $buildType $creacontourssource $generationdir $corenumber
236  bash $scriptDir/ctestmod.sh              $creacontourssource $generationdir
237 fi
238 fi
239  creacontourdll=$generationdir/creatools_bin/creacontoursBin
240  LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_PATH
241  export creaContours_DIR=$generationdir/creatools_bin/creaContoursBin
242
243 # -------------------------
244 #        start_point =  9 : creaRigidRegistration
245 #-------------------------
246 if [ $start_point -le 9 ]
247 then
248 # the following stupid test is used at debug time; Please don't remove!
249 #if [ true = false ]
250 if [ true = true ]
251 then
252  bash $scriptDir/cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
253  bash $scriptDir/creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
254  bash $scriptDir/compilemod.sh            $buildType $crearigidregistrationssource $generationdir $corenumber
255  bash $scriptDir/ctestmod.sh                         $crearigidregistrationssource $generationdir
256 fi
257 fi
258 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
259 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
260
261
262 # -------------------------
263 #        start_point =  10 : bbtkGEditor
264 #-------------------------
265 if [ $start_point -le 10 ]
266 then
267 # the following stupid test is used at debug time; Please don't remove!
268 #if [ true = false ]
269 if [ true = true ]
270 then
271 # bbtkGEditor
272  bash $scriptDir/cmakemod.sh              $bbtkgeditorsource $generationdir $installPrefix $buildType 
273  bash $scriptDir/bbtkGEditorVariables.sh  $bbtkgeditorsource $generationdir $docgeneration
274  bash $scriptDir/compilemod.sh $buildType $bbtkgeditorsource $generationdir $corenumber
275  bash $scriptDir/ctestmod.sh              $bbtkgeditorsource $generationdir
276 fi
277 fi
278 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
279 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
280
281
282 # -------------------------
283 #        start_point =  11 : creaTools
284 #-------------------------
285 if [ $start_point -le 11 ]
286 then
287 # the following stupid test is used at debug time; Please don't remove!
288 #if [ true = false ]
289 if [ true = true ]
290 then
291 # creaTools
292  bash $scriptDir/cmakemod.sh                $creatoolssource $generationdir $installPrefix $buildType 
293  bash $scriptDir/creaToolsVariables.sh      $creatoolssource $generationdir $docgeneration
294  bash $scriptDir/compilemod.sh   $buildType $creatoolssource $generationdir $corenumber
295 fi
296 fi
297
298
299 # bash ctestmod.sh $creatoolsbinary $generationdir
300 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
301 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
302
303
304 # -------------------------
305 #        start_point =  12 : creaMiniTools
306 #-------------------------
307 if [ $start_point -le 12 ]
308 then
309 # the following stupid test is used at debug time; Please don't remove!
310 #if [ true = false ]
311 if [ true = true ]
312 then
313 # creaMiniTools
314  bash $scriptDir/cmakemod.sh                   $creaminitoolssource $generationdir $installPrefix $buildType 
315  bash $scriptDir/creaMiniToolsVariables.sh     $creaminitoolssource $generationdir $docgeneration
316  bash $scriptDir/compilemod.sh      $buildType $creaminitoolssource $generationdir $corenumber
317 fi
318 fi
319
320
321 # shutdown /s
322 # exit /b