3.11.1. Installation Instructions for Microsoft Windows

3.11.1.1. MiniZinc

Required development tools:

Unpack the source code (or clone the git repository). Open a command prompt and change into the source code directory. The following sequence of commands will build a 64 bit version of the MiniZinc compiler tool chain (you may need to adapt the cmake command to fit your version of Visual Studio):

mkdir build
cd build
cmake -G"Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX="C:/Program Files/MiniZinc" ..
cmake --build . --config Release --target install

This will install MiniZinc in the usual Program Files location. You can change where it gets installed by modifying the CMAKE_INSTALL_PREFIX.

3.11.1.2. MiniZinc IDE

Required development tools:

Unpack the source code (or clone the git repository). Open a Visual Studio command prompt that matches the version of the Qt libraries installed on your system. Change into the source code directory for the MiniZinc IDE. Then use the following commands to compile:

mkdir build
cd build
qmake ../MiniZincIDE
nmake

3.11.1.3. Gecode

You can obtain the Gecode source code from GitHub (https://github.com/gecode/gecode). You can find detailed compilation instructions for Gecode on its web site (https://www.gecode.org). Gecode’s build system relies on some Unix tools, so you may have to install an environment such as Cygwin. In short, to compile from source, run the following in a terminal from within the Gecode source code directory, where you replace <INSTALLATION_PREFIX> with the path where you want Gecode to be installed:

mkdir build
cd build
../configure --prefix=<INSTALLATION_PREFIX>
make -j8
make install

After installing Gecode, you can compile MiniZinc with built-in support for Gecode, which enables extended pre-solving and solution checking. In order for the MiniZinc compilation to find your Gecode installation, you have to use the option -DGECODE_ROOT= when calling cmake.

In order to use Gecode as a solver with MiniZinc (as opposed to an internal pre-solving tool), you have to create an appropriate solver configuration file. Add a file gecode.msc in an appropriate location (see Solver Configuration Files) containing the following, where you replace with the actual installation path and update the version number if necessary:

{
 "id": "org.gecode.gecode",
 "name": "Gecode",
 "description": "Gecode FlatZinc executable",
 "version": "6.2.0",
 "mznlib": "<INSTALLATION_PREFIX>/share/gecode/mznlib",
 "executable": "<INSTALLATION_PREFIX>/bin/fzn-gecode",
 "tags": ["cp","int", "float", "set", "restart"],
 "stdFlags": ["-a","-f","-n","-p","-r","-s","-t"],
 "supportsMzn": false,
 "supportsFzn": true,
 "needsSolns2Out": true,
 "needsMznExecutable": false,
 "needsStdlibDir": false,
 "isGUIApplication": false
}

3.11.1.4. Chuffed

You can obtain Chuffed’s source from https://github.com/chuffed/chuffed. You can compile and install it using the following commands:

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=<INSTALLATION_PREFIX>
cmake --build .
cmake --build . --target install

This will install Chuffed in the installation directory specified as .

In order for MiniZinc to recognise the Chuffed solver, add a configuration file chuffed.msc to an appropriate location (see Solver Configuration Files) with the following content, where you replace with the actual installation path and update the version number if necessary:

{
 "id": "org.chuffed.chuffed",
 "name": "Chuffed",
 "description": "Chuffed FlatZinc executable",
 "version": "0.9",
 "mznlib": "<INSTALLATION_PREFIX>/share/chuffed/mznlib",
 "executable": "<INSTALLATION_PREFIX>/bin/fzn-chuffed",
 "tags": ["cp","lcg","int"],
 "stdFlags": ["-a","-f","-n","-r","-s","-t","-v"],
 "supportsMzn": false,
 "supportsFzn": true,
 "needsSolns2Out": true,
 "needsMznExecutable": false,
 "needsStdlibDir": false,
 "isGUIApplication": false
}

3.11.1.5. COIN-OR CBC

CBC is an open-source Mixed Integer Programming solver. You can find out more about it at https://github.com/coin-or/Cbc. MiniZinc contains a built-in interface to CBC, so in order to use it you have to install CBC before compiling MiniZinc.

These instructions apply to CBC versions 2.10/stable or newer. Thanks to David Catteeuw for help with building the parallel version of CBC.

  1. OBTAIN AND BUILD CBC

CBC is on github, but has many dependencies: https://github.com/coin-or/Cbc

AMPL provides a CBC binary and has the entire project with dependencies on github: https://github.com/ampl/coin

Building Couenne fails, but we don’t need it. Remove couenne, ipopt, and bonmin directories.

Install zlib and bzip2, e.g., using vcpkg. Its CMake integration does not work as of vcpkg 2018.11.23 so you need to use its install folder manually, e.g., by adding the following to CBC’s CMakeLists.txt:

include_directories(...vcpkg/installed/x86-windows/include)
link_libraries(...vcpkg/installed/x86-windows/lib/zlib.lib)
link_libraries(...vcpkg/installed/x86-windows/lib/bz2.lib)

Then

$ cd C:\dev
$ git clone https://github.com/ampl/coin.git
$ cd coin
$ rmdir /s Bonmin
$ rmdir /s Couenne
$ rmdir /s Ipopt
$ mkdir build
$ cd build
$ cmake .. -G "Visual Studio 15 2017" -A x64 -DCMAKE_INSTALL_PREFIX=C:\dev\Cbc_install
$ cmake --build . --target install

=> successfully builds Cbc.lib, debug version in C:\dev\coin\build\Debug.

  1. BUILD MINIZINC WITH CBC

Copy C:\dev\coin\build\Debug\*.lib to C:\dev\Cbc_install\lib

Configure MiniZinc’s CMake with -DOSICBC_ROOT=C:\dev\cbc_install.