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.

86 lines
2.1 KiB

  1. #!/bin/bash
  2. set -e
  3. # Helper for travis folding
  4. travis_fold() {
  5. local action=$1
  6. local name=$2
  7. echo -en "travis_fold:${action}:${name}\r"
  8. }
  9. # Helper for building and testing
  10. run() {
  11. travis_fold start install_dependencies
  12. apt-get update
  13. apt-get install -qq -y openjdk-8-jdk maven uuid-dev pkg-config
  14. travis_fold end install_dependencies
  15. travis_fold start install_carl
  16. git clone https://github.com/smtrat/carl.git
  17. cd carl
  18. mkdir build
  19. cd build
  20. cmake .. "${CMAKE_ARGS[@]}"
  21. make lib_carl addons -j$N_JOBS
  22. travis_fold end install_carl
  23. }
  24. # This only exists in OS X, but it doesn't cause issues in Linux (the dir doesn't exist, so it's
  25. # ignored).
  26. export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
  27. case $COMPILER in
  28. gcc-6)
  29. export CC=gcc-6
  30. export CXX=g++-6
  31. ;;
  32. gcc)
  33. export CC=gcc
  34. export CXX=g++
  35. ;;
  36. clang-4)
  37. case "$OS" in
  38. linux)
  39. export CC=clang-4.0
  40. export CXX=clang++-4.0
  41. ;;
  42. osx)
  43. export CC=/usr/local/opt/llvm/bin/clang-4.0
  44. export CXX=/usr/local/opt/llvm/bin/clang++
  45. ;;
  46. *) echo "Error: unexpected OS: $OS"; exit 1 ;;
  47. esac
  48. ;;
  49. clang)
  50. export CC=clang
  51. export CXX=clang++
  52. ;;
  53. *)
  54. echo "Unrecognized value of COMPILER: $COMPILER"
  55. exit 1
  56. esac
  57. # Build
  58. echo CXX version: $($CXX --version)
  59. 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)
  60. 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))
  61. case "$CONFIG" in
  62. DefaultDebug*)
  63. CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG" -DUSE_CLN_NUMBERS=ON -DUSE_GINAC=ON -DTHREAD_SAFE=ON -DBUILD_ADDONS=ON -DBUILD_ADDON_PARSER=ON)
  64. ;;
  65. DefaultRelease*)
  66. CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$STLARG" -DUSE_CLN_NUMBERS=ON -DUSE_GINAC=ON -DTHREAD_SAFE=ON -DBUILD_ADDONS=ON -DBUILD_ADDON_PARSER=ON)
  67. ;;
  68. *)
  69. echo "Unrecognized value of CONFIG: $CONFIG"; exit 1
  70. ;;
  71. esac
  72. run