|
| 1 | +# All Vagrant configuration is done below. The "2" in Vagrant.configure |
| 2 | +# configures the configuration version (we support older styles for |
| 3 | +# backwards compatibility). Please don't change it unless you know what |
| 4 | +# you're doing. |
| 5 | +Vagrant.configure("2") do |config| |
| 6 | + # For a complete reference of vagrant options see https://docs.vagrantup.com. |
| 7 | + |
| 8 | + # We increase the RAM from a default of 1GB for compiling with SoPlex. |
| 9 | + # See issue1101 for details. |
| 10 | + config.vm.provider "virtualbox" do |v| |
| 11 | + v.memory = 2048 |
| 12 | + end |
| 13 | + |
| 14 | + config.vm.box = "ubuntu/jammy64" |
| 15 | + |
| 16 | + # To compile the planner with support for CPLEX, download the 64-bit Linux |
| 17 | + # installer of CPLEX 22.1.1 and set the environment variable |
| 18 | + # DOWNWARD_LP_INSTALLERS to an absolute path containing them before |
| 19 | + # provisioning the VM. |
| 20 | + provision_env = {} |
| 21 | + if !ENV["DOWNWARD_LP_INSTALLERS"].nil? |
| 22 | + cplex_installer = ENV["DOWNWARD_LP_INSTALLERS"] + "/cplex_studio2211.linux_x86_64.bin" |
| 23 | + if File.exists?(cplex_installer) |
| 24 | + config.vm.synced_folder ENV["DOWNWARD_LP_INSTALLERS"], "/lp", :mount_options => ["ro"] |
| 25 | + provision_env["CPLEX_INSTALLER"] = "/lp/" + File.basename(cplex_installer) |
| 26 | + end |
| 27 | + end |
| 28 | + |
| 29 | + config.vm.provision "shell", env: provision_env, inline: <<-SHELL |
| 30 | + |
| 31 | + apt-get update && apt-get install --no-install-recommends -y \ |
| 32 | + ca-certificates \ |
| 33 | + cmake \ |
| 34 | + default-jre \ |
| 35 | + g++ \ |
| 36 | + git \ |
| 37 | + libgmp3-dev \ |
| 38 | + make \ |
| 39 | + python3 \ |
| 40 | + unzip \ |
| 41 | + zlib1g-dev |
| 42 | + |
| 43 | + if [ -f "$CPLEX_INSTALLER" ]; then |
| 44 | + # Set environment variables for CPLEX. |
| 45 | + cat > /etc/profile.d/downward-cplex.sh <<-EOM |
| 46 | + export cplex_DIR="/opt/ibm/ILOG/CPLEX_Studio2211/cplex" |
| 47 | + EOM |
| 48 | + source /etc/profile.d/downward-cplex.sh |
| 49 | + |
| 50 | + # Install CPLEX. |
| 51 | + $CPLEX_INSTALLER -DLICENSE_ACCEPTED=TRUE -i silent |
| 52 | + fi |
| 53 | + |
| 54 | + # Set environment variables for SoPlex. |
| 55 | + cat > /etc/profile.d/downward-soplex.sh <<-EOM |
| 56 | + export soplex_DIR="/opt/soplex" |
| 57 | + EOM |
| 58 | + source /etc/profile.d/downward-soplex.sh |
| 59 | + git clone --depth 1 --branch release-710 https://github.com/scipopt/soplex.git soplex |
| 60 | + cd soplex |
| 61 | + cmake -DCMAKE_INSTALL_PREFIX="$soplex_DIR" -S . -B build |
| 62 | + cmake --build build |
| 63 | + cmake --install build |
| 64 | + |
| 65 | + cd /home/vagrant |
| 66 | + |
| 67 | + if ! [ -e downward ] ; then |
| 68 | + git clone --branch release-24.06.0 https://github.com/aibasel/downward.git downward |
| 69 | + ./downward/build.py release debug |
| 70 | + chown -R vagrant.vagrant downward |
| 71 | + fi |
| 72 | + |
| 73 | + SHELL |
| 74 | +end |
0 commit comments