1.2. Installation¶

A complete installation of the MiniZinc system comprises the MiniZinc compiler tool chain, one or more solvers, and (optionally) the MiniZinc IDE. We provide fully self-contained binary packages for all major operating systems that contain all of these components. Alternatively, it is possible to compile all components from source code.

1.2.1. Binary Packages¶

The easiest way to get a full, working MiniZinc system is to use the bundled binary packages, available from http://www.minizinc.org/software.html.

The bundlded binary packages contain the compiler and IDE, as well as the following solvers: Gecode, Chuffed, COIN-OR CBC, and a Gurobi interface (the Gurobi library itself is not included). For backwards compatibility with older versions of MiniZinc, the packages also contain the now deprecated G12 suite of solvers (G12 fd, G12 lazy, G12 MIP).

1.2.1.1. Microsoft Windows¶

To install the bundled binary packages, simply download the installer, double-click to execute it, and follow the prompts. Note: you should select the 64 bit version of the installer if your Windows is a 64 bit operating system, otherwise pick the 32 bit version.

After installation is complete, you can find the MiniZinc IDE installed as a Windows application. The file extensions .mzn, .dzn and .fzn are linked to the IDE, so double-clicking any MiniZinc file should open it in the IDE.

If you want to use MiniZinc from a command prompt, you need to add the installation directory to the PATH environment variable. In a Windows command prompt you could use the following command:

C:\>setx PATH "%PATH%;C:\Program Files\MiniZinc 2.2.2 (bundled)\"


1.2.1.2. Linux¶

The MiniZinc bundled binary distribution for Linux is provided as an archive that contains everything that is needed to run MiniZinc. It was compiled on a Ubuntu 16.04 LTS system, but it bundles all required libraries except for the system C and C++ libraries (so it should be compatible with any Linux distribution that uses the same C and C++ libraries as Ubuntu 16.04). Note: you should select the 64 bit version of the installer if your Linux is a 64 bit operating system, otherwise pick the 32 bit version.



1.2.2. Compilation from Source Code¶

All components of MiniZinc are free and open source software, and compilation should be straightforward if you have all the necessary build tools installed. However, third-party components, in particular the different solvers, may be more difficult to install correctly, and we cannot provide any support for these components.

The source code for MiniZinc can be downloaded from its GitHub repository at https://github.com/MiniZinc/libminizinc. The source code for the MiniZinc IDE is available from https://github.com/MiniZinc/MiniZincIDE.

You will also need to install additional solvers to use with MiniZinc. To get started, try Gecode (http://www.gecode.org) or Chuffed (https://github.com/chuffed/chuffed). We don’t cover installation instructions for these solvers here.

1.2.2.1. Microsoft Windows¶

Required development tools:

Compiling MiniZinc: 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.

Compiling the MiniZinc IDE: 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


1.2.2.2. Linux¶

Required development tools:

• CMake, version 3.0.0 or later
• A recent C++ compiler (g++ or clang)
• Optional, only needed for MiniZinc IDE: Qt toolkit, version 5.4 or later (http://qt.io)

Compiling MiniZinc: Unpack the source code (or clone the git repository). Open a terminal and change into the source code directory. The following sequence of commands will build the MiniZinc compiler tool chain:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .


Compiling the MiniZinc IDE: Unpack the source code (or clone the git repository). Open a terminal and change into the source code directory for the MiniZinc IDE. Then use the following commands to compile:

mkdir build
cd build
qmake ../MiniZincIDE
make


1.2.2.3. Apple macOS¶

Required development tools:

• CMake, version 3.0.0 or later (from http://cmake.org or e.g. through homebrew)
• The Xcode developer tools
• Optional, only needed for MiniZinc IDE: Qt toolkit, version 5.4 or later (http://qt.io)

Compiling MiniZinc: Unpack the source code (or clone the git repository). Open a terminal and change into the source code directory. The following sequence of commands will build the MiniZinc compiler tool chain:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .


Compiling the MiniZinc IDE: Unpack the source code (or clone the git repository). Open a terminal and change into the source code directory for the MiniZinc IDE. Then use the following commands to compile:

mkdir build
cd build
qmake ../MiniZincIDE
make