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.

122 lines
2.6 KiB

8 years ago
  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. travis_fold() {
  66. local action=$1
  67. local name=$2
  68. echo -en "travis_fold:${action}:${name}\r"
  69. }
  70. run_make() {
  71. travis_fold start make
  72. make storm -j$N_JOBS
  73. #make resources -j$N_JOBS
  74. travis_fold end make
  75. }
  76. # Build
  77. echo CXX version: $($CXX --version)
  78. 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)
  79. 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))
  80. case "$1" in
  81. DebugPlain) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG") ;;
  82. ReleasePlain) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$STLARG") ;;
  83. *) echo "Error: you need to specify one of the supported postsubmit modes (see postsubmit.sh)."; exit 1 ;;
  84. esac
  85. # Restore timestamps of files
  86. travis_fold start mtime
  87. ruby travis/mtime_cache/mtime_cache.rb -g travis/mtime_cache/globs.txt -c travis/mtime_cache/cache.json
  88. travis_fold end mtime
  89. travis_fold start cmake
  90. #rm -rf build
  91. mkdir -p build
  92. cd build
  93. cmake .. "${CMAKE_ARGS[@]}"
  94. echo
  95. echo "Content of CMakeFiles/CMakeError.log:"
  96. if [ -f "CMakeFiles/CMakeError.log" ]
  97. then
  98. cat CMakeFiles/CMakeError.log
  99. fi
  100. echo
  101. travis_fold end cmake
  102. run_make