loader-cross.sh.in 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2013,2015-2017 CNRS
  5. # Copyright (C) 2013,2015,2017 Université de Bordeaux
  6. # Copyright (C) 2013 Thibaut Lambert
  7. #
  8. # StarPU is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU Lesser General Public License as published by
  10. # the Free Software Foundation; either version 2.1 of the License, or (at
  11. # your option) any later version.
  12. #
  13. # StarPU is distributed in the hope that it will be useful, but
  14. # WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16. #
  17. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  18. #
  19. top_srcdir="@top_srcdir@"
  20. export top_builddir="@top_builddir@"
  21. exec="$1"
  22. shift
  23. if test -z "$exec"
  24. then
  25. echo "[Error] Syntax: $0 <mic_executable> <args>"
  26. exit 1
  27. fi
  28. case "$exec" in
  29. /*) ;;
  30. *) exec="$PWD/$exec"
  31. esac
  32. NATIVE=${exec/\/build_mic\//\/build_host\/}
  33. DIR="$(dirname "$exec")"
  34. FILE="$(basename "$exec")"
  35. export SINK_LD_LIBRARY_PATH="$top_builddir/src/.libs:$SINK_LD_LIBRARY_PATH"
  36. export STARPU_MIC_SINK_PROGRAM_NAME="$exec"
  37. export STARPU_MIC_SINK_PROGRAM_PATH="$DIR"
  38. # in case libtool got into play
  39. [ -x "$DIR/.libs/$FILE" ] && STARPU_MIC_SINK_PROGRAM_NAME="$DIR/.libs/$FILE"
  40. $top_builddir/../build_host/tests/loader "$NATIVE" "$@"