change cmake/README.md
This commit is contained in:
167
cmake/README.md
167
cmake/README.md
@@ -91,7 +91,7 @@ Here the list of supported solvers:
|
||||
* HiGHS\*
|
||||
* PDLP
|
||||
* SCIP
|
||||
* XPRESS\*
|
||||
* XPRESS
|
||||
|
||||
\*: these solvers are disabled by default.
|
||||
|
||||
@@ -127,7 +127,6 @@ support for the following third-party solvers:
|
||||
note: You must enable the support of GLPK solver by using `-DUSE_GLPK=ON`
|
||||
(`OFF` by default).
|
||||
* CPLEX (`USE_CPLEX`),
|
||||
* XPRESS (`USE_XPRESS`)
|
||||
|
||||
**warning: Since these solvers are either proprietary (and require a specific
|
||||
license) or available under the GPL, we can't test them on public CI and their
|
||||
@@ -145,14 +144,6 @@ For ease of migration from legacy `make third_party` builds, CMake will also
|
||||
read the CPLEX installation path from the `UNIX_CPLEX_DIR` environment variable,
|
||||
if defined.
|
||||
|
||||
### Enabling XPRESS Support
|
||||
|
||||
To enable XPRESS support, configure with `-DUSE_XPRESS=ON` and
|
||||
`-DXPRESS_ROOT=/absolute/path/to/XPRESS/root/dir`, replacing
|
||||
`/absolute/path/to/XPRESS/root/dir` with the path to your XPRESS installation.
|
||||
`XPRESS_ROOT` can also be defined as an environment variable rather than an
|
||||
option at configure time.
|
||||
|
||||
## CMake Options
|
||||
|
||||
There are several options that can be passed to CMake to modify how the code
|
||||
@@ -181,84 +172,84 @@ Following is a list of available options, for the full list run:
|
||||
cmake -S. -Bbuild -LH
|
||||
```
|
||||
|
||||
| CMake Option | Default Value | Note |
|
||||
|:-------------|:--------------|:-----|
|
||||
| `CMAKE_BUILD_TYPE` | Release | see CMake documentation [here](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html) |
|
||||
| `BUILD_CXX` | ON | Build C++ |
|
||||
| `BUILD_DOTNET` | OFF | Build .Net wrapper and packages |
|
||||
| `BUILD_JAVA` | OFF | Build Java wrapper and packages |
|
||||
| `BUILD_PYTHON` | OFF | Build Python wrapper and package |
|
||||
| | | |
|
||||
| `BUILD_FLATZINC` | ON\* | Build the flatzinc library<br>**Forced** to OFF if `BUILD_CXX=OFF` |
|
||||
| `BUILD_GLOP` | OFF\* | Build the standalone Glop library<br>**Forced** to OFF if `BUILD_CXX=ON`, otherwise default to ON |
|
||||
| | | |
|
||||
| `BUILD_DEPS` | OFF* | Default to ON if `BUILD_JAVA=ON` or `BUILD_PYTHON=ON` or `BUILD_DOTNET=ON` |
|
||||
| `BUILD_ZLIB` | OFF* | Static build the zlib library<br>**Forced** to ON if `BUILD_DEPS=ON` |
|
||||
| `BUILD_absl` | OFF* | Static build the abseil-cpp libraries<br>**Forced** to ON if `BUILD_DEPS=ON` |
|
||||
| `BUILD_Protobuf` | OFF* | Static build the protobuf libraries<br>**Forced** to ON if `BUILD_DEPS=ON` |
|
||||
| `BUILD_re2` | OFF* | Static build the re2 libraries<br>**Forced** to ON if `BUILD_DEPS=ON` |
|
||||
| `BUILD_Eigen3` | OFF* | Static build the Eigen3 libraries<br>**Forced** to ON if `BUILD_DEPS=ON` |
|
||||
| | | |
|
||||
| `USE_COINOR` | ON\* | Enable Coin-OR support<br>**Forced** to OFF if `BUILD_CXX=OFF` |
|
||||
| `BUILD_CoinUtils` | OFF\* | Static build the CoinUtils library<br>**Forced** to ON if `USE_COINOR=ON` **and** `BUILD_DEPS=ON` |
|
||||
| `BUILD_Osi` | OFF\* | Static build the Osi library<br>**Forced** to ON if `USE_COINOR=ON` **and** `BUILD_DEPS=ON` |
|
||||
| `BUILD_Clp` | OFF\* | Static build the Clp library<br>**Forced** to ON if `USE_COINOR=ON` **and** `BUILD_DEPS=ON` |
|
||||
| `BUILD_Cgl` | OFF\* | Static build the Cgl library<br>**Forced** to ON if `USE_COINOR=ON` **and** `BUILD_DEPS=ON` |
|
||||
| `BUILD_Cbc` | OFF\* | Static build the Cbc library<br>**Forced** to ON if `USE_COINOR=ON` **and** `BUILD_DEPS=ON` |
|
||||
| | | |
|
||||
| `USE_GLPK` | OFF\* | Enable GLPK support<br>**Forced** to OFF if `BUILD_CXX=OFF` |
|
||||
| `BUILD_GLPK` | OFF\* | Static build the GLPK libraries<br>**Forced** to ON if `USE_GLPK=ON` **and** `BUILD_DEPS=ON` |
|
||||
| | | |
|
||||
| `USE_HIGHS` | ON\* | Enable HIGHS support<br>**Forced** to OFF if `BUILD_CXX=OFF` |
|
||||
| `BUILD_HIGHS` | OFF\* | Static build the HiGHS libraries<br>**Forced** to ON if `USE_HIGHS=ON` **and** `BUILD_DEPS=ON` |
|
||||
| | | |
|
||||
| `USE_SCIP` | ON\* | Enable SCIP support<br>**Forced** to OFF if `BUILD_CXX=OFF` |
|
||||
| `BUILD_SCIP` | OFF\* | Static build the SCIP libraries<br>**Forced** to ON if `USE_SCIP=ON` **and** `BUILD_DEPS=ON` |
|
||||
| | | |
|
||||
| `USE_CPLEX` | OFF | Enable CPLEX support |
|
||||
| | | |
|
||||
| `USE_XPRESS` | OFF | Enable XPRESS support |
|
||||
| | | |
|
||||
| `BUILD_DOC` | OFF\* | Build all documentations |
|
||||
| `BUILD_CXX_DOC` | OFF\* | Build C++ documentation<br>**Forced** to ON if `BUILD_DOC=ON` |
|
||||
| `BUILD_DOTNET_DOC` | OFF\* | Build .Net documentation<br>**Forced** to ON if `BUILD_DOC=ON` |
|
||||
| `BUILD_JAVA_DOC` | OFF\* | Build Java documentation<br>**Forced** to ON if `BUILD_DOC=ON` |
|
||||
| `BUILD_PYTHON_DOC` | OFF\* | Build Python documentation<br>**Forced** to ON if `BUILD_DOC=ON` |
|
||||
| `INSTALL_DOC` | OFF\* | Install all documentations<br>**Forced** to OFF if `BUILD_CXX=OFF` or `BUILD_DOC=OFF` |
|
||||
| | | |
|
||||
| `BUILD_SAMPLES` | ON\* | Build all samples<br>Default to ON if `BUILD_DEPS=ON` |
|
||||
| `BUILD_CXX_SAMPLES` | ON\* | Build all C++ samples<br>**Forced** to OFF if `BUILD_CXX=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| `BUILD_DOTNET_SAMPLES` | ON\* | Build all .Net samples<br>**Forced** to OFF if `BUILD_DOTNET=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| `BUILD_JAVA_SAMPLES` | ON\* | Build all Java samples<br>**Forced** to OFF if `BUILD_JAVA=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| `BUILD_PYTHON_SAMPLES` | ON\* | Build all Python samples<br>**Forced** to OFF if `BUILD_PYTHON=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| | | |
|
||||
| `BUILD_EXAMPLES` | ON\* | Build all examples<br>Default to ON if `BUILD_DEPS=ON` |
|
||||
| `BUILD_CXX_EXAMPLES` | ON\* | Build all C++ examples<br>**Forced** to OFF if `BUILD_CXX=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| `BUILD_DOTNET_EXAMPLES` | ON\* | Build all .Net examples<br>**Forced** to OFF if `BUILD_DOTNET=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| `BUILD_JAVA_EXAMPLES` | ON\* | Build all Java examples<br>**Forced** to OFF if `BUILD_JAVA=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| `BUILD_PYTHON_EXAMPLES` | ON\* | Build all Python examples<br>**Forced** to OFF if `BUILD_PYTHON=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| | | |
|
||||
| `USE_DOTNET_46` | OFF | Enable .Net Framework 4.6 support<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| `USE_DOTNET_461` | OFF | Enable .Net Framework 4.6.1 support<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| `USE_DOTNET_462` | OFF | Enable .Net Framework 4.6.2 support<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| `USE_DOTNET_48` | OFF | Enable .Net Framework 4.8 support<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| `USE_DOTNET_STD_21` | OFF | Enable .Net Standard 2.1 support<br>Only available if `BUILD_DOTNET=ON` and not targeting arm64 platform |
|
||||
| `USE_DOTNET_CORE_31` | OFF | Enable .Net Core 3.1 LTS support<br>Only available if `BUILD_DOTNET=ON` and not targeting arm64 platform |
|
||||
| `USE_DOTNET_6` | ON | Enable .Net 6 LTS support<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| `USE_DOTNET_7` | OFF | Enable .Net 7 support<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| `UNIVERSAL_DOTNET_PACKAGE` | OFF | Build a multi platform package (i.e. `Google.OrTools` will depends on all runtime packages)<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| | | |
|
||||
| `SKIP_GPG` | ON | Disable GPG sign<br>Only available if `BUILD_JAVA=ON` |
|
||||
| `UNIVERSAL_JAVA_PACKAGE` | OFF | Build a multi platform package (i.e. `ortools-java` will depends on all native packages)<br>Only available if `BUILD_JAVA=ON` |
|
||||
| `BUILD_FAT_JAR` | OFF | Build a `ortools-java` .jar that includes all of its own Maven dependencies, including the native package<br>Only available if `BUILD_JAVA=ON` |
|
||||
| | | |
|
||||
| `BUILD_pybind11` | `BUILD_DEPS` | Static build the pybind11 libraries<br>**Forced** to ON if `BUILD_DEPS=ON`<br>Only available if `BUILD_PYTHON=ON` |
|
||||
| `BUILD_pybind11_protobuf` | `BUILD_DEPS` | Static build the pybind11_protobuf libraries<br>**Forced** to ON if `BUILD_DEPS=ON`<br>Only available if `BUILD_PYTHON=ON` |
|
||||
| `GENERATE_PYTHON_STUB` | ON | Generate python stub files<br>Only available if `BUILD_PYTHON=ON` |
|
||||
| `BUILD_VENV` | `BUILD_TESTING` | Create python venv in `BINARY_DIR/python/venv`<br>**Forced** to ON if `BUILD_TESTING=ON`<br>Only available if `BUILD_PYTHON=ON` |
|
||||
| `VENV_USE_SYSTEM_SITE_PACKAGES` | OFF | Python venv can use system site package (e.g. `py3-numpy` on Alpine)<br>Only available if `BUILD_PYTHON=ON` and `BUILD_VENV=ON` |
|
||||
| `FETCH_PYTHON_DEPS` | `BUILD_DEPS` | Fetch python modules needed to build ortools package<br>Only available if `BUILD_PYTHON=ON` |
|
||||
| | | |
|
||||
| CMake Option | Default Value | Note |
|
||||
|:-------------|:----------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `CMAKE_BUILD_TYPE` | Release | see CMake documentation [here](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html) |
|
||||
| `BUILD_CXX` | ON | Build C++ |
|
||||
| `BUILD_DOTNET` | OFF | Build .Net wrapper and packages |
|
||||
| `BUILD_JAVA` | OFF | Build Java wrapper and packages |
|
||||
| `BUILD_PYTHON` | OFF | Build Python wrapper and package |
|
||||
| | | |
|
||||
| `BUILD_FLATZINC` | ON\* | Build the flatzinc library<br>**Forced** to OFF if `BUILD_CXX=OFF` |
|
||||
| `BUILD_GLOP` | OFF\* | Build the standalone Glop library<br>**Forced** to OFF if `BUILD_CXX=ON`, otherwise default to ON |
|
||||
| | | |
|
||||
| `BUILD_DEPS` | OFF* | Default to ON if `BUILD_JAVA=ON` or `BUILD_PYTHON=ON` or `BUILD_DOTNET=ON` |
|
||||
| `BUILD_ZLIB` | OFF* | Static build the zlib library<br>**Forced** to ON if `BUILD_DEPS=ON` |
|
||||
| `BUILD_absl` | OFF* | Static build the abseil-cpp libraries<br>**Forced** to ON if `BUILD_DEPS=ON` |
|
||||
| `BUILD_Protobuf` | OFF* | Static build the protobuf libraries<br>**Forced** to ON if `BUILD_DEPS=ON` |
|
||||
| `BUILD_re2` | OFF* | Static build the re2 libraries<br>**Forced** to ON if `BUILD_DEPS=ON` |
|
||||
| `BUILD_Eigen3` | OFF* | Static build the Eigen3 libraries<br>**Forced** to ON if `BUILD_DEPS=ON` |
|
||||
| | | |
|
||||
| `USE_COINOR` | ON\* | Enable Coin-OR support<br>**Forced** to OFF if `BUILD_CXX=OFF` |
|
||||
| `BUILD_CoinUtils` | OFF\* | Static build the CoinUtils library<br>**Forced** to ON if `USE_COINOR=ON` **and** `BUILD_DEPS=ON` |
|
||||
| `BUILD_Osi` | OFF\* | Static build the Osi library<br>**Forced** to ON if `USE_COINOR=ON` **and** `BUILD_DEPS=ON` |
|
||||
| `BUILD_Clp` | OFF\* | Static build the Clp library<br>**Forced** to ON if `USE_COINOR=ON` **and** `BUILD_DEPS=ON` |
|
||||
| `BUILD_Cgl` | OFF\* | Static build the Cgl library<br>**Forced** to ON if `USE_COINOR=ON` **and** `BUILD_DEPS=ON` |
|
||||
| `BUILD_Cbc` | OFF\* | Static build the Cbc library<br>**Forced** to ON if `USE_COINOR=ON` **and** `BUILD_DEPS=ON` |
|
||||
| | | |
|
||||
| `USE_GLPK` | OFF\* | Enable GLPK support<br>**Forced** to OFF if `BUILD_CXX=OFF` |
|
||||
| `BUILD_GLPK` | OFF\* | Static build the GLPK libraries<br>**Forced** to ON if `USE_GLPK=ON` **and** `BUILD_DEPS=ON` |
|
||||
| | | |
|
||||
| `USE_HIGHS` | ON\* | Enable HIGHS support<br>**Forced** to OFF if `BUILD_CXX=OFF` |
|
||||
| `BUILD_HIGHS` | OFF\* | Static build the HiGHS libraries<br>**Forced** to ON if `USE_HIGHS=ON` **and** `BUILD_DEPS=ON` |
|
||||
| | | |
|
||||
| `USE_SCIP` | ON\* | Enable SCIP support<br>**Forced** to OFF if `BUILD_CXX=OFF` |
|
||||
| `BUILD_SCIP` | OFF\* | Static build the SCIP libraries<br>**Forced** to ON if `USE_SCIP=ON` **and** `BUILD_DEPS=ON` |
|
||||
| | | |
|
||||
| `USE_CPLEX` | OFF | Enable CPLEX support |
|
||||
| | | |
|
||||
| `BUILD_DOC` | OFF\* | Build all documentations |
|
||||
| `BUILD_CXX_DOC` | OFF\* | Build C++ documentation<br>**Forced** to ON if `BUILD_DOC=ON` |
|
||||
| `BUILD_DOTNET_DOC` | OFF\* | Build .Net documentation<br>**Forced** to ON if `BUILD_DOC=ON` |
|
||||
| `BUILD_JAVA_DOC` | OFF\* | Build Java documentation<br>**Forced** to ON if `BUILD_DOC=ON` |
|
||||
| `BUILD_PYTHON_DOC` | OFF\* | Build Python documentation<br>**Forced** to ON if `BUILD_DOC=ON` |
|
||||
| `INSTALL_DOC` | OFF\* | Install all documentations<br>**Forced** to OFF if `BUILD_CXX=OFF` or `BUILD_DOC=OFF` |
|
||||
| | | |
|
||||
| `BUILD_SAMPLES` | ON\* | Build all samples<br>Default to ON if `BUILD_DEPS=ON` |
|
||||
| `BUILD_CXX_SAMPLES` | ON\* | Build all C++ samples<br>**Forced** to OFF if `BUILD_CXX=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| `BUILD_DOTNET_SAMPLES` | ON\* | Build all .Net samples<br>**Forced** to OFF if `BUILD_DOTNET=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| `BUILD_JAVA_SAMPLES` | ON\* | Build all Java samples<br>**Forced** to OFF if `BUILD_JAVA=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| `BUILD_PYTHON_SAMPLES` | ON\* | Build all Python samples<br>**Forced** to OFF if `BUILD_PYTHON=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| | | |
|
||||
| `BUILD_EXAMPLES` | ON\* | Build all examples<br>Default to ON if `BUILD_DEPS=ON` |
|
||||
| `BUILD_CXX_EXAMPLES` | ON\* | Build all C++ examples<br>**Forced** to OFF if `BUILD_CXX=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| `BUILD_DOTNET_EXAMPLES` | ON\* | Build all .Net examples<br>**Forced** to OFF if `BUILD_DOTNET=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| `BUILD_JAVA_EXAMPLES` | ON\* | Build all Java examples<br>**Forced** to OFF if `BUILD_JAVA=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| `BUILD_PYTHON_EXAMPLES` | ON\* | Build all Python examples<br>**Forced** to OFF if `BUILD_PYTHON=OFF` or `BUILD_SAMPLE=OFF` |
|
||||
| | | |
|
||||
| `BUILD_XPRESS_TEST_AND_EXAMPLES` | OFF\* | Build Xpress specific tests (C++, Java and Python) <br>tests and example for each language are built **only** if the respective language support is `ON` <br>These tests and examples don't need Xpress for the compilation but they need a valid Xpress installation for a succesful execution (a cummunity licence is sufficient). |
|
||||
| | | |
|
||||
| `USE_DOTNET_46` | OFF | Enable .Net Framework 4.6 support<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| `USE_DOTNET_461` | OFF | Enable .Net Framework 4.6.1 support<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| `USE_DOTNET_462` | OFF | Enable .Net Framework 4.6.2 support<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| `USE_DOTNET_48` | OFF | Enable .Net Framework 4.8 support<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| `USE_DOTNET_STD_21` | OFF | Enable .Net Standard 2.1 support<br>Only available if `BUILD_DOTNET=ON` and not targeting arm64 platform |
|
||||
| `USE_DOTNET_CORE_31` | OFF | Enable .Net Core 3.1 LTS support<br>Only available if `BUILD_DOTNET=ON` and not targeting arm64 platform |
|
||||
| `USE_DOTNET_6` | ON | Enable .Net 6 LTS support<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| `USE_DOTNET_7` | OFF | Enable .Net 7 support<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| `UNIVERSAL_DOTNET_PACKAGE` | OFF | Build a multi platform package (i.e. `Google.OrTools` will depends on all runtime packages)<br>Only available if `BUILD_DOTNET=ON` |
|
||||
| | | |
|
||||
| `SKIP_GPG` | ON | Disable GPG sign<br>Only available if `BUILD_JAVA=ON` |
|
||||
| `UNIVERSAL_JAVA_PACKAGE` | OFF | Build a multi platform package (i.e. `ortools-java` will depends on all native packages)<br>Only available if `BUILD_JAVA=ON` |
|
||||
| `BUILD_FAT_JAR` | OFF | Build a `ortools-java` .jar that includes all of its own Maven dependencies, including the native package<br>Only available if `BUILD_JAVA=ON` |
|
||||
| | | |
|
||||
| `BUILD_pybind11` | `BUILD_DEPS` | Static build the pybind11 libraries<br>**Forced** to ON if `BUILD_DEPS=ON`<br>Only available if `BUILD_PYTHON=ON` |
|
||||
| `BUILD_pybind11_protobuf` | `BUILD_DEPS` | Static build the pybind11_protobuf libraries<br>**Forced** to ON if `BUILD_DEPS=ON`<br>Only available if `BUILD_PYTHON=ON` |
|
||||
| `GENERATE_PYTHON_STUB` | ON | Generate python stub files<br>Only available if `BUILD_PYTHON=ON` |
|
||||
| `BUILD_VENV` | `BUILD_TESTING` | Create python venv in `BINARY_DIR/python/venv`<br>**Forced** to ON if `BUILD_TESTING=ON`<br>Only available if `BUILD_PYTHON=ON` |
|
||||
| `VENV_USE_SYSTEM_SITE_PACKAGES` | OFF | Python venv can use system site package (e.g. `py3-numpy` on Alpine)<br>Only available if `BUILD_PYTHON=ON` and `BUILD_VENV=ON` |
|
||||
| `FETCH_PYTHON_DEPS` | `BUILD_DEPS` | Fetch python modules needed to build ortools package<br>Only available if `BUILD_PYTHON=ON` |
|
||||
| | | |
|
||||
|
||||
## Integrating OR-Tools in your CMake Project
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ if (BUILD_CXX_EXAMPLES)
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:$ORIGIN:$ORIGIN/../lib:$ORIGIN")
|
||||
endif ()
|
||||
|
||||
add_executable(test_xprs_interface test_xpress_interface.cc)
|
||||
add_executable(test_xprs_interface test/test_xpress_interface.cc)
|
||||
target_compile_features(test_xprs_interface PRIVATE cxx_std_17)
|
||||
target_link_libraries(test_xprs_interface PRIVATE ortools::ortools GTest::gtest_main)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user