external.mk 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ################################################################################
  2. #
  3. # PARSEC_BENCHMARK
  4. #
  5. ################################################################################
  6. PARSEC_BENCHMARK_VERSION = master
  7. PARSEC_BENCHMARK_SITE = git@github.com:cirosantilli/parsec-benchmark.git
  8. PARSEC_BENCHMARK_SITE_METHOD = git
  9. define PARSEC_BENCHMARK_BUILD_CMDS
  10. # TODO make this nicer, only untar when extract step is done.
  11. # EXTRACT_CMDS and EXTRA_DOWNLOADS would be good candidates,
  12. # but they don't run with OVERRIDE_SRCDIR.
  13. '$(PARSEC_BENCHMARK_PKGDIR)/parsec-benchmark/get-inputs' $(if $(filter $(V),1),-v,) '$(DL_DIR)' '$(@D)/'
  14. # We run the benchmarks with the wrong arch here to generate the inputs on the host.
  15. # This is because on gem5 this takes too long to do.
  16. export GNU_TARGET_NAME='$(GNU_TARGET_NAME)' && \
  17. export GNU_HOST_NAME='$(GNU_HOST_NAME)' && \
  18. export HOSTCC='$(HOSTCC)' && \
  19. export M4='$(HOST_DIR)/usr/bin/m4' && \
  20. export MAKE='$(MAKE)' && \
  21. export OSTYPE=linux && \
  22. export TARGET_CROSS='$(TARGET_CROSS)' && \
  23. export CC="$(TARGET_CC)" && \
  24. export CPP="$(TARGET_CPP)" && \
  25. export CXX="$(TARGET_CXX)" && \
  26. export HOSTTYPE=$(BR2_ARCH) && \
  27. cd $(@D) && \
  28. . env.sh && \
  29. for pkg in $(BR2_PACKAGE_PARSEC_BENCHMARK_BUILD_LIST); do \
  30. parsecmgmt -a build -p $$pkg && \
  31. if [ ! '$(BR2_PACKAGE_PARSEC_BENCHMARK_PARSECMGMT)' = y ]; then \
  32. parsecmgmt -a run -p $$pkg -i $(BR2_PACKAGE_PARSEC_BENCHMARK_INPUT_SIZE); \
  33. fi \
  34. done
  35. endef
  36. define PARSEC_BENCHMARK_INSTALL_TARGET_CMDS
  37. mkdir -p '$(TARGET_DIR)/parsec/'
  38. $(INSTALL) -D -m 0755 '$(@D)/test.sh' '$(TARGET_DIR)/parsec/'
  39. if [ '$(BR2_PACKAGE_PARSEC_BENCHMARK_PARSECMGMT)' = y ]; then \
  40. rsync -am $(if $(filter $(V),1),-v,) \
  41. --exclude '**/obj/' \
  42. --exclude '**/run/' \
  43. --exclude '**/src/' \
  44. '$(@D)/' '$(TARGET_DIR)/parsec/' \
  45. ; \
  46. else \
  47. rsync -am $(if $(filter $(V),1),-v,) --include '*/' \
  48. --include 'inst/***' \
  49. --include 'run/***' \
  50. --exclude '*' '$(@D)/' '$(TARGET_DIR)/parsec/' \
  51. ; \
  52. fi
  53. # rsync finished.
  54. endef
  55. $(eval $(generic-package))