starpu_env.in 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2020-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. #
  5. # StarPU is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU Lesser General Public License as published by
  7. # the Free Software Foundation; either version 2.1 of the License, or (at
  8. # your option) any later version.
  9. #
  10. # StarPU is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. #
  14. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. #
  16. PROGNAME=starpu_env
  17. usage()
  18. {
  19. echo "Tool to set StarPU environment variables"
  20. echo ""
  21. echo "Usage: source $PROGNAME"
  22. echo ""
  23. echo ""
  24. echo "Options:"
  25. echo " -h, --help display this help and exit"
  26. echo " -v, --version output version information and exit"
  27. echo ""
  28. echo "Report bugs to <@PACKAGE_BUGREPORT@>"
  29. }
  30. if [ "$1" = "-v" ] || [ "$1" = "--version" ]
  31. then
  32. echo "$PROGNAME (@PACKAGE_NAME@) @PACKAGE_VERSION@"
  33. elif [ "$1" = "-h" ] || [ "$1" = "--help" ]
  34. then
  35. usage
  36. else
  37. starpu_prefix=$(realpath @prefix@)
  38. if test -f $starpu_prefix/bin/starpu_machine_display -a -f $starpu_prefix/lib/pkgconfig/libstarpu.pc
  39. then
  40. echo "Setting StarPU environment for $starpu_prefix"
  41. export PKG_CONFIG_PATH=$starpu_prefix/lib/pkgconfig:$PKG_CONFIG_PATH
  42. export LD_LIBRARY_PATH=$starpu_prefix/lib:$LD_LIBRARY_PATH
  43. export PATH=$starpu_prefix/bin:$PATH
  44. export MANPATH=$starpu_prefix/share/man:$MANPATH
  45. for d in $starpu_prefix/lib/@PYTHON@* ; do export PYTHONPATH=$d/site-packages:$PYTHONPATH ; done
  46. else
  47. echo "[Error] $starpu_prefix is not a valid StarPU installation directory"
  48. fi
  49. fi