this repo has no description
at develop 6.5 kB view raw
1.. _ch-installation_detailed_windows: 2 3Installation Instructions for Microsoft Windows 4----------------------------------------------- 5 6MiniZinc 7~~~~~~~~ 8 9Required development tools: 10 11- CMake, version 3.4.0 or later (https://cmake.org) 12- Microsoft Visual C++ 2013 or later (e.g. the Community Edition available from https://www.visualstudio.com/de/downloads/) 13- Optional, only needed for MiniZinc IDE: Qt toolkit, version 5.9 or later (http://qt.io) 14 15Unpack 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): 16 17.. code-block:: bash 18 19 mkdir build 20 cd build 21 cmake -G"Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX="C:/Program Files/MiniZinc" .. 22 cmake --build . --config Release --target install 23 24This will install MiniZinc in the usual Program Files location. You can change where it gets installed by modifying the ``CMAKE_INSTALL_PREFIX``. 25 26MiniZinc IDE 27~~~~~~~~~~~~ 28 29Required development tools: 30 31- Microsoft Visual C++ 2013 or later (e.g. the Community Edition available from https://www.visualstudio.com/de/downloads/) 32- Qt toolkit, version 5.9 or later (http://qt.io) 33 34Unpack 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: 35 36.. code-block:: bash 37 38 mkdir build 39 cd build 40 qmake ../MiniZincIDE 41 nmake 42 43Gecode 44~~~~~~ 45 46You 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: 47 48.. code-block:: bash 49 50 mkdir build 51 cd build 52 ../configure --prefix=<INSTALLATION_PREFIX> 53 make -j8 54 make install 55 56After 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=<INSTALLATION_PREFIX>`` when calling ``cmake``. 57 58In 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 :ref:`sec-cmdline-conffiles`) containing the following, where you replace ``<INSTALLATION_PREFIX>`` with the actual installation path and update the version number if necessary: 59 60.. code-block:: json 61 62 { 63 "id": "org.gecode.gecode", 64 "name": "Gecode", 65 "description": "Gecode FlatZinc executable", 66 "version": "6.2.0", 67 "mznlib": "<INSTALLATION_PREFIX>/share/gecode/mznlib", 68 "executable": "<INSTALLATION_PREFIX>/bin/fzn-gecode", 69 "tags": ["cp","int", "float", "set", "restart"], 70 "stdFlags": ["-a","-f","-n","-p","-r","-s","-t"], 71 "supportsMzn": false, 72 "supportsFzn": true, 73 "needsSolns2Out": true, 74 "needsMznExecutable": false, 75 "needsStdlibDir": false, 76 "isGUIApplication": false 77 } 78 79 80Chuffed 81~~~~~~~ 82 83You can obtain Chuffed's source from https://github.com/chuffed/chuffed. You can compile and install it using the following commands: 84 85.. code-block:: bash 86 87 mkdir build 88 cd build 89 cmake .. -DCMAKE_INSTALL_PREFIX=<INSTALLATION_PREFIX> 90 cmake --build . 91 cmake --build . --target install 92 93This will install Chuffed in the installation directory specified as ``<INSTALLATION_PREFIX>``. 94 95In order for MiniZinc to recognise the Chuffed solver, add a configuration file ``chuffed.msc`` to an appropriate location (see :ref:`sec-cmdline-conffiles`) with the following content, where you replace ``<INSTALLATION_PREFIX>`` with the actual installation path and update the version number if necessary: 96 97.. code-block:: json 98 99 { 100 "id": "org.chuffed.chuffed", 101 "name": "Chuffed", 102 "description": "Chuffed FlatZinc executable", 103 "version": "0.9", 104 "mznlib": "<INSTALLATION_PREFIX>/share/chuffed/mznlib", 105 "executable": "<INSTALLATION_PREFIX>/bin/fzn-chuffed", 106 "tags": ["cp","lcg","int"], 107 "stdFlags": ["-a","-f","-n","-r","-s","-t","-v"], 108 "supportsMzn": false, 109 "supportsFzn": true, 110 "needsSolns2Out": true, 111 "needsMznExecutable": false, 112 "needsStdlibDir": false, 113 "isGUIApplication": false 114 } 115 116 117COIN-OR CBC 118~~~~~~~~~~~ 119 120CBC 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. 121 122These instructions apply to CBC versions 2.10/stable or newer. Thanks to David Catteeuw for help with building the parallel version of CBC. 123 1241. OBTAIN AND BUILD CBC 125 126 CBC is on github, but has many dependencies: https://github.com/coin-or/Cbc 127 128 AMPL provides a CBC binary and has the entire project with dependencies on github: https://github.com/ampl/coin 129 130 Building Couenne fails, but we don't need it. Remove couenne, ipopt, and bonmin directories. 131 132 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, 133 e.g., by adding the following to CBC's CMakeLists.txt: 134 135 :: 136 137 include_directories(...vcpkg/installed/x86-windows/include) 138 link_libraries(...vcpkg/installed/x86-windows/lib/zlib.lib) 139 link_libraries(...vcpkg/installed/x86-windows/lib/bz2.lib) 140 141 Then 142 143 .. code-block:: bash 144 145 $ cd C:\dev 146 $ git clone https://github.com/ampl/coin.git 147 $ cd coin 148 $ rmdir /s Bonmin 149 $ rmdir /s Couenne 150 $ rmdir /s Ipopt 151 $ mkdir build 152 $ cd build 153 $ cmake .. -G "Visual Studio 15 2017" -A x64 -DCMAKE_INSTALL_PREFIX=C:\dev\Cbc_install 154 $ cmake --build . --target install 155 156 => successfully builds ``Cbc.lib``, debug version in ``C:\dev\coin\build\Debug``. 157 158 1592. BUILD MINIZINC WITH CBC 160 161 Copy ``C:\dev\coin\build\Debug\*.lib`` to ``C:\dev\Cbc_install\lib`` 162 163 Configure MiniZinc's CMake with ``-DOSICBC_ROOT=C:\dev\cbc_install``.