loader-cross.sh.in 1.3 KB

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