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.

73 lines
2.0 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. # If there are conflicts, try overwriting the files (these are in /usr/local anyway so it should be ok).
  19. brew install "$@" || brew link --overwrite gcc49
  20. fi
  21. }
  22. # Skip this run?
  23. if [ -f build/skip.txt ]
  24. then
  25. exit 0
  26. fi
  27. # Update packages
  28. travis_fold start brew_update
  29. brew update
  30. travis_fold end brew_update
  31. travis_fold start brew_install_util
  32. # For md5sum
  33. install_brew_package md5sha1sum
  34. # For `timeout'
  35. install_brew_package coreutils
  36. which cmake &>/dev/null || install_brew_package cmake
  37. # Install compiler
  38. case "${COMPILER}" in
  39. gcc-4.8) install_brew_package gcc@4.8 ;;
  40. gcc-4.9) install_brew_package gcc@4.9 ;;
  41. gcc-5) install_brew_package gcc@5 ;;
  42. gcc-6) install_brew_package gcc@6 ;;
  43. clang-default) ;;
  44. clang-3.7) install_brew_package llvm@3.7 --with-clang --with-libcxx;;
  45. clang-3.8) install_brew_package llvm@3.8 --with-clang --with-libcxx;;
  46. clang-3.9) install_brew_package llvm@3.9 --with-clang --with-libcxx;;
  47. clang-4.0) install_brew_package llvm --with-clang --with-libcxx;;
  48. *) echo "Compiler not supported: ${COMPILER}. See travis/install_osx.sh"; exit 1 ;;
  49. esac
  50. travis_fold end brew_install_util
  51. # Install dependencies
  52. travis_fold start brew_install_dependencies
  53. install_brew_package gmp --c++11
  54. install_brew_package cln
  55. install_brew_package ginac
  56. install_brew_package doxygen
  57. install_brew_package boost --c++11
  58. install_brew_package z3 # optional
  59. brew tap homebrew/science
  60. install_brew_package homebrew/science/glpk
  61. install_brew_package homebrew/science/hwloc
  62. install_brew_package eigen
  63. travis_fold end brew_install_dependencies