93be33a6c2 Add complete predicate REVERT: 4f10c82056 Merge branch 'MiniZinc:master' into feature/on_restart REVERT: 0848ce7ec7 Add changelog for 2.5.5 REVERT: 44e2f770d5 Add test for insertion of ArrayLits into CSE REVERT: 8a68d3dea8 Don't insert par expressions into CSE map unless they're an ArrayLit REVERT: 6bf6f1180f Increase version number of development build REVERT: dcaac92a74 Make min/max on array of opt vars return non-optional var. This is consistent with other functions on optional arrays like sum, product, exists, forall. REVERT: 32aa288884 Update changelog REVERT: a4edf0669f Fix flattening of all-par set literals REVERT: 8c1c9605f6 Fix chain compressor, needs to ignore par constants REVERT: 0cad1c6306 Use file_path on include paths to ensure separator consistency REVERT: 05ad7d1931 Update changelog REVERT: 22f5e2557b Define HAVE_CONFIG_H only for UNIX REVERT: 81c7778d55 Define HAVE_CONFIG_H for CBC REVERT: 1f56608e10 mzn-test: don't check symmetry breaking constraints REVERT: 1a9767457e mzn-test: fix parsing %%%mzn-stat: ... output REVERT: a41533fd54 MIP: report CPU time in %%%mzn-stat: solveTime= REVERT: 9d490acd52 Updated docs on OR-Tools v8 installation REVERT: c513f6599f Add changelog for 2.5.4 REVERT: b2eef2772b Follow ids to declarations when flattening par arrays. Fixes #448. REVERT: c5c846d426 Check if result of flattening rhs of a vardecl is par. REVERT: c496052767 Escape strings when pretty printing include items REVERT: 9e379c995e Canonicalise file names before adding include items into "already seen" list REVERT: d5d5d0d88c Use generic flattening inside generators. Fixes #451. REVERT: dc8630a6e9 Small fix to multi-pass library change: use original include path if it is absolute REVERT: 79c6092bd8 Strip library paths from includes in multi-pass compilation. Fixes #455. REVERT: 897875d6d7 Compile infinite domains with holes into constraints. Fixes #457. REVERT: b4e700dc67 Don't create copies of global declarations when creating par versions of functions REVERT: 0e8cc42bb1 Fix typechecker to coerce bool to int in the objective. REVERT: e05523b344 Add test for dzn output of arrays REVERT: 1e0269000e Don't evaluate output_only arrays when generating dzn output. REVERT: 57018c31d6 Fix matrix transposition in lex2 globals REVERT: 2617c0c829 Fix output variables in lex_chain tests REVERT: ef1a250c98 another efort to fix tests REVERT: c00e199dfd Fix test globals_lex_chain.mzn REVERT: b5c997d045 Fix code analysis REVERT: 3352cf0bd5 SCIP constraint handler for lex_chain_..._orbitope REVERT: 4e71a2cc97 Globals lex_chain_..., including lex_chain_..._orbitope REVERT: d807428baf Move test specifcation into the correct folder REVERT: 5be74bc74d MIP decompositions for lex_less_(bool, int, float) REVERT: 36a554ba40 Don't modify infinte domain of optional variables. Fixes #456. REVERT: f9e5306d75 Run clang-format REVERT: 4b57667608 Fix comment reference to relevant test case REVERT: 648f2ab36d Fix equality of indirection annotations REVERT: ef7be5fd78 MIP decompositions for lex_lesseq_(bool=int, float) REVERT: 6511b14e73 Propagate cv flag correctly. REVERT: 6f27ecf1c0 Never insert par expressions into the CSE map. REVERT: 7414f3ca0f Fix cplex id in example configuration REVERT: 7ad7cec506 Update strictly_decreasing with documentation and opt version REVERT: 8029f6e957 Support undefined enums in type checker. REVERT: 79e0f0f546 Revert using mzn_in_symmetry_breaking_constraint() for SCIP's orbisack REVERT: e88efda76c Fix format REVERT: 4802031dc1 Added test mzn_in_symmetry_breaking_constraint() REVERT: e21cc2515a More format fixes 02 ... REVERT: 5bbd67c130 More format fixes... REVERT: d5f9b777ea Format fixes REVERT: 43757a09a0 Remove MIP-specific fzn_less(eq)_bool(_reif).mzn REVERT: c93b5736a3 SCIP: orbisack constraint handler 'fzn_lex_lesseq__orbisack' REVERT: 4516bb4e2c mzn-test.py: add OR-Tools as checker REVERT: e2176f017d Add fix and test for crash with empty enum. REVERT: ac7db35951 Fix documentation bugs. REVERT: 47ba245832 Fix the incorrect renaming of key in model output interface REVERT: 925796ed20 Fail on empty var domains in agenda REVERT: 1ec19d7025 Fix error messages in CMake FindGurobi, FindCPlex REVERT: 6d169475c1 mzn-test.py: Use -i for intermediate solutions REVERT: df2f3e423a Allow coercion of JSON lists to enum definitions REVERT: 2b0b8165e5 Fix clang-tidy errors REVERT: 6597bc1920 Change the CI build image location REVERT: 360c988452 Remove illegal duplicate keys in .gitlab-ci.yml REVERT: 6a5d69c64b Add missing par opt versions of coercion functions REVERT: 63014e3d8f Don't propagate annotations into annotation calls. Avoids infinite recursion. REVERT: 54b19428ab Don't use GRB_INT_PAR_NONCONVEX if it's undefined REVERT: a5bb56c47d Added piecewise_linear for non-continuous intervals git-subtree-dir: software/minizinc git-subtree-split: 93be33a6c254e54be7cd38abb7ebd6a6022f0c46
256 lines
9.4 KiB
ReStructuredText
256 lines
9.4 KiB
ReStructuredText
.. _ch-installation_detailed_linux:
|
|
|
|
Installation Instructions for Linux and macOS
|
|
---------------------------------------------
|
|
|
|
These instructions should work for most Linux distributions.
|
|
|
|
MiniZinc
|
|
~~~~~~~~
|
|
|
|
Required development tools:
|
|
|
|
- CMake, version 3.4.0 or later
|
|
- On Linux: A recent C++ compiler (g++ or clang)
|
|
- On macOS: The Xcode developer tools
|
|
|
|
Before compiling MiniZinc, consider whether you want to install additional solvers. In particular, MIP solvers such as CBC, SCIP, Gurobi, IBM ILOG CPLEX, and XPRESS need to be installed prior to compiling MiniZinc, so that the build system can find them. If you want to use the solution checking functionality or extended presolving, you will also need to install Gecode before compiling MiniZinc. See below for installation instructions for these solvers.
|
|
|
|
To install 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:
|
|
|
|
.. code-block:: bash
|
|
|
|
mkdir build
|
|
cd build
|
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
|
cmake --build .
|
|
|
|
MiniZinc IDE
|
|
~~~~~~~~~~~~
|
|
|
|
Required development tools:
|
|
|
|
- A recent C++ compiler (g++ or clang)
|
|
- Qt toolkit, version 5.9 or later (http://qt.io)
|
|
|
|
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:
|
|
|
|
.. code-block:: bash
|
|
|
|
mkdir build
|
|
cd build
|
|
qmake ../MiniZincIDE
|
|
make
|
|
|
|
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). In short, to compile from source, run the following in a terminal (from within the Gecode source code directory):
|
|
|
|
.. code-block:: bash
|
|
|
|
mkdir build
|
|
cd build
|
|
../configure
|
|
make -j8
|
|
sudo make install
|
|
|
|
which compiles Gecode and installs it in the standard location. You can choose a different installation directory using ``../configure --prefix=<INSTALLATION_PREFIX>``. In that case you can run ``make install`` without ``sudo``.
|
|
|
|
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, Gecode either has to be in the default location (such as ``/usr/local/include`` etc.), or you have to use the option ``-DGECODE_ROOT=<INSTALLATION_PREFIX>`` 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 :ref:`sec-cmdline-conffiles`) containing the following, where you replace ``<INSTALLATION_PREFIX>`` with the actual installation path and update the version number if necessary:
|
|
|
|
.. code-block:: json
|
|
|
|
{
|
|
"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
|
|
}
|
|
|
|
|
|
OR Tools
|
|
~~~~~~~~
|
|
|
|
You can install the OR-Tools FlatZinc module as binary or obtain the source code from GitHub (https://github.com/google/or-tools).
|
|
You can find detailed compilation instructions for OR-Tools on https://developers.google.com/optimization/.
|
|
To compile the FlatZinc module from source, run the following in a terminal (from within the OR-Tools source code directory):
|
|
|
|
.. code-block:: bash
|
|
|
|
make fz -j8
|
|
make test_fz
|
|
|
|
In order to use OR-Tools with MiniZinc, you have to create an appropriate solver configuration file.
|
|
Add a file ``ortools.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:
|
|
|
|
.. code-block:: json
|
|
|
|
{
|
|
"id": "org.ortools.ortools",
|
|
"name": "OR Tools",
|
|
"description": "Or Tools FlatZinc executable",
|
|
"version": "7.0/stable",
|
|
"mznlib": "<INSTALLATION_PREFIX>/ortools/flatzinc/mznlib_sat",
|
|
"executable": "<INSTALLATION_PREFIX>/bin/fz",
|
|
"tags": ["cp","int", "lcg", "or-tools"],
|
|
"stdFlags": ["-a", "-n", "-p", "-f", "-r", "-v", "-l", "-s"],
|
|
"supportsMzn": false,
|
|
"supportsFzn": true,
|
|
"needsSolns2Out": true,
|
|
"needsMznExecutable": false,
|
|
"needsStdlibDir": false,
|
|
"isGUIApplication": false
|
|
}
|
|
|
|
|
|
Chuffed
|
|
~~~~~~~
|
|
|
|
You can obtain Chuffed's source from https://github.com/chuffed/chuffed. You can compile and install it using the following commands:
|
|
|
|
.. code-block:: bash
|
|
|
|
mkdir build
|
|
cd build
|
|
cmake ..
|
|
cmake --build . -- -j8
|
|
sudo cmake --build . --target install
|
|
|
|
This will install Chuffed in the default location. Alternatively, you can choose a different installation directory by calling ``cmake .. -DCMAKE_INSTALL_PREFIX=<INSTALLATION_PREFIX>`` before ``cmake --build``. In that case, you may be able to install without using ``sudo``.
|
|
|
|
In 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:
|
|
|
|
.. code-block:: json
|
|
|
|
{
|
|
"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
|
|
}
|
|
|
|
|
|
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.
|
|
|
|
To download and compile CBC, run the following:
|
|
|
|
.. code-block:: bash
|
|
|
|
svn checkout https://projects.coin-or.org/svn/Cbc/stable/2.10/ Cbc-stable
|
|
cd Cbc-stable
|
|
./configure --enable-cbc-parallel
|
|
make
|
|
sudo make install
|
|
|
|
This will install CBC in the default location. You can choose a different installation directory using ``../configure --enable-cbc-parallel --prefix=<INSTALLATION_PREFIX>``. In that case you can run ``make install`` without ``sudo``.
|
|
|
|
The MiniZinc build system should find CBC automatically if it is installed in the default location. You can use the command line flag ``-DOSICBC_ROOT=<INSTALLATION_PREFIX>`` when running ``cmake`` for MiniZinc if you installed CBC in a different location.
|
|
|
|
SCIP
|
|
~~~~
|
|
|
|
For *SCIP (as of 7.0.0)*, it seems best to install the binary package because it also installs the include files and thus even when compiling MiniZinc from source,
|
|
SCIP is invoked; moreover the binary package has all the bells&whistles like symmetry handling and IPOPT. Use the ``scipoptsuite`` binary installation.
|
|
|
|
If you want to compile ``scipoptsuite``, the installation commands should be as follows.
|
|
|
|
1. Download the SCIP Optimization Suite 7.0.0 source code: https://scip.zib.de/download.php?fname=scipoptsuite-7.0.0.tgz
|
|
|
|
2. Untar it and change into scipoptsuite-7.0.0.
|
|
|
|
3. Run the following commands:
|
|
|
|
.. code-block:: bash
|
|
|
|
mkdir build
|
|
cd build
|
|
cmake .. [-DSOPLEX_DIR=/path/to/soplex]
|
|
make
|
|
# optional: run a quick check on some instances
|
|
make check
|
|
# optional: install scip executable, library, and headers
|
|
# Helps MiniZinc find SCIP if in the standard location
|
|
make install
|
|
|
|
4. You might want to install LAPACK, bliss patch and any other support libraries for performance.
|
|
|
|
|
|
For *SCIP (as of 6.0.1.0)*, the installation commands should be as follows.
|
|
|
|
1. Download the SCIP Optimization Suite 6.0.1 (or higher) source code: https://scip.zib.de/download.php?fname=scipoptsuite-6.0.1.tgz
|
|
|
|
2. Untar it and change directories into scipoptsuite-6.0.1
|
|
|
|
3. create a build directory and change directories there
|
|
|
|
4. Execute
|
|
|
|
.. code-block:: bash
|
|
|
|
cmake .. -DCMAKE_BUILD_TYPE=Release [-DCMAKE_INSTALL_PREFIX=/home/user/local/scip/installation]
|
|
|
|
The first flag is necessary, the second one is optional in order to install SCIP and SoPlex non-systemwide.
|
|
|
|
5. Compile and install SoPlex, SCIP, and its optional components:
|
|
|
|
.. code-block:: bash
|
|
|
|
make && make install
|
|
|
|
6. Configure minizinc:
|
|
|
|
.. code-block:: bash
|
|
|
|
cmake .. -DUSE_PROPRIETARY=on [-DCMAKE_PREFIX_PATH=/home/user/local/scip/installation]
|
|
|
|
The optional prefix path variable is only necessary if you installed SCIP in a non-systemwide directory.
|
|
|
|
7. Compile Minizinc and enjoy SCIP as a solver.
|
|
|
|
If you have folders for SCIP and SoPlex separately, follow these steps:
|
|
|
|
.. code-block:: bash
|
|
|
|
$ tar xvfz scipoptsuite-6.0.1.tgz
|
|
$ cd scipoptsuite-6.0.1
|
|
$ cd soplex
|
|
$ mkdir build
|
|
$ cd build
|
|
$ cmake ..
|
|
$ make -j5
|
|
$ cd ../scip
|
|
$ mdkir build
|
|
$ cd build
|
|
$ cmake .. -DSOPLEX_DIR=~/Downloads/Software/scipoptsuite-6.0.1/soplex/build
|
|
$ make -j5
|
|
$ sudo make install ## Now MZN should find it
|