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.

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