From: jean-pierre roux Date: Tue, 9 Nov 2010 17:08:15 +0000 (+0000) Subject: Automatic generation of 'export' environment variables in bashrc for Third Party... X-Git-Tag: Creatools2-0-3.creaToolsTools2-0-3.17Feb2011~96 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=6acbdd7e7c9518550d4415da67a793720e41a967;p=creaToolsTools.git Automatic generation of 'export' environment variables in bashrc for Third Party Libraries --- diff --git a/Install/scripts/All.sh b/Install/scripts/All.sh index 0685195..99ae399 100644 --- a/Install/scripts/All.sh +++ b/Install/scripts/All.sh @@ -4,8 +4,9 @@ if [ $# = 0 ] then echo "Use it as :" 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" exit 0 fi @@ -22,8 +23,9 @@ echo "----------" if [ $# != 5 ] then 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" exit 0 fi @@ -121,6 +123,8 @@ then fi creadll=$generationdir/creatools_bin/creaBin LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH + + # the following stupid test is used at debug time; Please don't remove! diff --git a/Install/scripts/compilemod.sh b/Install/scripts/compilemod.sh index 2801150..f793405 100644 --- a/Install/scripts/compilemod.sh +++ b/Install/scripts/compilemod.sh @@ -1,14 +1,14 @@ # $1 : useless for Linux (Release/Debug) +# $2 : name of source ex : crea +# $3 : generationdir ex : /tmp/myGenerationDir cd $3/creatools_bin/$2Bin -echo "--------------------------------------in compilemod--------------" +echo "--------------------------------------in compilemod-- $2 ------------" echo $1 echo $2 echo $3 make -j 2 -echo " " -echo $2 pwd sudo make install cd ../.. diff --git a/Install_ThirdParty/Readme.txt b/Install_ThirdParty/Readme.txt index 0722f60..6f020d5 100644 --- a/Install_ThirdParty/Readme.txt +++ b/Install_ThirdParty/Readme.txt @@ -30,5 +30,6 @@ cd .. 5) Run the whole stuff : sh install_thirdparty.sh + === === === WINDOWS users === === === diff --git a/Install_ThirdParty/scripts/install_thirdparty_all.sh b/Install_ThirdParty/scripts/install_thirdparty_all.sh index a1537fd..ed267b5 100644 --- a/Install_ThirdParty/scripts/install_thirdparty_all.sh +++ b/Install_ThirdParty/scripts/install_thirdparty_all.sh @@ -1,15 +1,16 @@ #!/bin/sh -if [ $# = 0 ] -then - echo "Use it as :" - echo "sh install_thirdparty_all.sh " - echo "with 'OperatingSystem' in {Fedora, Ubuntu, MacOS}" - echo " " - echo "ex : sh install_thirdparty_all.sh /tmp/gendir ~/Creatis/myInstallDirectory Debug Ubuntu" - exit 0 -fi +#if [ $# = 0 ] +#then +# echo "Use it as :" +# echo "sh install_thirdparty_all.sh " +# echo "with 'OperatingSystem' in {Fedora, Ubuntu, MacOS}" +# echo "with 'installPrefix' : /usr/local or /thirdparty_install +# echo " " +# echo "ex : sh install_thirdparty_all.sh /tmp/gendir /tmp/gendir/thirdparty_install Debug Ubuntu" +# exit 0 +#fi echo $# echo "----------" @@ -20,13 +21,14 @@ echo $3 echo $4 echo "----------" -if [ $# != 4 ] +if [ $# = 0 || $# != 4 ] then echo "Use it as :" echo "sh install_thirdparty_all.sh " - echo "with 'OperatingSystem' in {Fedora, Ubuntu, MacOS}" + echo "with 'OperatingSystem' in {Fedora, Ubuntu, MacOS}" + echo "with 'installPrefix' : /usr/local or echo " " - echo "ex : sh install_thirdparty_all.sh /tmp/gendir ~/Creatis/myInstallDirectory Debug Ubuntu" + echo "ex : sh install_thirdparty_all.sh /tmp/gendir /tmp/gendir/thirdparty_install Debug Ubuntu" exit 0 fi @@ -170,4 +172,25 @@ then cd .. fi +#deal with create creatools_third_party_libraries_config.sh + +THIRDPARTY_INSTALL_DIR=$installPrefix/thirdparty_install +sudo rm $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh + +sudo echo export PATH=$PATH:$THIRDPARTY_INSTALL_DIR/bin >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh +sudo echo export VTK_DIR=$THIRDPARTY_INSTALL_DIR/lib/vtk-5.6 >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh +sudo echo export ITK_DIR=$THIRDPARTY_INSTALL_DIR/lib/InsightToolkit >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh +sudo echo export GDCM_DIR=$THIRDPARTY_INSTALL_DIR/lib/gdcm >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh +sudo echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GDCM_DIR >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh +sudo echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ITK_DIR >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh +sudo echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$VTK_DIR >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh + +# modify .bashrc +# - remove line 'sh $installPrefix/thirdparty_install/share/creatools_third_party_libraries_config.sh' if any (with accurate value for ???) +sed -i -e 's/.*creatools_third_party_library_config.*/ /g' ~/.bashrc + +# - add line 'sh $installPrefix/thirdparty_install/share/creatools_third_party_libraries_config.sh' (with accurate value for ???) +echo sh $THIRDPARTY_INSTALL_DIR/creatools_third_party_libraries_config.sh >> ~/.bashrc + + diff --git a/README.txt b/README.txt index cbe59de..a1b7bd1 100644 --- a/README.txt +++ b/README.txt @@ -1,29 +1,34 @@ === === === UNIX / LINUX users === === === -0) Make sure everything you'll need is properly installed : -crea_Developers_tools, crea_ThirdParty_Libraries +0) Make sure you are a 'sudoer'. have a look at : -http://www.creatis.insa-lyon.fr/site/fr/CreatoolsDownload +--sudo configuration-- +https://fedoraproject.org/wiki/Configuring_Sudo -1) Make sure you got the last version of creaToolsTools. +1) ssh-add + + +2) Make sure you got the last version of creaToolsTools. cvs update -dP creaToolsTools -2) make sure VTK_DIR environment variable is set properly : +3) Make sure everything you'll need is properly installed : +crea_Developers_tools, crea_ThirdParty_Libraries +have a look at : +http://www.creatis.insa-lyon.fr/site/fr/CreatoolsDownload +and/or : +cd Install_ThirdParty +follow the Readme.txt + +4) make sure VTK_DIR environment variable is set properly : echo $VTK_DIR Set it, if not OK: export VTK_DIR=/usr/local/lib/vtk-5.4, for instance -3) make sure LATEX_COMPILER environment variable is set properly : +5) make sure LATEX_COMPILER environment variable is set properly : echo $LATEX_COMPILER Set it, if not OK: export LATEX_COMPILER=/usr/bin/latex, for instance -4) ssh-add - - -5) sudo configuration -https://fedoraproject.org/wiki/Configuring_Sudo - 6)cd Install cp creatools.sh_TEMPLATE creatools.sh