starpu_check_config.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2017,2018 CNRS
  5. #
  6. # StarPU is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; either version 2.1 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # StarPU is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. #
  17. DIR=$(echo $(dirname $0)/../../../)
  18. SGREP="grep --exclude-dir=.git --binary-files=without-match"
  19. for m in $(grep undef $DIR/src/common/config.h.in | awk '{print $2}' | grep -v "^PACKAGE")
  20. do
  21. #echo Check macro $m
  22. used=$($SGREP -rsl $m | grep -v Makefile | grep -v "^src" | grep -v configure | grep -v autom4 | grep -v "gcc-plugin" | grep -v "mpi/src" | grep -v "tests/helper.h" | grep -v m4 | grep -v doc )
  23. if test -n "$used"
  24. then
  25. #echo "Checking $m is defined in include config"
  26. count=$(grep -c $m $DIR/include/starpu_config.h.in)
  27. if test $count == 0
  28. then
  29. echo "Error: Macro $m is not defined in include/starpu_config.h.in"
  30. echo "but is used in"
  31. echo $used | tr ' ' '\012'
  32. echo
  33. fi
  34. fi
  35. done