]> Creatis software - creaToolsTools.git/blob - Linux/scripts/CreaTools-compile.sh
#3445 device TDx Connexion3D
[creaToolsTools.git] / Linux / scripts / CreaTools-compile.sh
1 # ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
4 #                        pour la Santé)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 #
7 #  This software is governed by the CeCILL-B license under French law and 
8 #  abiding by the rules of distribution of free software. You can  use, 
9 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
10 #  license as circulated by CEA, CNRS and INRIA at the following URL 
11 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
12 #  or in the file LICENSE.txt.
13 #
14 #  As a counterpart to the access to the source code and  rights to copy,
15 #  modify and redistribute granted by the license, users are provided only
16 #  with a limited warranty  and the software's author,  the holder of the
17 #  economic rights,  and the successive licensors  have only  limited
18 #  liability. 
19 #
20 #  The fact that you are presently reading this means that you have had
21 #  knowledge of the CeCILL-B license and that you accept its terms.
22 # ------------------------------------------------------------------------  
23
24
25 #!/bin/bash
26
27 if [ ! -f $PWD/scripts/CreaTools-configure.sh ]
28 then 
29    echo
30    echo "..ERROR.."
31    echo "==================================================="
32    echo "REMEMBER !"
33    echo ""
34    echo "YOU NEED TO RUN 'Configure' (0) FIRST !"
35    echo "==================================================="
36    echo
37    echo
38    exit 0
39 fi
40
41 # Set all local variables
42  
43  source $PWD/scripts/CreaTools-configure.sh
44  source $PWD/scripts/CreaTools-names.sh
45
46    echo "------"
47    echo $PWD/scripts/CreaTools-configure.sh
48    echo --generationdir--
49    echo $generationdir
50    echo --corenumber--
51    echo $corenumber   
52    echo --docgeneration--
53    echo $docgeneration
54    echo --installPrefix--
55    echo $installPrefix
56    echo --installPrefixThird--
57    echo $installPrefixThird   
58    echo --buildType-- 
59    echo $buildType
60    echo --gdcmVersion--
61    echo $gdcmVersion
62    echo "--ETC_BASHRC--"
63    echo $ETC_BASHRC
64    echo --sourcesFrom--
65    echo $sourcesFrom
66    echo --scriptDir--
67    echo $scriptDir
68    echo --start_point--
69    echo $start_point
70    echo --TDx--
71    echo $TDx
72    echo "------"
73
74 if [ ! -f $installPrefixThird/share/creatools/creatools_third_party_library_config.sh ]
75 then
76  echo missing  $installPrefixThird/share/creatools/creatools_third_party_library_config.sh
77    echo
78    echo "..ERROR.."
79    echo "==================================================="
80    echo "REMEMBER !"
81    echo ""
82    echo "YOU NEED TO RUN 'Install Third Party Libraries' (1) FIRST !"
83    echo "==================================================="
84    echo
85    echo "Hit any key to continue"
86    read a
87    exit 0
88 fi
89
90  if [ ! -e $generationdir/creatools_source ]
91  then 
92  echo missing  $generationdir/creatools_source
93    echo
94    echo "..ERROR.."
95    echo "==================================================="
96    echo "REMEMBER !"
97    echo ""
98    echo "YOU NEED TO RUN 'Load' (2) FIRST !"
99    echo "==================================================="
100    echo
101    echo
102    exit 0
103 fi
104
105
106 if [ ! -f $installPrefixThird/share/creatools/creatools_third_party_library_config.sh ]
107 then
108  echo missing  $installPrefixThird/share/creatools/creatools_third_party_library_config.sh
109    echo
110    echo "..ERROR.."
111    echo "==================================================="
112    echo "REMEMBER !"
113    echo ""
114    echo "YOU NEED TO RUN 'Load' (2) FIRST !"
115    echo "==================================================="
116    echo
117    echo
118    exit 0
119 fi
120
121  cd $generationdir
122  if [ -e creatools_bin ]
123  then
124     rm -rf creatools_bin
125  fi
126  mkdir -p creatools_bin
127
128 cd $scriptDir
129
130 # -------------------------
131 #        start_point =  2 : CREA
132 #-------------------------
133 if [ $start_point -le 2 ]
134 then
135 # CREA
136 # the following stupid test is used at debug time; Please don't remove!
137 #if [ true = false ]
138    if [ true = true ]
139    then
140
141       bash $scriptDir/cmakemod.sh                  $creasource $generationdir $installPrefix $buildType 
142       bash $scriptDir/creaVariables.sh             $creasource $generationdir $docgeneration $TDx
143       bash $scriptDir/compilemod.sh     $buildType $creasource $generationdir $corenumber
144       bash $scriptDir/ctestmod.sh                  $creasource $generationdir
145    fi
146 fi
147 creadll=$generationdir/creatools_bin/creaBin
148 if [ $OperatingSystem = "MacOS" ]
149 then
150     #duplicate form creaTools_name.sh?? //FCY
151     DYLD_LIBRARY_PATH=$creadll:$DYLD_LIBRARY_$PATH 
152 else
153     LD_LIBRARY_PATH=$creadll:$LD_LIBRARY_$PATH
154 fi
155  export crea_DIR=$generationdir/creatools_bin/creaBin
156
157 # -------------------------
158 #        start_point =  3 : BBTK
159 #-------------------------
160 if [ $start_point -le 3 ]
161 then
162    # the following stupid test is used at debug time; Please don't remove!
163    #if [ true = false ]
164    if [ true = true ]
165    then
166    # BBTK
167      echo ========================================================= $bbtksource $generationdir $installPrefix $buildType
168      bash $scriptDir/cmakemod.sh               $bbtksource $generationdir $installPrefix $buildType
169      bash $scriptDir/bbtkVariables.sh          $bbtksource $generationdir $docgeneration $gdcmVersion $TDx
170      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbtk
171      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbi
172      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbfy
173      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbStudio
174      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbPackageBrowser
175      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbs2cpp
176      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbRegenerateBoxesLists
177      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbRegeneratePackageDoc
178      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbPlugPackage
179      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbpConfigurator
180      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbvtk
181      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbwx
182      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber 
183      bash $scriptDir/ctestmod.sh               $bbtksource $generationdir
184    fi
185 fi
186
187 bbtkdll=$generationdir/creatools_bin/bbtkBin
188 if [ $OperatingSystem = "MacOS" ]
189 then
190     #duplicate form creaTools_name.sh?? //FCY
191     DYLD_LIBRARY_PATH=$bbtkdll:$DYLD_LIBRARY_PATH
192 else
193     LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
194 fi
195 export BBTK_DIR=$generationdir/creatools_bin/bbtkBin
196
197 # -------------------------
198 #        start_point =  4 : creaMaracasVisu
199 #-------------------------
200 if [ $start_point -le 4 ]
201 then
202    # the following stupid test is used at debug time; Please don't remove!
203    #if [ true = false ]
204    if [ true = true ]
205    then
206       # creaMaracasVisu
207       bash $scriptDir/cmakemod.sh              $creamaracassource $generationdir $installPrefix $buildType 
208       bash $scriptDir/creaMaracasVariables.sh  $creamaracassource $generationdir $docgeneration $TDx
209       bash $scriptDir/compilemod.sh $buildType $creamaracassource $generationdir $corenumber
210       bash $scriptDir/ctestmod.sh              $creamaracassource $generationdir
211    fi
212 fi
213  creamaracasdll=$generationdir/creatools_bin/creaMaracasVisuBin
214
215 if [ $OperatingSystem = "MacOS" ]
216 then
217     #duplicate form creaTools_name.sh?? //FCY
218     DYLD_LIBRARY_PATH=$creamaracasdll:$DYLD_LIBRARY_$PATH
219 else
220     LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_$PATH
221 fi 
222  
223  export creaMaracasVisu_DIR=$generationdir/creatools_bin/creaMaracasVisuBin
224
225 # -------------------------
226 #        start_point =  5 : creaEnvironment
227 #-------------------------
228 if [ $start_point -le 5 ]
229 then
230    # the following stupid test is used at debug time; Please don't remove!
231    #if [ true = false ]
232    if [ true = true ]
233    then
234    # creaEnvironment
235       bash $scriptDir/cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
236       bash $scriptDir/creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
237       bash $scriptDir/compilemod.sh    $buildType $creaenvironmentsource $generationdir $corenumber 
238       bash $scriptDir/ctestmod.sh                 $creaenvironmentsource $generationdir
239    fi
240 fi
241 creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
242  
243 if [ $OperatingSystem = "MacOS" ]
244 then
245     #duplicate form creaTools_name.sh?? //FCY
246     DYLD_LIBRARY_PATH=$creaenvironmentdll:$DYLD_LIBRARY_$PATH 
247 else
248     LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_$PATH
249 fi
250
251  export creaEnvironment_DIR=$generationdir/creatools_bin/creaEnvironmentBin
252
253 # -------------------------
254 #        start_point =  6 : creaBruker
255 #-------------------------
256 if [ $start_point -le 6 ]
257 then
258    # the following stupid test is used at debug time; Please don't remove!
259    #if [ true = false ]
260    if [ true = true ]
261    then
262    # creaBruker
263       bash $scriptDir/cmakemod.sh              $creabrukersource $generationdir $installPrefix $buildType 
264       bash $scriptDir/creaBrukerVariables.sh   $creabrukersource $generationdir $docgeneration $gdcmVersion
265       bash $scriptDir/compilemod.sh $buildType $creabrukersource $generationdir $corenumber
266       bash $scriptDir/ctestmod.sh              $creabrukersource $generationdir
267    fi
268 fi
269 creabrukerdll=$generationdir/creatools_bin/creabrukerBin
270  
271 if [ $OperatingSystem = "MacOS" ]
272 then
273     #duplicate form creaTools_name.sh?? //FCY
274     DYLD_LIBRARY_PATH=$creabrukerdll:$DYLD_LIBRARY_$PATH 
275 else
276     LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_$PATH
277 fi 
278  
279  export creaBruker_DIR=$generationdir/creatools_bin/creaBrukerBin
280
281 # -------------------------
282 #        start_point =  7 : creaImageIO
283 #-------------------------
284 if [ $start_point -le 7 ]
285 then
286    # the following stupid test is used at debug time; Please don't remove!
287    #if [ true = false ]
288    if [ true = true ]
289    then
290    # creaImageIO
291       bash $scriptDir/cmakemod.sh              $creaimagesource $generationdir $installPrefix $buildType 
292       bash $scriptDir/creaImageIOVariables.sh  $creaimagesource $generationdir $docgeneration $gdcmVersion $TDx
293       bash $scriptDir/compilemod.sh $buildType $creaimagesource $generationdir $corenumber
294       bash $scriptDir/ctestmod.sh              $creaimagesource $generationdir
295    fi
296 fi
297 creaimagedll=$generationdir/creatools_bin/creaimageBin
298  
299 if [ $OperatingSystem = "MacOS" ]
300 then
301     #duplicate form creaTools_name.sh?? //FCY
302     DYLD_LIBRARY_PATH=$creaimagedll:$DYLD_LIBRARY_$PATH 
303 else
304     LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_$PATH
305 fi
306
307 export creaImageIO_DIR=$generationdir/creatools_bin/creaImageIOBin
308
309 # -------------------------
310 #        start_point =  8 : creaContour
311 #-------------------------
312 if [ $start_point -le 8 ]
313 then
314    # the following stupid test is used at debug time; Please don't remove!
315    #if [ true = false ]
316    if [ true = true ]
317    then
318       # creaContours
319       bash $scriptDir/cmakemod.sh              $creacontourssource $generationdir $installPrefix $buildType 
320       bash $scriptDir/creaContoursVariables.sh $creacontourssource $generationdir $docgeneration $TDx
321       bash $scriptDir/compilemod.sh $buildType $creacontourssource $generationdir $corenumber
322       bash $scriptDir/ctestmod.sh              $creacontourssource $generationdir
323    fi
324 fi
325  creacontourdll=$generationdir/creatools_bin/creacontoursBin
326  
327 if [ $OperatingSystem = "MacOS" ]
328 then
329     #duplicate form creaTools_name.sh?? //FCY
330     DYLD_LIBRARY_PATH=$creacontoursdll:$DYLD_LIBRARY_$PATH 
331 else
332     LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_$PATH
333 fi
334
335  export creaContours_DIR=$generationdir/creatools_bin/creaContoursBin
336
337 # -------------------------
338 #        start_point =  9 : creaRigidRegistration
339 #-------------------------
340 if [ $start_point -le 9 ]
341 then
342    # the following stupid test is used at debug time; Please don't remove!
343    #if [ true = false ]
344    if [ true = true ]
345    then
346       bash $scriptDir/cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
347       bash $scriptDir/creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration $TDx
348       bash $scriptDir/compilemod.sh            $buildType $crearigidregistrationssource $generationdir $corenumber
349       bash $scriptDir/ctestmod.sh                         $crearigidregistrationssource $generationdir
350    fi
351 fi
352 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
353 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
354
355
356 # -------------------------
357 #        start_point =  10 : bbtkGEditor
358 #-------------------------
359 if [ $start_point -le 10 ]
360 then
361    # the following stupid test is used at debug time; Please don't remove!
362    #if [ true = false ]
363    if [ true = true ]
364    then
365       # bbtkGEditor
366       bash $scriptDir/cmakemod.sh              $bbtkgeditorsource $generationdir $installPrefix $buildType 
367       bash $scriptDir/bbtkGEditorVariables.sh  $bbtkgeditorsource $generationdir $docgeneration $TDx
368       bash $scriptDir/compilemod.sh $buildType $bbtkgeditorsource $generationdir $corenumber
369       bash $scriptDir/ctestmod.sh              $bbtkgeditorsource $generationdir
370    fi
371 fi
372 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
373 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
374
375
376 # -------------------------
377 #        start_point =  11 : libido
378 #-------------------------
379 #if [ $start_point -le 11 ]
380 #then
381    ## the following stupid test is used at debug time; Please don't remove!
382    ##if [ true = false ]
383    #if [ true = true ]
384    #then
385       ## creaTools
386       # bash $scriptDir/cmakemod.sh                $libidosource $generationdir $installPrefix $buildType 
387       # bash $scriptDir/libidoVariables.sh         $libidosource $generationdir $docgeneration
388       # bash $scriptDir/compilemod.sh   $buildType $libidosource $generationdir $corenumber
389    #fi
390 #fi
391
392
393
394 # -------------------------
395 #        start_point =  12 : creaTools
396 #-------------------------
397 if [ $start_point -le 12 ]
398 then
399    # the following stupid test is used at debug time; Please don't remove!
400    #if [ true = false ]
401    if [ true = true ]
402    then
403       # creaTools
404       bash $scriptDir/cmakemod.sh                $creatoolssource $generationdir $installPrefix $buildType 
405       bash $scriptDir/creaToolsVariables.sh      $creatoolssource $generationdir $docgeneration
406       bash $scriptDir/compilemod.sh   $buildType $creatoolssource $generationdir $corenumber
407    fi
408 fi
409
410
411 # bash ctestmod.sh $creatoolsbinary $generationdir
412 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
413 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
414
415
416 # -------------------------
417 #        start_point =  13 : creaMiniTools
418 #-------------------------
419 if [ $start_point -le 13 ]
420 then
421    # the following stupid test is used at debug time; Please don't remove!
422    #if [ true = false ]
423    if [ true = true ]
424    then
425       # creaMiniTools
426       bash $scriptDir/cmakemod.sh                   $creaminitoolssource $generationdir $installPrefix $buildType 
427       bash $scriptDir/creaMiniToolsVariables.sh     $creaminitoolssource $generationdir $docgeneration
428       bash $scriptDir/compilemod.sh      $buildType $creaminitoolssource $generationdir $corenumber
429    fi
430 fi
431
432
433 # -------------------------
434 #        start_point =  14 : creaVtk
435 #-------------------------
436 if [ $start_point -le 14 ]
437 then
438    # the following stupid test is used at debug time; Please don't remove!
439    #if [ true = false ]
440    if [ true = true ]
441    then
442       # creaVtk
443       bash $scriptDir/cmakemod.sh              $creavtksource $generationdir $installPrefix $buildType 
444       bash $scriptDir/creaVtkVariables.sh  $creavtksource $generationdir $docgeneration  $TDx
445       bash $scriptDir/compilemod.sh $buildType $creavtksource $generationdir $corenumber
446       bash $scriptDir/ctestmod.sh              $creavtksource $generationdir
447    fi
448 fi
449  creavtkdll=$generationdir/creatools_bin/creaVtkBin
450
451 if [ $OperatingSystem = "MacOS" ]
452 then
453     #duplicate form creaTools_name.sh?? //FCY
454     DYLD_LIBRARY_PATH=$creavtkdll:$DYLD_LIBRARY_$PATH
455 else
456     LD_LIBRARY_PATH=$creavtkdll:$LD_LIBRARY_$PATH
457 fi 
458  
459  export creaVtk_DIR=$generationdir/creatools_bin/creaVtkBin
460
461
462
463
464 # shutdown /s
465 # exit /b