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.

52 lines
1.6 KiB

  1. #!/bin/bash -x
  2. # Script installing dependencies
  3. # Inspired by https://github.com/google/fruit
  4. set -e
  5. # Helper for installing packages via homebrew
  6. install_brew_package() {
  7. if brew list -1 | grep -q "^$1\$"; then
  8. # Package is installed, upgrade if needed
  9. brew outdated "$1" || brew upgrade "$@"
  10. else
  11. # Package not installed yet, install.
  12. # If there are conflicts, try overwriting the files (these are in /usr/local anyway so it should be ok).
  13. brew install "$@" || brew link --overwrite gcc49
  14. fi
  15. }
  16. # Update packages
  17. brew update
  18. # For md5sum
  19. install_brew_package md5sha1sum
  20. # For `timeout'
  21. install_brew_package coreutils
  22. which cmake &>/dev/null || install_brew_package cmake
  23. # Install compiler
  24. case "${COMPILER}" in
  25. gcc-4.8) install_brew_package gcc@4.8 ;;
  26. gcc-4.9) install_brew_package gcc@4.9 ;;
  27. gcc-5) install_brew_package gcc@5 ;;
  28. gcc-6) install_brew_package gcc@6 ;;
  29. clang-default) ;;
  30. clang-3.7) install_brew_package llvm@3.7 --with-clang --with-libcxx;;
  31. clang-3.8) install_brew_package llvm@3.8 --with-clang --with-libcxx;;
  32. clang-3.9) install_brew_package llvm@3.9 --with-clang --with-libcxx;;
  33. clang-4.0) install_brew_package llvm --with-clang --with-libcxx;;
  34. *) echo "Compiler not supported: ${COMPILER}. See travis_ci_install_osx.sh"; exit 1 ;;
  35. esac
  36. # Install dependencies
  37. install_brew_package gmp --c++11
  38. install_brew_package cln
  39. install_brew_package ginac
  40. install_brew_package doxygen
  41. install_brew_package boost --c++11
  42. brew tap homebrew/science
  43. install_brew_package homebrew/science/glpk
  44. install_brew_package homebrew/science/hwloc