1 # ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
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.
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
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 # ------------------------------------------------------------------------
27 if [ -f scripts/CreaTools-configure.sh ]
29 source scripts/CreaTools-configure.sh
42 echo " This MENU is deprecated."
43 echo " Please use installscipt instead."
45 echo " Choose what you want to do :"
47 echo " Configure :........................0"
49 if [ $expanded = "YES" ]
51 echo " Install all base stuff :..........1.0"
52 echo " (cmake, doxygen, graphviz, ...)"
53 echo " Get, Compile, Install vtk .......1.1"
54 echo " Get, Compile, Install gdcm :.. . .1.2"
55 echo " Get, Compile, Install itk :.......1.3"
56 echo " Get, Compile, Install Wx (for Mac Users) :…....1.4"
59 echo " Install Third Party Libraries :....1 (as root)"
62 if [ $expanded = "YES" ]
64 echo " Get the 'CreaTools' source files :.2.1 (GIT : as user!)"
65 echo " Compile the CreaTools :..........2.2"
66 # Install creatools as user (no longer as root) // JPR 2/5/2011
67 echo " Install the CreaTools :..........2.3"
69 echo " Get and Install the 'CreaTools':...2"
72 if [ $expanded = "NO" ]
74 echo " Use Expanded menu :................5 "
76 echo " Use compact menu :.................5 "
78 echo " Uninstall the CreaTools :..........6 "
79 echo " Help ..............................7 Help about this menu"
80 echo " Show some Environment Variables ...8"
81 echo " Exit :.............................9"
86 echo "Type in your choice :"
92 # Do it, while we are under user, not under root! # JPR
93 if [ -f $HOME/.bashrc ]
95 export ETC_BASHRC=$HOME/.bashrc
97 if [ -f $HOME/.profile ]
99 export ETC_BASHRC=$HOME/.profile
101 echo "======================== BIG TROUBLE : neither $HOME/.bashrc nor $HOME/.profile file found"
102 echo "======================== You'd better to abort the program and (try to) fix the issue"
103 read a # just to let the user time enough to read the message...
109 #ls -l scripts/CreaTools-configure.sh
110 if [ -f scripts/CreaTools-configure.sh ]
112 while [[ "$suitable" != "YES" && \
113 "$suitable" != "yes" && \
114 "$suitable" != "Y" && \
115 "$suitable" != "y" && \
116 "$suitable" != "NO" && \
117 "$suitable" != "no" ]]
119 echo "'Configure' already done; Content of scripts/CreaTools-configure.sh :"
120 echo "------------------------"
121 more scripts/CreaTools-configure.sh
122 echo "------------------------"
124 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
125 # If user configured without installing third party library,
126 # last third party library is still in use! JPR
128 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
131 echo "the curently used Third Party libraries are NOT in $installPrefixThird but ... in :"
132 grep "installPrefixThird=" $ETC_BASHRC
133 echo "VTK_DIR : " $VTK_DIR
134 echo "ITK_DIR : " $ITK_DIR
135 echo "GDCM_DIR : " $GDCM_DIR
136 echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
139 echo "Are these values suitable for you : YES/NO? (default is YES)"
141 if [ "$suitable" = "" ]
150 if [[ "$suitable" = "YES" || "$suitable" = "Y" || "$suitable" = "yes" || "$suitable" = "y" ]]
152 source scripts/CreaTools-configure.sh
155 if [[ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]]
156 #if [ "$suitable" = "NO" ]
161 while [ "$confirm" != "YES" ]
163 # ///\TODO what about SuSE? Debian? Mandriva? Gentoo?
164 OperatingSystem="XXX"
165 while [[ "$OperatingSystem" != "Fedora" && \
166 "$OperatingSystem" != "Ubuntu" && \
167 "$OperatingSystem" != "MacOS" ]]
169 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
171 if [ "$OperatingSystem" = "" ]
173 OperatingSystem="Fedora"
176 echo "you said : [" $OperatingSystem "]"
181 echo "How many cores on your computer 2 (default is 2)"
183 if [ "$corenumber" = "" ]
187 echo "you said : [" $corenumber "]"
192 racine=$HOME/myDefaultCreatoolsGenerationDir
194 echo "Name of the Generation Directory (default is $racine)"
196 if [ "$generationdir" = "" ]
198 generationdir=$racine
200 echo "you said : [" $generationdir "]"
205 installPrefixThird="___"
206 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
207 read installPrefixThird
208 if [ "$installPrefixThird" = "" ]
210 installPrefixThird="$generationdir/thirdparty_install"
212 echo "you said : [" $installPrefixThird "]"
218 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
220 if [ "$installPrefix" = "" ]
222 installPrefix="$generationdir/creatools_install"
224 echo "you said : [" $installPrefix "]"
232 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
234 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
236 if [ "$docgeneration" = "" ]
240 echo "you said : [" $docgeneration "]"
251 while [[ "$sourcesFrom" != "GIT" && "$sourcesFrom" != "HTML" ]]
253 echo "Where do you want to get source files from : GIT/HTML ( GIT : for registered CREATIS users only! )"
255 if [ "$sourcesFrom" = "" ]
259 echo "you said : [" $sourcesFrom "]"
266 if [ "$sourcesFrom" = "GIT" ]
268 while [ "$gitUserName" == "" ]
270 echo "GIT User Name ( registered CREATIS user : mandatory!)"
273 echo "you said : [" $gitUserName "]"
275 gitUserName="ForgetThisOne"
284 #while [ "$loginUserName" == "" ]
286 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
288 # echo "Login User Name (mandatory!)"
290 # echo "you said : [" $loginUserName "]"
296 while [ "$loginGroupName" == "" ]
298 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
299 echo "Login Group Name (mandatory!)"
301 echo "you said : [" $loginGroupName "]"
308 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
310 echo "Build type : Release/Debug (default is Release)"
312 if [ "$buildType" = "" ]
316 echo "you said : [" $buildType "]"
323 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion" != "GDCM2" ]]
325 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
327 if [ "$gdcmVersion" = "" ]
331 echo "you said : [" $gdcmVersion "]"
334 # NOT YET CHECKED ! JPR
336 while [[ "$ITKVersion" != "ITK3" && "$ITKVersion" != "ITK4" ]]
338 echo "ITK version : ITK3/ITK4 (default is ITK3)"
340 if [ "$ITKVersion" = "" ]
344 echo "you said : [" $ITKVersion "]"
352 echo " Operating System : $OperatingSystem"
353 echo " Number of Cores : $corenumber"
354 echo " Name of the Generation Directory : $generationdir"
355 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
356 echo " Install Prefix for CreaTools : $installPrefix"
357 echo " Boolean for Doc Generation : $docgeneration"
358 echo " Where do you want to get source files from : $sourcesFrom"
359 if [ $sourcesFrom = GIT ]
361 echo " GIT User Name : $gitUserName"
363 echo " Login User Name : $loginUserName"
364 echo " Login Group Name : $loginGroupName"
365 echo " Build type : $buildType"
366 echo " Gdcm version : $gdcmVersion"
367 echo " ITK version : $ITKVersion"
371 echo "Do you confirm your choices : YES/NO ? (default is YES)"
373 if [ "$confirm" = "" ]
379 # ==> On genere le fichier CreaTools-configure.sh genere chez l'utilisateur (no choice!)...
382 configureFile="scripts/CreaTools-configure.sh"
384 echo "#!/bin/bash" > $configureFile
385 echo >> $configureFile
386 echo "#File generated by 'menu.sh'" >> $configureFile
387 echo "#DO NOT edit !" >> $configureFile
388 echo "#(except if you *do* know what you do)" >> $configureFile
389 echo >> $configureFile
390 echo "OperatingSystem=$OperatingSystem" >> $configureFile
391 echo "corenumber=$corenumber" >> $configureFile
392 echo "generationdir=$generationdir" >> $configureFile
393 echo "installPrefix=$installPrefix" >> $configureFile
394 echo "installPrefixThird=$installPrefixThird" >> $configureFile
395 echo "docgeneration=$docgeneration" >> $configureFile
396 echo "sourcesFrom=$sourcesFrom" >> $configureFile
397 echo "gitUserName=$gitUserName" >> $configureFile
398 echo "loginUserName=$loginUserName" >> $configureFile
399 echo "loginGroupName=$loginGroupName" >> $configureFile
400 echo "buildType=$buildType" >> $configureFile
401 echo "gdcmVersion=$gdcmVersion" >> $configureFile
402 echo "ITKVersion=$ITKVersion" >> $configureFile
403 echo "ETC_BASHRC=$ETC_BASHRC" >> $configureFile
411 echo "========================== 1 "
412 source scripts/Check-if-root.sh
413 bash scripts/ThirdParty-install-Base-Stuff.sh
414 bash scripts/ThirdParty-install-VTK.sh
415 bash scripts/ThirdParty-install-gdcm.sh
416 bash scripts/ThirdParty-install-ITK.sh
417 bash scripts/ThirdParty-install.sh
418 bash scripts/ThirdParty-install-Finalize.sh
420 if [ "$sourcesFrom" = "GIT" ]
422 echo "----------------------------------------------------------------------"
424 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
425 echo "----------------------------------------------------------------------"
427 echo "----------------------------------------------------------------------"
429 echo "To go on, run again 'bash menu.sh' in a new window"
430 echo "----------------------------------------------------------------------"
434 echo "==> You HAVE to leave current window to continue!"
441 echo "========================== 1.0 "
442 source scripts/Check-if-root.sh
443 bash scripts/ThirdParty-install-Base-Stuff.sh
444 bash scripts/ThirdParty-install-Finalize.sh
448 echo "========================== 1.1 "
449 #source scripts/Check-if-root.sh
450 bash scripts/ThirdParty-install-VTK.sh
451 bash scripts/ThirdParty-install-Finalize.sh
455 echo "========================== 1.2 "
456 #source scripts/Check-if-root.sh
457 bash scripts/ThirdParty-install-gdcm.sh
458 bash scripts/ThirdParty-install-Finalize.sh
462 echo "========================== 1.3 "
463 #source scripts/Check-if-root.sh
464 bash scripts/ThirdParty-install-ITK.sh
465 bash scripts/ThirdParty-install-Finalize.sh
468 echo "========================== 1.4 "
469 #source scripts/Check-if-root.sh
470 bash scripts/ThirdParty-install-WX.sh
471 bash scripts/ThirdParty-install-Finalize.sh
477 bash scripts/CreaTools-load.sh
479 source scripts/CreaTools-configure.sh
480 bash scripts/CreaTools-compile.sh
482 bash scripts/CreaTools-install.sh
484 echo "==> You HAVE to leave current window to continue!"
492 echo "========================== 2.1"
493 bash scripts/CreaTools-load.sh
497 echo "========================== 2.2"
498 source scripts/CreaTools-configure.sh
500 bash scripts/CreaTools-compile.sh
502 # To allow (*very* aware) user to patch code, later
503 if [ ! -e $generationdir/creatools_source ]
505 echo "You probabely made a mistake : "
506 echo "Directory $loginUserName $generationdir/creatools_source not found"
507 echo "Make sure you know the mistake"
508 echo "Hit any key to continue"
509 echo "Fix the mistake!"
512 chown -R $loginUserName $generationdir/creatools_source
513 chgrp -R $loginGroupName $generationdir/creatools_source
519 echo "========================= 4"
521 bash scripts/CreaTools-install.sh
525 # echo "You HAVE to leave current window to continue!"
527 # echo "==> Hit any key to close current window"
533 if [ $expanded = "NO" ]
542 echo "========================= 5"
543 bash scripts/CreaTools-uninstall.sh
545 echo "==> Hit any key to go on"
551 echo "==================================="
554 echo "==> Hit any key to go on"
560 echo "==================================="
562 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
563 # If user configured without installing third party library,
564 # last third party library is still in use! JPR
567 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
571 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
572 grep "installPrefixThird=" $ETC_BASHRC
573 echo "VTK_DIR : " $VTK_DIR
574 echo "ITK_DIR : " $ITK_DIR
575 echo "GDCM_DIR : " $GDCM_DIR
577 echo "installPrefixThird ... " $installPrefixThird
580 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
582 echo "Third party config file : " $installPrefixThird/share/creatools_third_party_library_config.sh
584 more $installPrefixThird/share/creatools_third_party_library_config.sh
590 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
592 echo "Creatools base library config file : " $installPrefix/share/creatools_base_library_config.sh
594 more $installPrefix/share/creatools_base_library_config.sh
597 echo "installPrefix ... " $installPrefix
600 echo "VTK_DIR : " $VTK_DIR
601 echo "ITK_DIR : " $ITK_DIR
602 echo "GDCM_DIR : " $GDCM_DIR
604 echo "crea_DIR : " $crea_DIR
605 echo "BBTK_DIR : " $BBTK_DIR
606 echo "creaMaracasVisu_DIR : " $creaMaracasVisu_DIR
607 echo "creaEnvironment_DIR : " $creaEnvironment_DIR
608 echo "creaBruker_DIR : " $creaBruker_DIR
609 echo "creaImageIO_DIR : " $creaImageIO_DIR
610 echo "creaContours_DIR : " $creaContours_DIR
611 echo "creaRigidRegistration_DIR :" $creaRigidRegistration_DIR
612 echo "bbtkGEditor_DIR : " $bbtkGEditor_DIR
613 echo "creaTools_DIR : " $creaTools_DIR
614 echo "creaMiniTools_DIR : " $creaMiniTools_DIR
615 echo "Ido_DIR : " $Ido_DIR
616 echo "==================================="
618 echo "Press any key to continue"
628 # Hiden option, usefull at debug time
629 bash scripts/ThirdParty-install_no_compile.sh
636 echo "Your answer must be in {0, 1, 2, 5, 6, 7, 8, 9} (was [ $i ])"
638 echo "Your answer must be in {0, 1, 2.1, 2.2, 2.3, 5, 6, 7, 8, 9} (was [ $i ])"