install-cbc-from-source.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. #################################################################################
  3. # This script installs the Cbc solver from source
  4. # (for cases where you can't install the coinor-cbc package via package managers)
  5. # Note: We use 2.9 here, but 2.10 has also been working well in our CI pipeline.
  6. #################################################################################
  7. # Install to this dir
  8. SOFTWARE_DIR=/home/seita/software
  9. if [ "$1" != "" ]; then
  10. SOFTWARE_DIR=$1
  11. fi
  12. echo "Attempting to install Cbc-2.9 to $SOFTWARE_DIR ..."
  13. mkdir -p $SOFTWARE_DIR
  14. cd $SOFTWARE_DIR
  15. # Getting Cbc and its build tools
  16. git clone --branch=stable/2.9 https://github.com/coin-or/Cbc Cbc-2.9
  17. cd Cbc-2.9
  18. git clone --branch=stable/0.8 https://github.com/coin-or-tools/BuildTools/
  19. BuildTools/get.dependencies.sh fetch
  20. # Configuring, installing
  21. ./configure
  22. make
  23. make install
  24. # adding new binaries to PATH
  25. # NOTE: This line might need to be added to your ~/.bashrc or the like
  26. export PATH=$PATH:$SOFTWARE_DIR/Cbc-2.9/bin
  27. echo "Done. The command 'cbc' should now work on this machine."