You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

openvibe-launcher.sh-base 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/bin/bash
  2. ## By default, paths specified by CMake install will be used to locate OpenViBE components. If defined, these ENV variables can override the CMake defines.
  3. export OV_PATH_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  4. export OV_PATH_BIN="$OV_PATH_ROOT/bin"
  5. export OV_PATH_LIB="$OV_PATH_ROOT/lib"
  6. export OV_PATH_DATA="$OV_PATH_ROOT/share/openvibe"
  7. # Dump core...
  8. # ulimit -c unlimited
  9. # Tries to locate matlab executable from $PATH, and set the library path to the corresponding matlab libs.
  10. if [ "`which matlab`" != "" ] ; then
  11. MATLAB_ROOT=`matlab -e | grep "^MATLAB=" | sed -e "s/^MATLAB=//"`
  12. MATLAB_ARCH=`matlab -e | grep "^ARCH=" | sed -e "s/^ARCH=//"`
  13. MATLAB_LIBPATH="$MATLAB_ROOT/bin/$MATLAB_ARCH"
  14. # echo Matlab libs expected at $MATLAB_LIBPATH
  15. export LD_LIBRARY_PATH="$MATLAB_LIBPATH:$LD_LIBRARY_PATH"
  16. fi
  17. LOCAL_BIN_PATH="@CMAKE_INSTALL_FULL_BINDIR@"
  18. if [ "$OV_PATH_BIN" != "" ]; then
  19. LOCAL_BIN_PATH="$OV_PATH_BIN"
  20. fi
  21. LOCAL_LIB_PATH="@CMAKE_INSTALL_FULL_LIBDIR@"
  22. if [ "$OV_PATH_LIB" != "" ]; then
  23. LOCAL_LIB_PATH="$OV_PATH_LIB"
  24. fi
  25. export LD_LIBRARY_PATH="$LOCAL_LIB_PATH:@OV_PATH_DEPENDENCY_LIBS@:$LD_LIBRARY_PATH"
  26. export LC_ALL=C
  27. # The following line is there to help in cases where OpenViBE can consume excessive
  28. # amounts of CPU or grind the swap. You can remove it if you know what you're doing.
  29. renice 19 $$
  30. ov_debugger=
  31. if [ "$1" == "--debug" ]; then
  32. ov_debugger="gdb --args"
  33. shift
  34. fi
  35. if [ "$1" == "--memcheck" ]; then
  36. ov_debugger="valkyrie "
  37. #ov_debugger="valgrind --tool=memcheck --log-file='valgrind_@OV_CMD_EXECUTABLE@_%p.log'"
  38. shift
  39. fi
  40. ov_run_bg=0
  41. if [ "$1" == "--run-bg" ]; then
  42. ov_run_bg=1
  43. shift
  44. fi
  45. ret_code=0
  46. if [ $ov_run_bg == 0 ]; then
  47. eval $ov_debugger "$LOCAL_BIN_PATH/@OV_CMD_EXECUTABLE@" @OV_CMD_ARGS@ "$@"
  48. ret_code=$?
  49. else
  50. $ov_debugger "$LOCAL_BIN_PATH/@OV_CMD_EXECUTABLE@" @OV_CMD_ARGS@ "$@" &
  51. fi
  52. exit $ret_code