|
1 |
| -diff --git a/src/lpi/lpi_glop.cpp b/src/lpi/lpi_glop.cpp |
2 |
| -index a90120188a..2c068e5e30 100644 |
3 |
| ---- a/src/lpi/lpi_glop.cpp |
4 |
| -+++ b/src/lpi/lpi_glop.cpp |
5 |
| -@@ -51,7 +51,6 @@ |
6 |
| - #include "ortools/util/time_limit.h" |
| 1 | +diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 2 | +index 8492dc75..70d7dd21 100644 |
| 3 | +--- a/CMakeLists.txt |
| 4 | ++++ b/CMakeLists.txt |
| 5 | +@@ -412,22 +412,11 @@ endif() |
| 6 | + #search the selected LP solver library |
| 7 | + message(STATUS "Finding Solver \"${LPS}\"") |
| 8 | + if(LPS STREQUAL "spx") |
| 9 | +- message(STATUS "Finding Soplex") |
| 10 | +- find_package(SOPLEX CONFIG HINTS ${SOPLEX_DIR}) |
| 11 | +- if(NOT SOPLEX_FOUND) |
| 12 | +- # Utilities to automatically download missing dependencies |
| 13 | +- include(cmake/Dependencies.cmake) |
| 14 | +- find_or_download_package( |
| 15 | +- NAME SOPLEX |
| 16 | +- VERSION 7.0.1 |
| 17 | +- URL https://github.com/scipopt/soplex/archive/refs/tags/release-701.tar.gz |
| 18 | +- URL_HASH SHA256=80cce994dcbe45fd52b60e31a3aeb5d2c60a7ddbaae495e0ce6bf58481675696 |
| 19 | +- COMPONENTS soplex) |
| 20 | +- find_package(SOPLEX REQUIRED CONFIG HINTS _deps/local) |
| 21 | +- endif() |
| 22 | +- if(NOT SOPLEX_FOUND) |
| 23 | ++ message(STATUS "Finding Soplex...") |
| 24 | ++ if(NOT TARGET libsoplex-pic OR NOT TARGET libsoplex) |
| 25 | + message(FATAL_ERROR "Requested LP solver SoPlex not found.") |
| 26 | + endif() |
| 27 | ++ set(SOPLEX_FOUND TRUE) |
| 28 | + if (DEFINED SOPLEX_WITH_PAPILO) |
| 29 | + message(STATUS "SOPLEX links PAPILO") |
| 30 | + if((NOT SCIP_WITH_PAPILO)) # TODO not sure how to handle AUTOBUILD |
| 31 | +@@ -502,9 +491,9 @@ if(SOPLEX_FOUND) |
| 32 | + message(STATUS "Finding SOPLEX - found") |
| 33 | + # SoPlex headers can be directly included |
| 34 | + include_directories(${SOPLEX_INCLUDE_DIRS}) |
| 35 | +- set(LPS_LIBRARIES ${SOPLEX_LIBRARIES}) |
| 36 | ++ set(LPS_LIBRARIES libsoplex) |
| 37 | + if(SHARED) |
| 38 | +- set(LPS_PIC_LIBRARIES ${SOPLEX_PIC_LIBRARIES}) |
| 39 | ++ set(LPS_PIC_LIBRARIES libsoplex-pic) |
| 40 | + else() |
| 41 | + set(LPS_PIC_LIBRARIES ${LPS_LIBRARIES}) |
| 42 | + endif() |
| 43 | +@@ -514,7 +503,7 @@ if(SOPLEX_FOUND) |
| 44 | + set(lpi lpi/lpi_spx2.cpp) |
| 45 | + endif() |
| 46 | + else() |
| 47 | +- message(STATUS "Support SOPLEX: OFF") |
| 48 | ++ message(FATAL_ERROR "SOPLEX not found !") |
| 49 | + endif() |
7 | 50 |
|
8 |
| - #include "ortools/base/logging.h" |
9 |
| --#include "ortools/base/vlog_is_on.h" |
| 51 | + if(CLP_FOUND) |
| 52 | +diff --git a/scip-config.cmake.in b/scip-config.cmake.in |
| 53 | +index 559552f9..682ac40a 100644 |
| 54 | +--- a/scip-config.cmake.in |
| 55 | ++++ b/scip-config.cmake.in |
| 56 | +@@ -1,17 +1,16 @@ |
| 57 | + if(NOT TARGET libscip) |
| 58 | +- include("${CMAKE_CURRENT_LIST_DIR}/scip-targets.cmake") |
| 59 | +-endif() |
| 60 | ++ include(CMakeFindDependencyMacro) |
| 61 | ++ if(@ZIMPL_NEEDED@) |
| 62 | ++ find_dependency(ZIMPL REQUIRED NO_MODULE) |
| 63 | ++ endif() |
| 64 | ++ if(@SOPLEX_NEEDED@) |
| 65 | ++ find_dependency(SOPLEX REQUIRED NO_MODULE) |
| 66 | ++ endif() |
10 | 67 |
|
11 |
| - #include "lpi/lpi.h" |
12 |
| - #include "scip/pub_message.h" |
13 |
| -@@ -2942,12 +2941,12 @@ SCIP_RETCODE SCIPlpiSetIntpar( |
14 |
| - SCIPdebugMessage("SCIPlpiSetIntpar: SCIP_LPPAR_LPINFO -> %d.\n", ival); |
15 |
| - if ( ival == 0 ) |
16 |
| - { |
17 |
| -- (void) google::SetVLOGLevel("*", google::GLOG_INFO); |
18 |
| -+ absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo); |
19 |
| - lpi->lp_info = false; |
20 |
| - } |
21 |
| - else |
22 |
| - { |
23 |
| -- (void) google::SetVLOGLevel("*", google::GLOG_ERROR); |
24 |
| -+ absl::SetStderrThreshold(absl::LogSeverityAtLeast::kError); |
25 |
| - lpi->lp_info = true; |
26 |
| - } |
27 |
| - break; |
28 |
| -@@ -3190,7 +3189,7 @@ SCIP_RETCODE SCIPlpiReadLP( |
| 68 | +-if(@ZIMPL_NEEDED@) |
| 69 | +- set(ZIMPL_DIR "@CONF_ZIMPL_DIR@") |
| 70 | +- find_package(ZIMPL QUIET CONFIG) |
| 71 | +-endif() |
| 72 | +- |
| 73 | +-if(@SOPLEX_NEEDED@) |
| 74 | +- set(SOPLEX_DIR "@CONF_SOPLEX_DIR@") |
| 75 | +- find_package(SOPLEX QUIET CONFIG) |
| 76 | ++ include("${CMAKE_CURRENT_LIST_DIR}/scip-targets.cmake") |
| 77 | + endif() |
| 78 | + |
| 79 | ++# Legacy |
| 80 | + set(SCIP_LIBRARIES libscip) |
| 81 | + set(SCIP_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@") |
| 82 | + set(SCIP_FOUND TRUE) |
| 83 | +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt |
| 84 | +index e6fda2d5..bbc55db1 100644 |
| 85 | +--- a/src/CMakeLists.txt |
| 86 | ++++ b/src/CMakeLists.txt |
| 87 | +@@ -1149,17 +1149,8 @@ install(TARGETS scip libscip EXPORT scip-targets |
| 88 | + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) |
| 89 | + |
| 90 | + # Add all targets to the build-tree export set |
| 91 | +-export(TARGETS scip libscip |
| 92 | +- FILE "${PROJECT_BINARY_DIR}/scip-targets.cmake") |
| 93 | +- |
| 94 | +-# make soplex and zimpl dir absolute for the config file |
| 95 | +-if(SOPLEX_NEEDED) |
| 96 | +- get_filename_component(CONF_SOPLEX_DIR ${SOPLEX_DIR} REALPATH BASE_DIR ${CMAKE_SOURCE_DIR}) |
| 97 | +-endif() |
| 98 | +- |
| 99 | +-if(ZIMPL_NEEDED) |
| 100 | +- get_filename_component(CONF_ZIMPL_DIR ${ZIMPL_DIR} REALPATH BASE_DIR ${CMAKE_SOURCE_DIR}) |
| 101 | +-endif() |
| 102 | ++#export(TARGETS scip libscip |
| 103 | ++# FILE "${PROJECT_BINARY_DIR}/scip-targets.cmake") |
| 104 | + |
| 105 | + # configure the config file for the build tree |
| 106 | + set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src" "${PROJECT_BINARY_DIR}") |
| 107 | +@@ -1175,12 +1166,6 @@ ${PROJECT_BINARY_DIR}/scip-config-version.cmake |
| 108 | + |
| 109 | + #configure the config file for the install |
| 110 | + set(CONF_INCLUDE_DIRS "\${CMAKE_CURRENT_LIST_DIR}/../../../include") |
| 111 | +-if(SOPLEX_NEEDED) |
| 112 | +- set(CONF_SOPLEX_DIR "\${CMAKE_CURRENT_LIST_DIR}/../soplex") |
| 113 | +-endif() |
| 114 | +-if(ZIMPL_NEEDED) |
| 115 | +- set(CONF_ZIMPL_DIR "\${CMAKE_CURRENT_LIST_DIR}/../zimpl") |
| 116 | +-endif() |
| 117 | + configure_file(${PROJECT_SOURCE_DIR}/scip-config.cmake.in |
| 118 | + "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/scip-config.cmake" @ONLY) |
29 | 119 |
|
30 |
| - const std::string filespec(fname); |
31 |
| - MPModelProto proto; |
32 |
| -- if ( ! ReadFileToProto(filespec, &proto) ) |
33 |
| -+ if ( ! ReadFileToProto(filespec, &proto).ok() ) |
34 |
| - { |
35 |
| - SCIPerrorMessage("Could not read <%s>\n", fname); |
36 |
| - return SCIP_READERROR; |
37 |
| -@@ -3214,7 +3213,7 @@ SCIP_RETCODE SCIPlpiWriteLP( |
38 |
| - MPModelProto proto; |
39 |
| - LinearProgramToMPModelProto(*lpi->linear_program, &proto); |
40 |
| - const std::string filespec(fname); |
41 |
| -- if ( ! WriteProtoToFile(filespec, proto, operations_research::ProtoWriteFormat::kProtoText, true) ) |
42 |
| -+ if ( ! WriteProtoToFile(filespec, proto, operations_research::ProtoWriteFormat::kProtoText, true).ok() ) |
43 |
| - { |
44 |
| - SCIPerrorMessage("Could not write <%s>\n", fname); |
45 |
| - return SCIP_READERROR; |
|
0 commit comments