setenv.sh 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. # Set the PKG_CONFIG_PATH to include the nice-core pc-files
  25. 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/
  26. # Determine the GCC version, we might need it ...
  27. GCC_VERSION=`gcc --version | perl -e '$_=<>;/^gcc.+?([\d\.]+)/;print $1'`
  28. GCC_VERSION_MAJOR=`echo $GCC_VERSION | perl -e '$_=<>;/^(\d+\.\d+)\.\d+/;print $1'`
  29. # Use the slim-pkg-config program
  30. # (1) set the link
  31. ln -s $MYNICEDIR/slim-pkg-config/slim-pkg-config $MYNICEDIR/slim-pkg-config/pkg-config 2>/dev/null
  32. # (2) modify the PATH variable, because we want to use slim-pkg-config instead of the standard (slow!) pkg-config
  33. export PATH=$MYNICEDIR/slim-pkg-config/:$PATH
  34. echo "Using slim-pkg-config instead of pkg-config: which pkg-config = `which pkg-config`"
  35. PATH=$PATH:$NICEHOME/BUILD_`uname -m`$NICE_BUILD/bin
  36. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NICEHOME/BUILD_`uname -m`$NICE_BUILD/lib
  37. echo "Configuring BUILDIR: $NICEHOME/BUILD_`uname -m`$NICE_BUILD"
  38. LOCAL_SETENV="$NICEHOME/setenv_local.sh"
  39. if [ -f "$LOCAL_SETENV" ]; then
  40. echo "Using your local version: $LOCAL_SETENV"
  41. source "$LOCAL_SETENV"
  42. return
  43. fi
  44. if [ -e $HOME/DBVFAIL ]; then
  45. return
  46. fi
  47. if [ -d /home/dbv/ ]; then
  48. # The following commands are tuned for the enviroment
  49. # at the chair for computer vision, university of jena
  50. echo "Configuring to use /home/dbv/ ..."
  51. # check whether we have a 64bit machine
  52. if test "`uname -m`" == "x86_64"
  53. then
  54. # Do we really need this gcc stuff anymore?
  55. #source /home/dbv/3rdparty64-gcc43/gcc/setenv.sh
  56. source /home/dbv/3rdparty64-gcc43/ipp53/setenv.sh
  57. source /home/dbv/3rdparty64-gcc43/FireCap/setenv.sh
  58. #source /home/dbv/3rdparty64-gcc43/Coin3dQt4/setenv.sh
  59. source /home/dbv/3rdparty64-gcc43/LinAl/setenv.sh
  60. source /home/dbv/3rdparty64-gcc43/cppunit/setenv.sh
  61. # source /home/dbv/3rdparty64-gcc43/qt4/setenv.sh
  62. source /home/dbv/3rdparty64-gcc43/opencv/setenv.sh
  63. source /home/dbv/3rdparty64/cudaSIFT/setenv.sh
  64. source /home/dbv/3rdparty64/cuda/setenv_cuda.sh
  65. # Do we really need this gcc stuff anymore?
  66. PATH=$PATH:/home/dbv/3rdparty64-gcc43/bin
  67. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/dbv/3rdparty64-gcc43/libptu/lib:/home/dbv/3rdparty64-gcc43/Aria/lib
  68. else
  69. #32 bit system
  70. #source /home/dbv/3rdparty32/gcc/setenv.sh
  71. source /home/dbv/3rdparty32/ipp53/setenv.sh
  72. source /home/dbv/3rdparty32/FireCap/setenv.sh
  73. source /home/dbv/3rdparty32/Coin3d/setenv.sh
  74. source /home/dbv/3rdparty32/LinAl/setenv.sh
  75. #source /home/dbv/3rdparty64-gcc43/cppunit/setenv.sh
  76. #source /home/dbv/3rdparty32/qt4/setenv.sh
  77. source /home/dbv/3rdparty32-102/opencv/setenv.sh
  78. PATH=$PATH:/home/dbv/3rdparty32/bin:$NICEHOME/BUILD_i686/bin
  79. 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
  80. fi
  81. else
  82. echo "The directory /home/dbv/ does not exist, therefore, I guess you have a local copy and take care of your env variables yourself."
  83. echo "Do not commit a local version of this script to the repository!"
  84. fi