9

I'm currently working on MiniZinc, and i have been running my models with the two solvers integrated in MiniZinc: Gecode and Chuffed. I've been running it in the IDE, but i am aware that it can be runned in bash too (using minizinc command).

But i would like to test how my models do with Google's CP solver, called OR-Tools. But i really don't know how. I got the MiniZinc snap installation in Ubuntu 18.04, but i can download a fresh directory of MiniZinc and run it locally, and configure the solver there (and not in snap installation since snap directories can not be modified).

I need a way to install OR-Tools and make it work at least in the terminal (but run it from the IDE would be perfect).

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Juan Marcos
  • 115
  • 1
  • 7

1 Answers1

13

MiniZinc uses solver configuration files to find the available solver. If, however, the solver does not provide a configuration file. The IDE can help you add a user configuration file for the solver in the following simple steps.

  1. Open the preferences window.
  2. In the solver selection, select "Add new..."

Add new solver

  1. Enter the details of the solver you want to add. Most importantly the location of the executable and the location of their MiniZinc library.

Enter Solver details

Edit/Addition: Obtaining the necessary executables

As mentioned by Stradivari in the comment above, releases are distributed at or-tools @ Github.

Pick the corresponding asset from one of those following the or-tools_{XXX}_{VERSION}.zip naming scheme.

Andreas Violaris
  • 2,465
  • 5
  • 13
  • 26
Dekker1
  • 5,565
  • 25
  • 33
  • 1
    It supports -a, -n, -s, -v, -p, -f, -t. Not sure about -r – Laurent Perron May 01 '20 at 13:37
  • 1
    By the way @Dekker1 how can you do this in MiniZinc Command Line? I'm trying to build a docker container with MiniZinc + OR Tools solver installed by default. – Juan Marcos May 17 '20 at 17:25
  • 1
    You can just copy the file created by the IDE (store in `.minizinc/solvers`) to you Docker image – Dekker1 May 18 '20 at 03:47
  • I installed or-tools with pip in MacOS, but I don't find any bin folder in "/Users/my_name/Library/Python/3.8/lib/python/site-packages". Is it at somewhere else? – Kun Hu Oct 02 '20 at 19:39
  • The full path is "/Users/my_name/Library/Python/3.8/lib/python/site-packages/ortools" – Kun Hu Oct 02 '20 at 20:55
  • the minizinc interpreter is not a python package. – Laurent Perron Nov 01 '21 at 13:55
  • Starting with the 9.4 version, there is no flatzinc asset (or-tools_flatzinc_{XXX}_{VERSION}.zip) on github. Instead, one should use the `cpp` asset, e.g. `or-tools_amd64_archlinux_cpp_v9.5.2237.tar.gz` for version 9.5 for arch linux. Additional source on the topic: https://github.com/google/or-tools/issues/3457 – Mateusz Ślażyński Jan 12 '23 at 23:28