setenv.sh 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # This script sets some enviroment variables for the NICE framework,
  2. # such as PATH and LD_LIBRARY_PATH
  3. # usage: source setenv.sh [NICEDIR]
  4. # DO NOT SUBMIT A CHANGED VERSION TO THIS FILE UNLESS YOU
  5. # KNOW WHAT YOU ARE DOING !!
  6. # current path
  7. MYPATH=`pwd`
  8. # list of possible nice directories
  9. POSSIBLE_NICE_DIRECTORIES="$1 $MYPATH $NICEHOME $HOME/code/nice $HOME/dev/nice $HOME/workspace/nice $HOME/libs/nice/ $HOME/src/nice/"
  10. for MYNICEDIR in $POSSIBLE_NICE_DIRECTORIES; do
  11. # check whether we have an absolute path
  12. echo checking $MYNICEDIR
  13. if [ `echo $MYNICEDIR | cut -c1` != "/" ]; then
  14. # this is not an absolute path
  15. continue
  16. fi
  17. # check whether this is a suitable NICE core directory
  18. if [ -d "$MYNICEDIR/core/" ]; then
  19. NICEHOME=$MYNICEDIR
  20. break
  21. fi
  22. done
  23. echo Configuring NICE framework in $NICEHOME
  24. #export NICEHOME to have it accessible in child processes, e.g., in programs started on this shell aiming to read local settings, relative file names, or stuff like that
  25. export NICEHOME
  26. # Set the PKG_CONFIG_PATH to include the nice-core pc-files
  27. export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib64/pkgconfig/:/usr/lib/pkgconfig/:/usr/lib/pkgconfig/:/usr/local/lib/pkgconfig/:$NICEHOME/BUILD_`uname -m`$NICE_BUILD/pkgconfig/
  28. # Determine the GCC version, we might need it ...
  29. GCC_VERSION=`gcc --version | perl -e '$_=<>;/^gcc.+?([\d\.]+)/;print $1'`
  30. GCC_VERSION_MAJOR=`echo $GCC_VERSION | perl -e '$_=<>;/^(\d+\.\d+)\.\d+/;print $1'`
  31. # Use the slim-pkg-config program
  32. # (1) set the link
  33. ln -s $MYNICEDIR/slim-pkg-config/slim-pkg-config $MYNICEDIR/slim-pkg-config/pkg-config 2>/dev/null
  34. # (2) modify the PATH variable, because we want to use slim-pkg-config instead of the standard (slow!) pkg-config
  35. export PATH=$MYNICEDIR/slim-pkg-config/:$PATH
  36. echo "Using slim-pkg-config instead of pkg-config: which pkg-config = `which pkg-config`"
  37. PATH=$PATH:$NICEHOME/BUILD_`uname -m`$NICE_BUILD/bin
  38. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NICEHOME/BUILD_`uname -m`$NICE_BUILD/lib
  39. echo "Configuring BUILDIR: $NICEHOME/BUILD_`uname -m`$NICE_BUILD"
  40. LOCAL_SETENV="$NICEHOME/setenv_local.sh"
  41. if [ -f "$LOCAL_SETENV" ]; then
  42. echo "Using your local version: $LOCAL_SETENV"
  43. source "$LOCAL_SETENV"
  44. return
  45. fi
  46. if [ -e $HOME/DBVFAIL ]; then
  47. return
  48. fi
  49. if [ -d /home/dbv/ ]; then
  50. # The following commands are tuned for the enviroment
  51. # at the chair for computer vision, university of jena
  52. echo "Configuring to use /home/dbv/ ..."
  53. # check whether we have a 64bit machine
  54. if test "`uname -m`" == "x86_64"
  55. then
  56. # Do we really need this gcc stuff anymore?
  57. #source /home/dbv/3rdparty64-gcc43/gcc/setenv.sh
  58. source /home/dbv/3rdparty64-gcc43/ipp53/setenv.sh
  59. source /home/dbv/3rdparty64-gcc43/FireCap/setenv.sh
  60. #source /home/dbv/3rdparty64-gcc43/Coin3dQt4/setenv.sh
  61. source /home/dbv/3rdparty64-gcc43/LinAl/setenv.sh
  62. source /home/dbv/3rdparty64-gcc43/cppunit/setenv.sh
  63. # source /home/dbv/3rdparty64-gcc43/qt4/setenv.sh
  64. source /home/dbv/3rdparty64-gcc43/opencv/setenv.sh
  65. source /home/dbv/3rdparty64/cudaSIFT/setenv.sh
  66. source /home/dbv/3rdparty64/cuda/setenv_cuda.sh
  67. # Do we really need this gcc stuff anymore?
  68. PATH=$PATH:/home/dbv/3rdparty64-gcc43/bin
  69. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/dbv/3rdparty64-gcc43/libptu/lib:/home/dbv/3rdparty64-gcc43/Aria/lib
  70. else
  71. #32 bit system
  72. #source /home/dbv/3rdparty32/gcc/setenv.sh
  73. source /home/dbv/3rdparty32/ipp53/setenv.sh
  74. source /home/dbv/3rdparty32/FireCap/setenv.sh
  75. source /home/dbv/3rdparty32/Coin3d/setenv.sh
  76. source /home/dbv/3rdparty32/LinAl/setenv.sh
  77. #source /home/dbv/3rdparty64-gcc43/cppunit/setenv.sh
  78. #source /home/dbv/3rdparty32/qt4/setenv.sh
  79. source /home/dbv/3rdparty32-102/opencv/setenv.sh
  80. PATH=$PATH:/home/dbv/3rdparty32/bin:$NICEHOME/BUILD_i686/bin
  81. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NICEHOME/BUILD_i686/lib:/home/dbv/3rdparty32/qt4/lib:/home/dbv/3rdparty32/libptu/lib:/home/dbv/3rdparty32/Aria/lib
  82. fi
  83. else
  84. echo "The directory /home/dbv/ does not exist, therefore, I guess you have a local copy and take care of your env variables yourself."
  85. echo "Do not commit a local version of this script to the repository!"
  86. fi