X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Install%2Fscripts%2FAll.sh;h=944b7c2530131383c5b4af93e65ab449d6ba9596;hb=322ef7eb18cf1799493d3a27ce919a3904e6c207;hp=47c91029a97dfbfcd8211c4b727a133a4f9e40ed;hpb=d6db13a2bbdd68fd8162f500616637906b123f8a;p=creaToolsTools.git diff --git a/Install/scripts/All.sh b/Install/scripts/All.sh index 47c9102..944b7c2 100644 --- a/Install/scripts/All.sh +++ b/Install/scripts/All.sh @@ -3,9 +3,11 @@ if [ $# = 0 ] then echo "Use it as :" -echo "sh All.sh " +echo "sh All.sh " +echo "with 'installPrefix' : /usr/local or /creatools_install" +echo "with 'GDCM Version' : GDCM1 / GDCM2" echo " " -echo "ex : sh All.sh /tmp/gendir OFF jpr /home/jpr/myInstallDirectory Debug" +echo "ex : sh All.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2" exit 0 fi @@ -17,13 +19,15 @@ echo $2 echo $3 echo $4 echo $5 +echo $6 echo "----------" -if [ $# != 5 ] +if [ $# != 6 ] then -echo "sh All.sh " +echo "sh All.sh " +echo "with 'installPrefix' : /usr/local or /creatools_install" echo " " -echo "ex : sh All.sh /tmp/gendir OFF jpr /home/jpr/myInstallDirectory Debug" +echo "ex : sh All.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2" exit 0 fi @@ -33,17 +37,19 @@ fi #allow user to choose to generate the doc or not generationdir=$1 +docgeneration=$2 cvsUserName=$3 installPrefix=$4 buildType=$5 +gdcmVersion=$6 scriptDir=$PWD echo scriptDir echo $scriptDir + mkdir $generationdir -mkdir $generationdir/creatools_source -mkdir $generationdir/creatools_bin +cd $generationdir creasource=crea bbtksource=bbtk @@ -55,23 +61,31 @@ mkdir $generationdir/creatools_bin crearigidregistrationssource=creaRigidRegistration bbtkgeditorsource=bbtkGEditor creatoolssource=creaTools - -cd $generationdir + +# start_point : used at debug time : start point of the script +# ex : if everything is OK, but bbtkGEditor, +# cvs upate bbtkGEditor manually,and use : +# start_point=10 +# in order not to cvs co everything, nor recompile everything. + +start_point=0 + + + +# -------------------------------- +# start_point = 0 : remove everything but source files +#--------------------------------- +if [ $start_point -le 0 ] +then # the following stupid test is used at debug time; Please don't remove! #if [ true = false ] if [ true = true ] then - sudo rm -rf creatools_bin/creaBin - sudo rm -rf creatools_bin/bbtkBin - sudo rm -rf creatools_bin/creaMaracasBin - sudo rm -rf creatools_bin/creaEnvironmentBin - sudo rm -rf creatools_bin/creaBrukerBin - sudo rm -rf creatools_bin/creaImageIOBin - sudo rm -rf creatools_bin/creaContoursBin - sudo rm -rf creatools_bin/creaRigidRegistrationBin - sudo rm -rf creatools_bin/bbtkGEditorBin - sudo rm -rf creatools_bin/creaToolsBin + rm -rf creatools_bin + mkdir $generationdir/creatools_bin + rm -rf creatools_source + mkdir $generationdir/creatools_source sudo rm -rf creatools_install/lib/creatools sudo rm -rf creatools_install/lib64/creatools @@ -89,9 +103,16 @@ then sudo rm -rf creatools_install/lib64/crea* sudo rm -rf creatools_install/lib64/libbb* sudo rm -rf creatools_install/lib64/libcrea* - fi +fi + +# ---------------------------------- +# start_point = 1 : checkout all +#----------------------------------- +if [ $start_point -le 1 ] +then +#if [ true = false ] if [ true = true ] then sh $scriptDir/cvscheckout.sh $creasource $generationdir $cvsUserName @@ -105,9 +126,16 @@ then sh $scriptDir/cvscheckout.sh $bbtkgeditorsource $generationdir $cvsUserName sh $scriptDir/cvscheckout.sh $creatoolssource $generationdir $cvsUserName fi +fi cd $scriptDir + +# ------------------------- +# start_point = 2 : CREA +#------------------------- +if [ $start_point -le 2 ] +then # CREA # the following stupid test is used at debug time; Please don't remove! #if [ true = false ] @@ -117,23 +145,37 @@ then sh creaVariables.sh $creasource $generationdir $docgeneration sh compilemod.sh $buildType $creasource $generationdir sh ctestmod.sh $creasource $generationdir +fi fi creadll=$generationdir/creatools_bin/creaBin LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH + +# ------------------------- +# start_point = 3 : BBTK +#------------------------- +if [ $start_point -le 3 ] +then # the following stupid test is used at debug time; Please don't remove! #if [ true = false ] if [ true = true ] then # BBTK sh cmakemod.sh $bbtksource $generationdir $installPrefix $buildType - sh bbtkVariables.sh $bbtksource $generationdir $docgeneration + sh bbtkVariables.sh $bbtksource $generationdir $docgeneration $gdcmVersion sh compilemod.sh $buildType $bbtksource $generationdir sh ctestmod.sh $bbtksource $generationdir +fi fi bbtkdll=$generationdir/creatools_bin/bbtkBin LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH + +# ------------------------- +# start_point = 4 : creaMaracasVisu +#------------------------- +if [ $start_point -le 4 ] +then # the following stupid test is used at debug time; Please don't remove! #if [ true = false ] if [ true = true ] @@ -144,10 +186,16 @@ then sh compilemod.sh $buildType $creamaracassource $generationdir sh ctestmod.sh $creamaracassource $generationdir fi - +fi creamaracasdll=$generationdir/creatools_bin/creamaracasBin LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_PATH + +# ------------------------- +# start_point = 5 : creaEnvironment +#------------------------- +if [ $start_point -le 5 ] +then # the following stupid test is used at debug time; Please don't remove! #if [ true = false ] if [ true = true ] @@ -157,37 +205,58 @@ then sh creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration sh compilemod.sh $buildType $creaenvironmentsource $generationdir sh ctestmod.sh $creaenvironmentsource $generationdir +fi fi creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_PATH + +# ------------------------- +# start_point = 6 : creaBruker +#------------------------- +if [ $start_point -le 6 ] +then # the following stupid test is used at debug time; Please don't remove! #if [ true = false ] if [ true = true ] then # creaBruker - sh cmakemod.sh $creabrukersource $generationdir $installPrefix $buildType - sh creaBrukerVariables.sh $creabrukersource $generationdir $docgeneration - sh compilemod.sh $buildType $creabrukersource $generationdir + sh cmakemod.sh $creabrukersource $generationdir $installPrefix $buildType + sh creaBrukerVariables.sh $creabrukersource $generationdir $docgeneration $gdcmVersion + sh compilemod.sh $buildType $creabrukersource $generationdir echo generationdir - sh ctestmod.sh $creabrukersource $generationdir + sh ctestmod.sh $creabrukersource $generationdir +fi fi creabrukerdll=$generationdir/creatools_bin/creabrukerBin LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_PATH -# the following stupid test is used at debug time; Please don't remove! + +# ------------------------- +# start_point = 7 : creaImageIO +#------------------------- +if [ $start_point -le 7 ] +then + # the following stupid test is used at debug time; Please don't remove! #if [ true = false ] if [ true = true ] then # creaImageIO sh cmakemod.sh $creaimagesource $generationdir $installPrefix $buildType - sh creaImageIOVariables.sh $creaimagesource $generationdir $docgeneration - sh compilemod.sh $buildType $creaimagesource $generationdir + sh creaImageIOVariables.sh $creaimagesource $generationdir $docgeneration $gdcmVersion + sh compilemod.sh $buildType $creaimagesource $generationdir sh ctestmod.sh $creaimagesource $generationdir +fi fi creaimagedll=$generationdir/creatools_bin/creaimageBin LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_PATH + +# ------------------------- +# start_point = 8 : creaContour +#------------------------- +if [ $start_point -le 8 ] +then # the following stupid test is used at debug time; Please don't remove! #if [ true = false ] if [ true = true ] @@ -195,26 +264,38 @@ then # creaContours sh cmakemod.sh $creacontourssource $generationdir $installPrefix $buildType sh creaContoursVariables.sh $creacontourssource $generationdir $docgeneration - sh compilemod.sh $buildType $creacontourssource $generationdir + sh compilemod.sh $buildType $creacontourssource $generationdir sh ctestmod.sh $creacontourssource $generationdir fi +fi # creacontourdll=$generationdir/creatools_bin/creacontoursBin # LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_PATH -# creaRigidRegistration +# ------------------------- +# start_point = 9 : creaRigidRegistration +#------------------------- +if [ $start_point -le 9 ] +then # the following stupid test is used at debug time; Please don't remove! #if [ true = false ] if [ true = true ] then sh cmakemod.sh $crearigidregistrationssource $generationdir $installPrefix $buildType sh creaRigidRegistrationVariables.sh $crearigidregistrationssource $generationdir $docgeneration - sh compilemod.sh $buildType $crearigidregistrationssource $generationdir + sh compilemod.sh $buildType $crearigidregistrationssource $generationdir sh ctestmod.sh $crearigidregistrationssource $generationdir fi +fi # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH + +# ------------------------- +# start_point = 10 : bbtkGEditor +#------------------------- +if [ $start_point -le 10 ] +then # the following stupid test is used at debug time; Please don't remove! #if [ true = false ] if [ true = true ] @@ -222,12 +303,19 @@ then # bbtkGEditor sh cmakemod.sh $bbtkgeditorsource $generationdir $installPrefix $buildType sh bbtkGEditorVariables.sh $bbtkgeditorsource $generationdir $docgeneration - sh compilemod.sh $buildType $bbtkgeditorsource $generationdir + sh compilemod.sh $buildType $bbtkgeditorsource $generationdir sh ctestmod.sh $bbtkgeditorsource $generationdir fi +fi # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH + +# ------------------------- +# start_point = 11 : creaTools +#------------------------- +if [ $start_point -le 11 ] +then # the following stupid test is used at debug time; Please don't remove! #if [ true = false ] if [ true = true ] @@ -235,11 +323,40 @@ then # creaTools sh cmakemod.sh $creatoolssource $generationdir $installPrefix $buildType sh creaToolsVariables.sh $creatoolssource $generationdir $docgeneration - sh compilemod.sh $buildType $creatoolssource $generationdir + sh compilemod.sh $buildType $creatoolssource $generationdir fi +fi + + # sh ctestmod.sh $creatoolsbinary $generationdir # creatoolsdll=$generationdir/creatools_bin/creatoolsBin # LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH + +CREATOOLS_INSTALL_DIR=$installPrefix +sudo rm $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh +sudo touch $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh +sudo chmod 666 $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh + +####################################### + +sudo touch $installPrefix/share/creatools_base_library_config.sh +sudo chmod 666 $installPrefix/share/creatools_base_library_config.sh + + +sudo echo export PATH='$'PATH:$installPrefix/bin >> $installPrefix/share/creatools_base_library_config.sh +sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib/creatools >> $installPrefix/share/creatools_base_library_config.sh +sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh + +# modify .bashrc +# - remove line 'sh $installPrefix/creatools_install/share/creatools_base_party_libraries_config.sh' if any (with accurate value for ???) +sed -i -e '/.*installPrefixCreaTools*/ d' ~/.bashrc +sed -i -e '/.*creatools_base_library_config.*/ d' ~/.bashrc + +# - add line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh' (with accurate value for ???) +echo installPrefixCreaTools=$installPrefix >> ~/.bashrc +echo '[ -f "$installPrefixCreaTools/share/creatools_base_library_config.sh" ] && source $installPrefixCreaTools/share/creatools_base_library_config.sh' >> ~/.bashrc + + # shutdown /s # exit /b