You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
2.2 KiB

  1. #!/bin/bash -x
  2. # Inspired by https://github.com/google/fruit
  3. set -e
  4. # This only exists in OS X, but it doesn't cause issues in Linux (the dir doesn't exist, so it's
  5. # ignored).
  6. export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
  7. case $COMPILER in
  8. gcc-4.8)
  9. export CC=gcc-4.8
  10. export CXX=g++-4.8
  11. ;;
  12. gcc-4.9)
  13. export CC=gcc-4.9
  14. export CXX=g++-4.9
  15. ;;
  16. gcc-5)
  17. export CC=gcc-5
  18. export CXX=g++-5
  19. ;;
  20. gcc-6)
  21. export CC=gcc-6
  22. export CXX=g++-6
  23. ;;
  24. clang-3.5)
  25. export CC=clang-3.5
  26. export CXX=clang++-3.5
  27. ;;
  28. clang-3.6)
  29. export CC=clang-3.6
  30. export CXX=clang++-3.6
  31. ;;
  32. clang-3.7)
  33. export CC=clang-3.7
  34. export CXX=clang++-3.7
  35. ;;
  36. clang-3.8)
  37. export CC=clang-3.8
  38. export CXX=clang++-3.8
  39. ;;
  40. clang-3.9)
  41. export CC=clang-3.9
  42. export CXX=clang++-3.9
  43. ;;
  44. clang-4.0)
  45. case "$OS" in
  46. linux)
  47. export CC=clang-4.0
  48. export CXX=clang++-4.0
  49. ;;
  50. osx)
  51. export CC=/usr/local/opt/llvm/bin/clang-4.0
  52. export CXX=/usr/local/opt/llvm/bin/clang++
  53. ;;
  54. *) echo "Error: unexpected OS: $OS"; exit 1 ;;
  55. esac
  56. ;;
  57. clang-default)
  58. export CC=clang
  59. export CXX=clang++
  60. ;;
  61. *)
  62. echo "Unrecognized value of COMPILER: $COMPILER"
  63. exit 1
  64. esac
  65. run_make() {
  66. make storm -j$N_JOBS
  67. }
  68. # Build
  69. echo CXX version: $($CXX --version)
  70. echo C++ Standard library location: $(echo '#include <vector>' | $CXX -x c++ -E - | grep 'vector\"' | awk '{print $3}' | sed 's@/vector@@;s@\"@@g' | head -n 1)
  71. echo Normalized C++ Standard library location: $(readlink -f $(echo '#include <vector>' | $CXX -x c++ -E - | grep 'vector\"' | awk '{print $3}' | sed 's@/vector@@;s@\"@@g' | head -n 1))
  72. case "$1" in
  73. DebugPlain) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG") ;;
  74. ReleasePlain) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$STLARG") ;;
  75. *) echo "Error: you need to specify one of the supported postsubmit modes (see postsubmit.sh)."; exit 1 ;;
  76. esac
  77. rm -rf build
  78. mkdir build
  79. cd build
  80. cmake .. "${CMAKE_ARGS[@]}"
  81. echo
  82. echo "Content of CMakeFiles/CMakeError.log:"
  83. if [ -f "CMakeFiles/CMakeError.log" ]
  84. then
  85. cat CMakeFiles/CMakeError.log
  86. fi
  87. echo
  88. run_make