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.

66 lines
1.5 KiB

8 years ago
  1. #!/bin/bash
  2. # Script installing dependencies
  3. # Inspired by https://github.com/google/fruit
  4. set -e
  5. # Helper for travis folding
  6. travis_fold() {
  7. local action=$1
  8. local name=$2
  9. echo -en "travis_fold:${action}:${name}\r"
  10. }
  11. # Helper for installing packages via homebrew
  12. install_brew_package() {
  13. if brew list -1 | grep -q "^$1\$"; then
  14. # Package is installed, upgrade if needed
  15. brew outdated "$1" || brew upgrade "$@"
  16. else
  17. # Package not installed yet, install.
  18. brew install "$@" || brew link --overwrite "$@"
  19. fi
  20. }
  21. # Skip this run?
  22. if [ -f build/skip.txt ]
  23. then
  24. exit 0
  25. fi
  26. # Update packages
  27. travis_fold start brew_update
  28. brew update
  29. travis_fold end brew_update
  30. travis_fold start brew_install_util
  31. # For md5sum
  32. install_brew_package md5sha1sum
  33. # For `timeout'
  34. install_brew_package coreutils
  35. install_brew_package cmake
  36. # Install compiler
  37. case "${COMPILER}" in
  38. gcc) install_brew_package gcc ;;
  39. gcc-6) install_brew_package gcc@6 ;;
  40. clang) ;;
  41. clang-4) install_brew_package llvm@4 --with-clang --with-libcxx;;
  42. *) echo "Compiler not supported: ${COMPILER}. See travis/install_osx.sh"; exit 1 ;;
  43. esac
  44. travis_fold end brew_install_util
  45. # Install dependencies
  46. travis_fold start brew_install_dependencies
  47. install_brew_package gmp --c++11
  48. install_brew_package cln
  49. install_brew_package ginac
  50. install_brew_package doxygen
  51. install_brew_package boost --c++11
  52. install_brew_package z3 # optional
  53. install_brew_package glpk
  54. install_brew_package hwloc
  55. install_brew_package eigen
  56. travis_fold end brew_install_dependencies