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.

87 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. git checkout 18.08
  19. mkdir build
  20. cd build
  21. cmake .. "${CMAKE_ARGS[@]}"
  22. make lib_carl addons -j$N_JOBS
  23. travis_fold end install_carl
  24. }
  25. # This only exists in OS X, but it doesn't cause issues in Linux (the dir doesn't exist, so it's
  26. # ignored).
  27. export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
  28. case $COMPILER in
  29. gcc-6)
  30. export CC=gcc-6
  31. export CXX=g++-6
  32. ;;
  33. gcc)
  34. export CC=gcc
  35. export CXX=g++
  36. ;;
  37. clang-4)
  38. case "$OS" in
  39. linux)
  40. export CC=clang-4.0
  41. export CXX=clang++-4.0
  42. ;;
  43. osx)
  44. export CC=/usr/local/opt/llvm/bin/clang-4.0
  45. export CXX=/usr/local/opt/llvm/bin/clang++
  46. ;;
  47. *) echo "Error: unexpected OS: $OS"; exit 1 ;;
  48. esac
  49. ;;
  50. clang)
  51. export CC=clang
  52. export CXX=clang++
  53. ;;
  54. *)
  55. echo "Unrecognized value of COMPILER: $COMPILER"
  56. exit 1
  57. esac
  58. # Build
  59. echo CXX version: $($CXX --version)
  60. 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)
  61. 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))
  62. case "$CONFIG" in
  63. DefaultDebug*)
  64. 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)
  65. ;;
  66. DefaultRelease*)
  67. 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)
  68. ;;
  69. *)
  70. echo "Unrecognized value of CONFIG: $CONFIG"; exit 1
  71. ;;
  72. esac
  73. run