cmake: cleanup
This commit is contained in:
@@ -160,41 +160,7 @@ if(BUILD_LP_PARSER)
|
||||
endif()
|
||||
|
||||
# Optional third party solvers (enabled by default)
|
||||
## PDLP
|
||||
CMAKE_DEPENDENT_OPTION(USE_PDLP "Use the PDLP solver" ON "BUILD_CXX" OFF)
|
||||
message(STATUS "PDLP support: ${USE_PDLP}")
|
||||
if(USE_PDLP)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_PDLP "Build the PDLP dependency Library" ON
|
||||
"NOT BUILD_DEPS" ON)
|
||||
message(STATUS "Build PDLP: ${BUILD_PDLP}")
|
||||
if(BUILD_PDLP)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_Eigen3 "Build the eigen3 dependency Library" OFF
|
||||
"NOT BUILD_DEPS" ON)
|
||||
message(STATUS "Build eigen3: ${BUILD_Eigen3}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
## SCIP
|
||||
CMAKE_DEPENDENT_OPTION(USE_SCIP "Use the Scip solver" ON "BUILD_CXX" OFF)
|
||||
message(STATUS "SCIP support: ${USE_SCIP}")
|
||||
if(USE_SCIP)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_SCIP "Build the SCIP dependency Library" OFF
|
||||
"NOT BUILD_DEPS" ON)
|
||||
message(STATUS "Build SCIP: ${BUILD_SCIP}")
|
||||
endif()
|
||||
|
||||
## GLPK
|
||||
# Disable by default since it is GLPv3, user could enable it and release under GLPv3
|
||||
# see: https://www.apache.org/licenses/GPL-compatibility.html
|
||||
CMAKE_DEPENDENT_OPTION(USE_GLPK "Use the GLPK solver" OFF "BUILD_CXX" OFF)
|
||||
message(STATUS "GLPK support: ${USE_GLPK}")
|
||||
if(USE_GLPK)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_GLPK "Build the GLPK dependency Library" OFF
|
||||
"NOT BUILD_DEPS" ON)
|
||||
message(STATUS "Build GLPK: ${BUILD_GLPK}")
|
||||
endif()
|
||||
|
||||
## COIN-OR
|
||||
## COIN-OR Solvers (Cbc, Clp)
|
||||
CMAKE_DEPENDENT_OPTION(USE_COINOR "Use the COIN-OR solver" ON "BUILD_CXX" OFF)
|
||||
message(STATUS "COIN-OR support: ${USE_COINOR}")
|
||||
if(USE_COINOR)
|
||||
@@ -219,6 +185,40 @@ if(USE_COINOR)
|
||||
message(STATUS "Build Cbc: ${BUILD_Cbc}")
|
||||
endif()
|
||||
|
||||
## GLPK
|
||||
# Disable by default since it is GLPv3, user could enable it and release under GLPv3
|
||||
# see: https://www.apache.org/licenses/GPL-compatibility.html
|
||||
CMAKE_DEPENDENT_OPTION(USE_GLPK "Use the GLPK solver" OFF "BUILD_CXX" OFF)
|
||||
message(STATUS "GLPK support: ${USE_GLPK}")
|
||||
if(USE_GLPK)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_GLPK "Build the GLPK dependency Library" OFF
|
||||
"NOT BUILD_DEPS" ON)
|
||||
message(STATUS "Build GLPK: ${BUILD_GLPK}")
|
||||
endif()
|
||||
|
||||
## PDLP
|
||||
CMAKE_DEPENDENT_OPTION(USE_PDLP "Use the PDLP solver" ON "BUILD_CXX" OFF)
|
||||
message(STATUS "PDLP support: ${USE_PDLP}")
|
||||
if(USE_PDLP)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_PDLP "Build the PDLP dependency Library" ON
|
||||
"NOT BUILD_DEPS" ON)
|
||||
message(STATUS "Build PDLP: ${BUILD_PDLP}")
|
||||
if(BUILD_PDLP)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_Eigen3 "Build the eigen3 dependency Library" OFF
|
||||
"NOT BUILD_DEPS" ON)
|
||||
message(STATUS "Build eigen3: ${BUILD_Eigen3}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
## SCIP
|
||||
CMAKE_DEPENDENT_OPTION(USE_SCIP "Use the Scip solver" ON "BUILD_CXX" OFF)
|
||||
message(STATUS "SCIP support: ${USE_SCIP}")
|
||||
if(USE_SCIP)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_SCIP "Build the SCIP dependency Library" OFF
|
||||
"NOT BUILD_DEPS" ON)
|
||||
message(STATUS "Build SCIP: ${BUILD_SCIP}")
|
||||
endif()
|
||||
|
||||
# Optional third party solvers (disabled by default)
|
||||
option(USE_CPLEX "Use the CPLEX solver" OFF)
|
||||
message(STATUS "CPLEX support: ${USE_CPLEX}")
|
||||
|
||||
@@ -78,12 +78,12 @@ below).
|
||||
* ZLIB (`BUILD_ZLIB`),
|
||||
* Google Abseil-cpp (`BUILD_absl`),
|
||||
* Google Protobuf (`BUILD_Protobuf`),
|
||||
* SCIP (`BUILD_SCIP`),<br>
|
||||
note: You can disable the support of SCIP solvers
|
||||
by using `-DUSE_SCIP=OFF` (`ON` by default).
|
||||
* GLPK (`BUILD_GLPK`),<br>
|
||||
note: You can disable the support of GLPK solvers
|
||||
note: You can disable the support of GLPK solver
|
||||
by using `-DUSE_GLPK=OFF` (`ON` by default).
|
||||
* SCIP (`BUILD_SCIP`),<br>
|
||||
note: You can disable the support of SCIP solver
|
||||
by using `-DUSE_SCIP=OFF` (`ON` by default).
|
||||
|
||||
* COIN-OR solvers,
|
||||
|
||||
@@ -167,16 +167,19 @@ cmake -S. -Bbuild -LH
|
||||
| `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` |
|
||||
| `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_GLPK` | ON\* | 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` |
|
||||
| `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` | ON\* | 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_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 |
|
||||
| | | |
|
||||
|
||||
@@ -166,6 +166,27 @@ if(BUILD_PYTHON AND BUILD_pybind11)
|
||||
message(CHECK_PASS "fetched")
|
||||
endif()
|
||||
|
||||
# ##############################################################################
|
||||
# GLPK
|
||||
# ##############################################################################
|
||||
if(BUILD_GLPK)
|
||||
message(CHECK_START "Fetching GLPK")
|
||||
list(APPEND CMAKE_MESSAGE_INDENT " ")
|
||||
set(BUILD_EXAMPLES OFF)
|
||||
set(WITH_GMP OFF)
|
||||
set(WITH_ODBC OFF)
|
||||
set(WITH_MYSQL OFF)
|
||||
|
||||
FetchContent_Declare(
|
||||
glpk
|
||||
GIT_REPOSITORY "https://github.com/Mizux/GLPK.git"
|
||||
GIT_TAG "5.0"
|
||||
)
|
||||
FetchContent_MakeAvailable(glpk)
|
||||
list(POP_BACK CMAKE_MESSAGE_INDENT)
|
||||
message(CHECK_PASS "fetched")
|
||||
endif()
|
||||
|
||||
# ##############################################################################
|
||||
# SCIP
|
||||
# ##############################################################################
|
||||
@@ -195,27 +216,6 @@ if(BUILD_SCIP)
|
||||
message(CHECK_PASS "fetched")
|
||||
endif()
|
||||
|
||||
# ##############################################################################
|
||||
# GLPK
|
||||
# ##############################################################################
|
||||
if(BUILD_GLPK)
|
||||
message(CHECK_START "Fetching GLPK")
|
||||
list(APPEND CMAKE_MESSAGE_INDENT " ")
|
||||
set(BUILD_EXAMPLES OFF)
|
||||
set(WITH_GMP OFF)
|
||||
set(WITH_ODBC OFF)
|
||||
set(WITH_MYSQL OFF)
|
||||
|
||||
FetchContent_Declare(
|
||||
glpk
|
||||
GIT_REPOSITORY "https://github.com/Mizux/GLPK.git"
|
||||
GIT_TAG "5.0"
|
||||
)
|
||||
FetchContent_MakeAvailable(glpk)
|
||||
list(POP_BACK CMAKE_MESSAGE_INDENT)
|
||||
message(CHECK_PASS "fetched")
|
||||
endif()
|
||||
|
||||
# ##############################################################################
|
||||
# Coinutils
|
||||
# ##############################################################################
|
||||
|
||||
@@ -58,34 +58,6 @@ if(BUILD_LP_PARSER)
|
||||
set(RE2_DEPS re2::re2)
|
||||
endif()
|
||||
|
||||
if(BUILD_PDLP)
|
||||
if(NOT BUILD_Eigen3)
|
||||
find_package(Eigen3 REQUIRED)
|
||||
endif()
|
||||
if(NOT TARGET Eigen3::Eigen)
|
||||
message(FATAL_ERROR "Target Eigen3::Eigen not available.")
|
||||
endif()
|
||||
set(PDLP_DEPS Eigen3::Eigen)
|
||||
endif()
|
||||
|
||||
if(USE_PLDP)
|
||||
if(NOT BUILD_PDLP)
|
||||
find_package(PDLP REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_SCIP)
|
||||
if(NOT BUILD_SCIP)
|
||||
find_package(SCIP REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_GLPK)
|
||||
if(NOT BUILD_GLPK)
|
||||
find_package(GLPK REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_COINOR)
|
||||
if(NOT BUILD_CoinUtils)
|
||||
find_package(CoinUtils REQUIRED)
|
||||
@@ -110,6 +82,32 @@ if(USE_COINOR)
|
||||
set(COINOR_DEPS Coin::CbcSolver Coin::OsiCbc Coin::ClpSolver Coin::OsiClp)
|
||||
endif()
|
||||
|
||||
if(USE_GLPK)
|
||||
if(NOT BUILD_GLPK)
|
||||
find_package(GLPK REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_PLDP)
|
||||
if(NOT BUILD_PDLP)
|
||||
find_package(PDLP REQUIRED)
|
||||
else()
|
||||
if(NOT BUILD_Eigen3)
|
||||
find_package(Eigen3 REQUIRED)
|
||||
endif()
|
||||
if(NOT TARGET Eigen3::Eigen)
|
||||
message(FATAL_ERROR "Target Eigen3::Eigen not available.")
|
||||
endif()
|
||||
set(PDLP_DEPS Eigen3::Eigen)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_SCIP)
|
||||
if(NOT BUILD_SCIP)
|
||||
find_package(SCIP REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Check optional Dependencies
|
||||
if(USE_CPLEX)
|
||||
find_package(CPLEX REQUIRED)
|
||||
|
||||
@@ -21,8 +21,9 @@ endif
|
||||
# Checks if the user has overwritten default libraries and binaries.
|
||||
BUILD_TYPE ?= Release
|
||||
USE_COINOR ?= ON
|
||||
USE_SCIP ?= ON
|
||||
USE_GLPK ?= OFF
|
||||
USE_PDLP := ON # OFF not supported
|
||||
USE_SCIP ?= ON
|
||||
USE_CPLEX ?= OFF
|
||||
USE_XPRESS ?= OFF
|
||||
JOBS ?= 4
|
||||
@@ -47,8 +48,9 @@ third_party:
|
||||
-DBUILD_EXAMPLES=OFF \
|
||||
-DBUILD_SAMPLES=OFF \
|
||||
-DUSE_COINOR=$(USE_COINOR) \
|
||||
-DUSE_SCIP=$(USE_SCIP) \
|
||||
-DUSE_GLPK=$(USE_GLPK) \
|
||||
-DUSE_PDLP=$(USE_PDLP) \
|
||||
-DUSE_SCIP=$(USE_SCIP) \
|
||||
-DUSE_CPLEX=$(USE_CPLEX) \
|
||||
-DUSE_XPRESS=$(USE_XPRESS) \
|
||||
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
|
||||
|
||||
Reference in New Issue
Block a user