]> Creatis software - creaToolsTools.git/blob - Linux/scripts/CreaTools-compile.sh
2411 creaToolsTools Feature New Normal Add creaVtk Library in Linux version
[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 "------"
71
72 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
73 then
74  echo missing  $installPrefixThird/share/creatools_third_party_library_config.sh
75    echo
76    echo "..ERROR.."
77    echo "==================================================="
78    echo "REMEMBER !"
79    echo ""
80    echo "YOU NEED TO RUN 'Install Third Party Libraries' (1) FIRST !"
81    echo "==================================================="
82    echo
83    echo "Hit any key to continue"
84    read a
85    exit 0
86 fi
87
88  if [ ! -e $generationdir/creatools_source ]
89  then 
90  echo missing  $generationdir/creatools_source
91    echo
92    echo "..ERROR.."
93    echo "==================================================="
94    echo "REMEMBER !"
95    echo ""
96    echo "YOU NEED TO RUN 'Load' (2) FIRST !"
97    echo "==================================================="
98    echo
99    echo
100    exit 0
101 fi
102
103
104 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
105 then
106  echo missing  $installPrefixThird/share/creatools_third_party_library_config.sh
107    echo
108    echo "..ERROR.."
109    echo "==================================================="
110    echo "REMEMBER !"
111    echo ""
112    echo "YOU NEED TO RUN 'Load' (2) FIRST !"
113    echo "==================================================="
114    echo
115    echo
116    exit 0
117 fi
118
119  cd $generationdir
120  if [ -e creatools_bin ]
121  then
122     rm -rf creatools_bin
123  fi
124  mkdir creatools_bin
125
126 cd $scriptDir
127
128 # -------------------------
129 #        start_point =  2 : CREA
130 #-------------------------
131 if [ $start_point -le 2 ]
132 then
133 # CREA
134 # the following stupid test is used at debug time; Please don't remove!
135 #if [ true = false ]
136    if [ true = true ]
137    then
138       bash $scriptDir/cmakemod.sh                  $creasource $generationdir $installPrefix $buildType 
139       bash $scriptDir/creaVariables.sh             $creasource $generationdir $docgeneration
140       bash $scriptDir/compilemod.sh     $buildType $creasource $generationdir $corenumber
141       bash $scriptDir/ctestmod.sh                  $creasource $generationdir
142    fi
143 fi
144 creadll=$generationdir/creatools_bin/creaBin
145 if [ $OperatingSystem = "MacOS" ]
146 then
147     #duplicate form creaTools_name.sh?? //FCY
148     DYLD_LIBRARY_PATH=$creadll:$DYLD_LIBRARY_$PATH 
149 else
150     LD_LIBRARY_PATH=$creadll:$LD_LIBRARY_$PATH
151 fi
152  export crea_DIR=$generationdir/creatools_bin/creaBin
153
154 # -------------------------
155 #        start_point =  3 : BBTK
156 #-------------------------
157 if [ $start_point -le 3 ]
158 then
159    # the following stupid test is used at debug time; Please don't remove!
160    #if [ true = false ]
161    if [ true = true ]
162    then
163    # BBTK
164      echo ========================================================= $bbtksource $generationdir $installPrefix $buildType
165      bash $scriptDir/cmakemod.sh               $bbtksource $generationdir $installPrefix $buildType
166      bash $scriptDir/bbtkVariables.sh          $bbtksource $generationdir $docgeneration $gdcmVersion
167      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber
168      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber
169      bash $scriptDir/ctestmod.sh               $bbtksource $generationdir
170    fi
171 fi
172
173 bbtkdll=$generationdir/creatools_bin/bbtkBin
174 if [ $OperatingSystem = "MacOS" ]
175 then
176     #duplicate form creaTools_name.sh?? //FCY
177     DYLD_LIBRARY_PATH=$bbtkdll:$DYLD_LIBRARY_PATH
178 else
179     LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
180 fi
181 export BBTK_DIR=$generationdir/creatools_bin/bbtkBin
182
183 # -------------------------
184 #        start_point =  4 : creaMaracasVisu
185 #-------------------------
186 if [ $start_point -le 4 ]
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       # creaMaracasVisu
193       bash $scriptDir/cmakemod.sh              $creamaracassource $generationdir $installPrefix $buildType 
194       bash $scriptDir/creaMaracasVariables.sh  $creamaracassource $generationdir $docgeneration
195       bash $scriptDir/compilemod.sh $buildType $creamaracassource $generationdir $corenumber
196       bash $scriptDir/ctestmod.sh              $creamaracassource $generationdir
197    fi
198 fi
199  creamaracasdll=$generationdir/creatools_bin/creaMaracasVisuBin
200
201 if [ $OperatingSystem = "MacOS" ]
202 then
203     #duplicate form creaTools_name.sh?? //FCY
204     DYLD_LIBRARY_PATH=$creamaracasdll:$DYLD_LIBRARY_$PATH
205 else
206     LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_$PATH
207 fi 
208  
209  export creaMaracasVisu_DIR=$generationdir/creatools_bin/creaMaracasVisuBin
210
211 # -------------------------
212 #        start_point =  5 : creaEnvironment
213 #-------------------------
214 if [ $start_point -le 5 ]
215 then
216    # the following stupid test is used at debug time; Please don't remove!
217    #if [ true = false ]
218    if [ true = true ]
219    then
220    # creaEnvironment
221       bash $scriptDir/cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
222       bash $scriptDir/creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
223       bash $scriptDir/compilemod.sh    $buildType $creaenvironmentsource $generationdir $corenumber 
224       bash $scriptDir/ctestmod.sh                 $creaenvironmentsource $generationdir
225    fi
226 fi
227 creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
228  
229 if [ $OperatingSystem = "MacOS" ]
230 then
231     #duplicate form creaTools_name.sh?? //FCY
232     DYLD_LIBRARY_PATH=$creaenvironmentdll:$DYLD_LIBRARY_$PATH 
233 else
234     LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_$PATH
235 fi
236
237  export creaEnvironment_DIR=$generationdir/creatools_bin/creaEnvironmentBin
238
239 # -------------------------
240 #        start_point =  6 : creaBruker
241 #-------------------------
242 if [ $start_point -le 6 ]
243 then
244    # the following stupid test is used at debug time; Please don't remove!
245    #if [ true = false ]
246    if [ true = true ]
247    then
248    # creaBruker
249       bash $scriptDir/cmakemod.sh              $creabrukersource $generationdir $installPrefix $buildType 
250       bash $scriptDir/creaBrukerVariables.sh   $creabrukersource $generationdir $docgeneration $gdcmVersion
251       bash $scriptDir/compilemod.sh $buildType $creabrukersource $generationdir $corenumber
252       bash $scriptDir/ctestmod.sh              $creabrukersource $generationdir
253    fi
254 fi
255 creabrukerdll=$generationdir/creatools_bin/creabrukerBin
256  
257 if [ $OperatingSystem = "MacOS" ]
258 then
259     #duplicate form creaTools_name.sh?? //FCY
260     DYLD_LIBRARY_PATH=$creabrukerdll:$DYLD_LIBRARY_$PATH 
261 else
262     LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_$PATH
263 fi 
264  
265  export creaBruker_DIR=$generationdir/creatools_bin/creaBrukerBin
266
267 # -------------------------
268 #        start_point =  7 : creaImageIO
269 #-------------------------
270 if [ $start_point -le 7 ]
271 then
272    # the following stupid test is used at debug time; Please don't remove!
273    #if [ true = false ]
274    if [ true = true ]
275    then
276    # creaImageIO
277       bash $scriptDir/cmakemod.sh              $creaimagesource $generationdir $installPrefix $buildType 
278       bash $scriptDir/creaImageIOVariables.sh  $creaimagesource $generationdir $docgeneration $gdcmVersion
279       bash $scriptDir/compilemod.sh $buildType $creaimagesource $generationdir $corenumber
280       bash $scriptDir/ctestmod.sh              $creaimagesource $generationdir
281    fi
282 fi
283 creaimagedll=$generationdir/creatools_bin/creaimageBin
284  
285 if [ $OperatingSystem = "MacOS" ]
286 then
287     #duplicate form creaTools_name.sh?? //FCY
288     DYLD_LIBRARY_PATH=$creaimagedll:$DYLD_LIBRARY_$PATH 
289 else
290     LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_$PATH
291 fi
292
293 export creaImageIO_DIR=$generationdir/creatools_bin/creaImageIOBin
294
295 # -------------------------
296 #        start_point =  8 : creaContour
297 #-------------------------
298 if [ $start_point -le 8 ]
299 then
300    # the following stupid test is used at debug time; Please don't remove!
301    #if [ true = false ]
302    if [ true = true ]
303    then
304       # creaContours
305       bash $scriptDir/cmakemod.sh              $creacontourssource $generationdir $installPrefix $buildType 
306       bash $scriptDir/creaContoursVariables.sh $creacontourssource $generationdir $docgeneration
307       bash $scriptDir/compilemod.sh $buildType $creacontourssource $generationdir $corenumber
308       bash $scriptDir/ctestmod.sh              $creacontourssource $generationdir
309    fi
310 fi
311  creacontourdll=$generationdir/creatools_bin/creacontoursBin
312  
313 if [ $OperatingSystem = "MacOS" ]
314 then
315     #duplicate form creaTools_name.sh?? //FCY
316     DYLD_LIBRARY_PATH=$creacontoursdll:$DYLD_LIBRARY_$PATH 
317 else
318     LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_$PATH
319 fi
320
321  export creaContours_DIR=$generationdir/creatools_bin/creaContoursBin
322
323 # -------------------------
324 #        start_point =  9 : creaRigidRegistration
325 #-------------------------
326 if [ $start_point -le 9 ]
327 then
328    # the following stupid test is used at debug time; Please don't remove!
329    #if [ true = false ]
330    if [ true = true ]
331    then
332       bash $scriptDir/cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
333       bash $scriptDir/creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
334       bash $scriptDir/compilemod.sh            $buildType $crearigidregistrationssource $generationdir $corenumber
335       bash $scriptDir/ctestmod.sh                         $crearigidregistrationssource $generationdir
336    fi
337 fi
338 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
339 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
340
341
342 # -------------------------
343 #        start_point =  10 : bbtkGEditor
344 #-------------------------
345 if [ $start_point -le 10 ]
346 then
347    # the following stupid test is used at debug time; Please don't remove!
348    #if [ true = false ]
349    if [ true = true ]
350    then
351       # bbtkGEditor
352       bash $scriptDir/cmakemod.sh              $bbtkgeditorsource $generationdir $installPrefix $buildType 
353       bash $scriptDir/bbtkGEditorVariables.sh  $bbtkgeditorsource $generationdir $docgeneration
354       bash $scriptDir/compilemod.sh $buildType $bbtkgeditorsource $generationdir $corenumber
355       bash $scriptDir/ctestmod.sh              $bbtkgeditorsource $generationdir
356    fi
357 fi
358 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
359 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
360
361
362 # -------------------------
363 #        start_point =  11 : libido
364 #-------------------------
365 #if [ $start_point -le 11 ]
366 #then
367    ## the following stupid test is used at debug time; Please don't remove!
368    ##if [ true = false ]
369    #if [ true = true ]
370    #then
371       ## creaTools
372       # bash $scriptDir/cmakemod.sh                $libidosource $generationdir $installPrefix $buildType 
373       # bash $scriptDir/libidoVariables.sh         $libidosource $generationdir $docgeneration
374       # bash $scriptDir/compilemod.sh   $buildType $libidosource $generationdir $corenumber
375    #fi
376 #fi
377
378
379
380 # -------------------------
381 #        start_point =  12 : creaTools
382 #-------------------------
383 if [ $start_point -le 12 ]
384 then
385    # the following stupid test is used at debug time; Please don't remove!
386    #if [ true = false ]
387    if [ true = true ]
388    then
389       # creaTools
390       bash $scriptDir/cmakemod.sh                $creatoolssource $generationdir $installPrefix $buildType 
391       bash $scriptDir/creaToolsVariables.sh      $creatoolssource $generationdir $docgeneration
392       bash $scriptDir/compilemod.sh   $buildType $creatoolssource $generationdir $corenumber
393    fi
394 fi
395
396
397 # bash ctestmod.sh $creatoolsbinary $generationdir
398 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
399 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
400
401
402 # -------------------------
403 #        start_point =  13 : creaMiniTools
404 #-------------------------
405 if [ $start_point -le 13 ]
406 then
407    # the following stupid test is used at debug time; Please don't remove!
408    #if [ true = false ]
409    if [ true = true ]
410    then
411       # creaMiniTools
412       bash $scriptDir/cmakemod.sh                   $creaminitoolssource $generationdir $installPrefix $buildType 
413       bash $scriptDir/creaMiniToolsVariables.sh     $creaminitoolssource $generationdir $docgeneration
414       bash $scriptDir/compilemod.sh      $buildType $creaminitoolssource $generationdir $corenumber
415    fi
416 fi
417
418
419 # -------------------------
420 #        start_point =  14 : creaVtk
421 #-------------------------
422 if [ $start_point -le 14 ]
423 then
424    # the following stupid test is used at debug time; Please don't remove!
425    #if [ true = false ]
426    if [ true = true ]
427    then
428       # creaVtk
429       bash $scriptDir/cmakemod.sh              $creavtksource $generationdir $installPrefix $buildType 
430       bash $scriptDir/creaVtkVariables.sh  $creavtksource $generationdir $docgeneration
431       bash $scriptDir/compilemod.sh $buildType $creavtksource $generationdir $corenumber
432       bash $scriptDir/ctestmod.sh              $creavtksource $generationdir
433    fi
434 fi
435  creavtkdll=$generationdir/creatools_bin/creaVtkBin
436
437 if [ $OperatingSystem = "MacOS" ]
438 then
439     #duplicate form creaTools_name.sh?? //FCY
440     DYLD_LIBRARY_PATH=$creavtkdll:$DYLD_LIBRARY_$PATH
441 else
442     LD_LIBRARY_PATH=$creavtkdll:$LD_LIBRARY_$PATH
443 fi 
444  
445  export creaVtk_DIR=$generationdir/creatools_bin/creaVtkBin
446
447
448
449
450 # shutdown /s
451 # exit /b