Numerous updates
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
AUX Support-for-USE_PDLP-C-23-and-Werror-changes.patch 22055 BLAKE2B f861b9b7237df40dfae4cfac4adfcffb79a3a4a3fae4daf5b32304e1d3a69b836cd81a7f6307910281bd0363d4f40057e6f75f27f408e0250e829b101ea74ad9 SHA512 aabc3aed65d182159d016f38ec6156476b7cb7e6a48bf939df6a0d6d15f1efa6068827834a2b86a06c3cc2043426c80d4d5dd90fcae946704d744c06b91e2a31
|
||||
DIST or-tools-9.6.tar.gz 19252960 BLAKE2B 1c4a523db01d4d2675b4078b4c20557428ca1bd3aaad543026141ebbdb34a12ba9d38a6d2a483c6c384ea302f9760a13cad46c93960572ad12f94e6b2cf860a0 SHA512 c29d59fd170fecb72d5980df353d7bc4ef4210bea8f21cda4cf60d8a51e27104cc36a825a519fe5f2af7970f17410c920b7e7632e9c25185abfd91930a23b525
|
||||
EBUILD or-tools-9.6-r1.ebuild 1805 BLAKE2B bf03426ecae53e4c0c6efcf03d2e937bfd7d58dba30c3c86b5a367a1dd1d98b4414101c9ab859c119b1fae58904efc2eb141ba4a010793641102170dcdf9cc3a SHA512 f7dde8823545a384d0377362bdfd0ed6cc7d45bd15137b9360b1262e427bc6a0afd3a7955fb036f099cba84bf77e368995d360df504ba23a40857362c83bc18b
|
||||
EBUILD or-tools-9.6.ebuild 2220 BLAKE2B 0968b6601eefc33f3a0c9aa5d7c9f398ce316c7bf2c529b4f2318f62ae3dae6790ce82950541483faa8db5e297e58d7faabd5b8e276b7c25e37332001b8ecce7 SHA512 22e91ffe1c5b981af1f3092754817b4f9811fa47a0457c8f445b6ef9cd8e19d7c8f95a9c043db6b59ac009903222c6847bb16f70e8aa8c7922649aa740dd778b
|
||||
@@ -0,0 +1,538 @@
|
||||
From e401b3e7cda8047ba7c29fa85acd8cf2d63064e8 Mon Sep 17 00:00:00 2001
|
||||
From: Amit Prakash Ambasta <amit.prakash.ambasta@gmail.com>
|
||||
Date: Fri, 9 Jun 2023 17:32:29 +0530
|
||||
Subject: [PATCH] Support for USE_PDLP, C++23 and Werror changes
|
||||
|
||||
Signed-off-by: Amit Prakash Ambasta <amit.prakash.ambasta@gmail.com>
|
||||
---
|
||||
CMakeLists.txt | 5 +--
|
||||
cmake/cpp.cmake | 2 +-
|
||||
ortools/base/file.cc | 5 ++-
|
||||
.../routing_lp_scheduling.cc | 1 +
|
||||
ortools/constraint_solver/search.cc | 5 +--
|
||||
ortools/glop/initial_basis.cc | 4 +++
|
||||
ortools/glop/primal_edge_norms.cc | 1 +
|
||||
ortools/graph/iterators.h | 17 +++++++--
|
||||
ortools/linear_solver/linear_solver.cc | 4 +++
|
||||
ortools/linear_solver/pdlp_interface.cc | 3 ++
|
||||
.../proto_solver/pdlp_proto_solver.cc | 3 ++
|
||||
.../proto_solver/pdlp_proto_solver.h | 3 ++
|
||||
ortools/linear_solver/solve.cc | 5 +--
|
||||
ortools/lp_data/mps_reader.cc | 36 +++++++++----------
|
||||
ortools/lp_data/mps_reader.h | 12 +++----
|
||||
ortools/pdlp/iteration_stats.h | 4 +++
|
||||
ortools/pdlp/primal_dual_hybrid_gradient.h | 3 ++
|
||||
ortools/pdlp/quadratic_program.h | 3 ++
|
||||
ortools/sat/cp_model_utils.cc | 1 +
|
||||
ortools/sat/linear_programming_constraint.cc | 3 +-
|
||||
20 files changed, 82 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 07bcaccc0b..aec8fc79d7 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -28,10 +28,11 @@ message(STATUS "${PROJECT_NAME} version: ${PROJECT_VERSION}")
|
||||
if(MSVC)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
else()
|
||||
- set(CMAKE_CXX_STANDARD 17)
|
||||
+ set(CMAKE_CXX_STANDARD 23)
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
-set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
+set(CMAKE_CXX_EXTENSIONS ON)
|
||||
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
|
||||
# Set max os target version.
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
|
||||
diff --git a/cmake/cpp.cmake b/cmake/cpp.cmake
|
||||
index daf6ba7eb8..35a94e3e8f 100644
|
||||
--- a/cmake/cpp.cmake
|
||||
+++ b/cmake/cpp.cmake
|
||||
@@ -230,7 +230,7 @@ endforeach()
|
||||
if(MSVC)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
else()
|
||||
- set(CMAKE_CXX_STANDARD 17)
|
||||
+ set(CMAKE_CXX_STANDARD 23)
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
diff --git a/ortools/base/file.cc b/ortools/base/file.cc
|
||||
index fa627c9393..f3bbda2d57 100644
|
||||
--- a/ortools/base/file.cc
|
||||
+++ b/ortools/base/file.cc
|
||||
@@ -184,9 +184,8 @@ absl::Status GetContents(const absl::string_view& filename, std::string* output,
|
||||
status.Update(file->Close(flags));
|
||||
return status;
|
||||
}
|
||||
-#endif // _MSC_VER
|
||||
-
|
||||
- file->Close(flags); // Even if ReadToString() fails!
|
||||
+#endif // _MSC_VER
|
||||
+ auto closed = file->Close(flags); // Even if ReadToString() fails!
|
||||
return absl::Status(absl::StatusCode::kInvalidArgument,
|
||||
absl::StrCat("Could not read from '", filename, "'."));
|
||||
}
|
||||
diff --git a/ortools/constraint_solver/routing_lp_scheduling.cc b/ortools/constraint_solver/routing_lp_scheduling.cc
|
||||
index a8370e71c0..e1acf01500 100644
|
||||
--- a/ortools/constraint_solver/routing_lp_scheduling.cc
|
||||
+++ b/ortools/constraint_solver/routing_lp_scheduling.cc
|
||||
@@ -1337,6 +1337,7 @@ int64_t ComputeConvexPiecewiseLinearFormulationValue(
|
||||
return PieceWiseLinearFormulationValueKnownSegment(
|
||||
pwl, x, pwl.x_anchors.size() - 1, delta);
|
||||
}
|
||||
+ throw std::logic_error("Unhandled enum value");
|
||||
}
|
||||
|
||||
bool DimensionCumulOptimizerCore::SetRouteTravelConstraints(
|
||||
diff --git a/ortools/constraint_solver/search.cc b/ortools/constraint_solver/search.cc
|
||||
index 4ea7186695..a71e99768d 100644
|
||||
--- a/ortools/constraint_solver/search.cc
|
||||
+++ b/ortools/constraint_solver/search.cc
|
||||
@@ -2406,6 +2406,7 @@ int SolutionCollector::solution_count() const { return solution_data_.size(); }
|
||||
|
||||
int64_t SolutionCollector::wall_time(int n) const {
|
||||
check_index(n);
|
||||
+ auto rr = solution_data_[n];
|
||||
return solution_data_[n].time;
|
||||
}
|
||||
|
||||
@@ -4233,8 +4234,8 @@ SearchLimit* RegularLimit::MakeClone() const { return MakeIdenticalClone(); }
|
||||
|
||||
RegularLimit* RegularLimit::MakeIdenticalClone() const {
|
||||
Solver* const s = solver();
|
||||
- return s->MakeLimit(wall_time(), branches_, failures_, solutions_,
|
||||
- smart_time_check_);
|
||||
+ return s->MakeLimit(absl::Milliseconds(wall_time()), branches_, failures_,
|
||||
+ solutions_, smart_time_check_);
|
||||
}
|
||||
|
||||
bool RegularLimit::CheckWithOffset(absl::Duration offset) {
|
||||
diff --git a/ortools/glop/initial_basis.cc b/ortools/glop/initial_basis.cc
|
||||
index ed4d5a65d8..060c583a92 100644
|
||||
--- a/ortools/glop/initial_basis.cc
|
||||
+++ b/ortools/glop/initial_basis.cc
|
||||
@@ -17,9 +17,11 @@
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <queue>
|
||||
+#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
#include "ortools/glop/markowitz.h"
|
||||
+#include "ortools/lp_data/lp_types.h"
|
||||
#include "ortools/lp_data/lp_utils.h"
|
||||
|
||||
namespace operations_research {
|
||||
@@ -218,6 +220,7 @@ int InitialBasis::GetMarosPriority(ColIndex col) const {
|
||||
case VariableType::FIXED_VARIABLE:
|
||||
return 0;
|
||||
}
|
||||
+ throw std::logic_error("Unhandled VariableType enum value");
|
||||
}
|
||||
|
||||
int InitialBasis::GetMarosPriority(RowIndex row) const {
|
||||
@@ -387,6 +390,7 @@ int InitialBasis::GetColumnCategory(ColIndex col) const {
|
||||
case VariableType::FIXED_VARIABLE:
|
||||
return 5;
|
||||
}
|
||||
+ throw std::logic_error("Unhandled VariableType enum value");
|
||||
}
|
||||
|
||||
Fractional InitialBasis::GetColumnPenalty(ColIndex col) const {
|
||||
diff --git a/ortools/glop/primal_edge_norms.cc b/ortools/glop/primal_edge_norms.cc
|
||||
index 0c54245faf..83e38097ce 100644
|
||||
--- a/ortools/glop/primal_edge_norms.cc
|
||||
+++ b/ortools/glop/primal_edge_norms.cc
|
||||
@@ -58,6 +58,7 @@ const DenseRow& PrimalEdgeNorms::GetSquaredNorms() {
|
||||
case GlopParameters::DEVEX:
|
||||
return GetDevexWeights();
|
||||
}
|
||||
+ throw std::logic_error("Unhandled pricing rule");
|
||||
}
|
||||
|
||||
const DenseRow& PrimalEdgeNorms::GetEdgeSquaredNorms() {
|
||||
diff --git a/ortools/graph/iterators.h b/ortools/graph/iterators.h
|
||||
index a89a8f5730..97398f1ad9 100644
|
||||
--- a/ortools/graph/iterators.h
|
||||
+++ b/ortools/graph/iterators.h
|
||||
@@ -16,6 +16,7 @@
|
||||
#ifndef UTIL_GRAPH_ITERATORS_H_
|
||||
#define UTIL_GRAPH_ITERATORS_H_
|
||||
|
||||
+#include <compare>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
@@ -102,15 +103,24 @@ BeginEndReverseIteratorWrapper<Container> Reverse(const Container& c) {
|
||||
|
||||
// Simple iterator on an integer range, see IntegerRange below.
|
||||
template <typename IntegerType>
|
||||
-class IntegerRangeIterator
|
||||
- : public std::iterator<std::input_iterator_tag, IntegerType> {
|
||||
+class IntegerRangeIterator {
|
||||
public:
|
||||
+ using iterator_category = std::input_iterator_tag;
|
||||
+ using value_type = IntegerType;
|
||||
+ using difference_type = std::ptrdiff_t;
|
||||
+ using pointer = IntegerType*;
|
||||
+ using reference = IntegerType&;
|
||||
+
|
||||
explicit IntegerRangeIterator(IntegerType value) : index_(value) {}
|
||||
IntegerRangeIterator(const IntegerRangeIterator& other)
|
||||
: index_(other.index_) {}
|
||||
IntegerRangeIterator& operator=(const IntegerRangeIterator& other) {
|
||||
index_ = other.index_;
|
||||
}
|
||||
+
|
||||
+ auto operator<=>(const IntegerRangeIterator& other) const = default;
|
||||
+
|
||||
+ /*
|
||||
bool operator!=(const IntegerRangeIterator& other) const {
|
||||
// This may seems weird, but using < instead of != avoid almost-infinite
|
||||
// loop if one use IntegerRange<int>(1, 0) below for instance.
|
||||
@@ -119,7 +129,8 @@ class IntegerRangeIterator
|
||||
bool operator==(const IntegerRangeIterator& other) const {
|
||||
return index_ == other.index_;
|
||||
}
|
||||
- IntegerType operator*() const { return index_; }
|
||||
+ */
|
||||
+ value_type operator*() const { return index_; }
|
||||
IntegerRangeIterator& operator++() {
|
||||
++index_;
|
||||
return *this;
|
||||
diff --git a/ortools/linear_solver/linear_solver.cc b/ortools/linear_solver/linear_solver.cc
|
||||
index ef4f68560b..4e796d8f08 100644
|
||||
--- a/ortools/linear_solver/linear_solver.cc
|
||||
+++ b/ortools/linear_solver/linear_solver.cc
|
||||
@@ -378,7 +378,9 @@ extern MPSolverInterface* BuildHighsInterface(bool mip, MPSolver* const solver);
|
||||
#endif
|
||||
extern MPSolverInterface* BuildBopInterface(MPSolver* const solver);
|
||||
extern MPSolverInterface* BuildGLOPInterface(MPSolver* const solver);
|
||||
+#if defined(USE_PDLP)
|
||||
extern MPSolverInterface* BuildPdlpInterface(MPSolver* const solver);
|
||||
+#endif
|
||||
extern MPSolverInterface* BuildSatInterface(MPSolver* const solver);
|
||||
#if defined(USE_SCIP)
|
||||
extern MPSolverInterface* BuildSCIPInterface(MPSolver* const solver);
|
||||
@@ -401,8 +403,10 @@ MPSolverInterface* BuildSolverInterface(MPSolver* const solver) {
|
||||
return BuildBopInterface(solver);
|
||||
case MPSolver::GLOP_LINEAR_PROGRAMMING:
|
||||
return BuildGLOPInterface(solver);
|
||||
+#if defined(USE_PDLP)
|
||||
case MPSolver::PDLP_LINEAR_PROGRAMMING:
|
||||
return BuildPdlpInterface(solver);
|
||||
+#endif
|
||||
case MPSolver::SAT_INTEGER_PROGRAMMING:
|
||||
return BuildSatInterface(solver);
|
||||
#if defined(USE_CLP) || defined(USE_CBC)
|
||||
diff --git a/ortools/linear_solver/pdlp_interface.cc b/ortools/linear_solver/pdlp_interface.cc
|
||||
index 166c8082c6..cb2ea00b55 100644
|
||||
--- a/ortools/linear_solver/pdlp_interface.cc
|
||||
+++ b/ortools/linear_solver/pdlp_interface.cc
|
||||
@@ -11,6 +11,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
+#if defined(USE_PDLP)
|
||||
+
|
||||
#include <atomic>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
@@ -305,3 +307,4 @@ MPSolverInterface* BuildPdlpInterface(MPSolver* const solver) {
|
||||
}
|
||||
|
||||
} // namespace operations_research
|
||||
+#endif // #if defined(USE_PDLP)
|
||||
diff --git a/ortools/linear_solver/proto_solver/pdlp_proto_solver.cc b/ortools/linear_solver/proto_solver/pdlp_proto_solver.cc
|
||||
index f4e89531d1..c1434a5e23 100644
|
||||
--- a/ortools/linear_solver/proto_solver/pdlp_proto_solver.cc
|
||||
+++ b/ortools/linear_solver/proto_solver/pdlp_proto_solver.cc
|
||||
@@ -10,6 +10,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
+#if defined(USE_PDLP)
|
||||
|
||||
#include "ortools/linear_solver/proto_solver/pdlp_proto_solver.h"
|
||||
|
||||
@@ -133,3 +134,5 @@ absl::StatusOr<MPSolutionResponse> PdlpSolveProto(
|
||||
}
|
||||
|
||||
} // namespace operations_research
|
||||
+
|
||||
+#endif // #if defined(USE_PDLP)
|
||||
diff --git a/ortools/linear_solver/proto_solver/pdlp_proto_solver.h b/ortools/linear_solver/proto_solver/pdlp_proto_solver.h
|
||||
index 8a0ce53136..2195389f33 100644
|
||||
--- a/ortools/linear_solver/proto_solver/pdlp_proto_solver.h
|
||||
+++ b/ortools/linear_solver/proto_solver/pdlp_proto_solver.h
|
||||
@@ -10,6 +10,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
+#if defined(USE_PDLP)
|
||||
|
||||
#ifndef OR_TOOLS_LINEAR_SOLVER_PROTO_SOLVER_PDLP_PROTO_SOLVER_H_
|
||||
#define OR_TOOLS_LINEAR_SOLVER_PROTO_SOLVER_PDLP_PROTO_SOLVER_H_
|
||||
@@ -43,3 +44,5 @@ absl::StatusOr<MPSolutionResponse> PdlpSolveProto(
|
||||
} // namespace operations_research
|
||||
|
||||
#endif // OR_TOOLS_LINEAR_SOLVER_PROTO_SOLVER_PDLP_PROTO_SOLVER_H_
|
||||
+
|
||||
+#endif // #if defined(USE_PDLP)
|
||||
diff --git a/ortools/linear_solver/solve.cc b/ortools/linear_solver/solve.cc
|
||||
index 187d451eb5..84947fce99 100644
|
||||
--- a/ortools/linear_solver/solve.cc
|
||||
+++ b/ortools/linear_solver/solve.cc
|
||||
@@ -140,8 +140,9 @@ MPModelRequest ReadMipModel(const std::string& input) {
|
||||
model_proto = std::move(result).value();
|
||||
} else if (absl::EndsWith(input, ".mps") ||
|
||||
absl::EndsWith(input, ".mps.gz")) {
|
||||
- QCHECK_OK(glop::MPSReader().ParseFile(input, &model_proto))
|
||||
- << "Error while parsing the mps file '" << input << "'.";
|
||||
+ auto retval = glop::MpsFileToMPModelProto(input);
|
||||
+ QCHECK_OK(retval) << "Error while parsing the mps file '" << input << "'.";
|
||||
+ model_proto = *retval;
|
||||
} else {
|
||||
ReadFileToProto(input, &model_proto);
|
||||
ReadFileToProto(input, &request_proto);
|
||||
diff --git a/ortools/lp_data/mps_reader.cc b/ortools/lp_data/mps_reader.cc
|
||||
index 806d5f9cde..681b2c477a 100644
|
||||
--- a/ortools/lp_data/mps_reader.cc
|
||||
+++ b/ortools/lp_data/mps_reader.cc
|
||||
@@ -39,13 +39,13 @@ class MPSReaderImpl {
|
||||
// MpModelProto for the Data type, but it should be easy to add more.
|
||||
template <class Data>
|
||||
absl::Status ParseFile(const std::string& file_name, Data* data,
|
||||
- MPSReader::Form form);
|
||||
+ MPSReaderForm form);
|
||||
|
||||
// Loads instance from string. Useful with MapReduce. Automatically detects
|
||||
// the file's format (free or fixed).
|
||||
template <class Data>
|
||||
absl::Status ParseProblemFromString(const std::string& source, Data* data,
|
||||
- MPSReader::Form form);
|
||||
+ MPSReaderForm form);
|
||||
|
||||
private:
|
||||
// Number of fields in one line of MPS file.
|
||||
@@ -523,19 +523,19 @@ class DataWrapper<MPModelProto> {
|
||||
|
||||
template <class Data>
|
||||
absl::Status MPSReaderImpl::ParseFile(const std::string& file_name, Data* data,
|
||||
- MPSReader::Form form) {
|
||||
+ MPSReaderForm form) {
|
||||
if (data == nullptr) {
|
||||
return absl::InvalidArgumentError("NULL pointer passed as argument.");
|
||||
}
|
||||
|
||||
- if (form == MPSReader::AUTO_DETECT) {
|
||||
- if (ParseFile(file_name, data, MPSReader::FIXED).ok()) {
|
||||
+ if (form == MPSReaderForm::AUTO_DETECT) {
|
||||
+ if (ParseFile(file_name, data, MPSReaderForm::FIXED).ok()) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
- return ParseFile(file_name, data, MPSReader::FREE);
|
||||
+ return ParseFile(file_name, data, MPSReaderForm::FREE);
|
||||
}
|
||||
|
||||
- free_form_ = form == MPSReader::FREE;
|
||||
+ free_form_ = form == MPSReaderForm::FREE;
|
||||
Reset();
|
||||
DataWrapper<Data> data_wrapper(data);
|
||||
data_wrapper.SetUp();
|
||||
@@ -553,15 +553,15 @@ absl::Status MPSReaderImpl::ParseFile(const std::string& file_name, Data* data,
|
||||
template <class Data>
|
||||
absl::Status MPSReaderImpl::ParseProblemFromString(const std::string& source,
|
||||
Data* data,
|
||||
- MPSReader::Form form) {
|
||||
- if (form == MPSReader::AUTO_DETECT) {
|
||||
- if (ParseProblemFromString(source, data, MPSReader::FIXED).ok()) {
|
||||
+ MPSReaderForm form) {
|
||||
+ if (form == MPSReaderForm::AUTO_DETECT) {
|
||||
+ if (ParseProblemFromString(source, data, MPSReaderForm::FIXED).ok()) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
- return ParseProblemFromString(source, data, MPSReader::FREE);
|
||||
+ return ParseProblemFromString(source, data, MPSReaderForm::FREE);
|
||||
}
|
||||
|
||||
- free_form_ = form == MPSReader::FREE;
|
||||
+ free_form_ = form == MPSReaderForm::FREE;
|
||||
Reset();
|
||||
DataWrapper<Data> data_wrapper(data);
|
||||
data_wrapper.SetUp();
|
||||
@@ -1167,12 +1167,12 @@ absl::Status MPSReaderImpl::AppendLineToError(const absl::Status& status) {
|
||||
|
||||
// Parses instance from a file.
|
||||
absl::Status MPSReader::ParseFile(const std::string& file_name,
|
||||
- LinearProgram* data, Form form) {
|
||||
+ LinearProgram* data, MPSReaderForm form) {
|
||||
return MPSReaderImpl().ParseFile(file_name, data, form);
|
||||
}
|
||||
|
||||
absl::Status MPSReader::ParseFile(const std::string& file_name,
|
||||
- MPModelProto* data, Form form) {
|
||||
+ MPModelProto* data, MPSReaderForm form) {
|
||||
return MPSReaderImpl().ParseFile(file_name, data, form);
|
||||
}
|
||||
|
||||
@@ -1180,13 +1180,13 @@ absl::Status MPSReader::ParseFile(const std::string& file_name,
|
||||
// the file's format (free or fixed).
|
||||
absl::Status MPSReader::ParseProblemFromString(const std::string& source,
|
||||
LinearProgram* data,
|
||||
- MPSReader::Form form) {
|
||||
+ MPSReaderForm form) {
|
||||
return MPSReaderImpl().ParseProblemFromString(source, data, form);
|
||||
}
|
||||
|
||||
absl::Status MPSReader::ParseProblemFromString(const std::string& source,
|
||||
MPModelProto* data,
|
||||
- MPSReader::Form form) {
|
||||
+ MPSReaderForm form) {
|
||||
return MPSReaderImpl().ParseProblemFromString(source, data, form);
|
||||
}
|
||||
|
||||
@@ -1194,7 +1194,7 @@ absl::StatusOr<MPModelProto> MpsDataToMPModelProto(
|
||||
const std::string& mps_data) {
|
||||
MPModelProto model;
|
||||
RETURN_IF_ERROR(MPSReaderImpl().ParseProblemFromString(
|
||||
- mps_data, &model, MPSReader::AUTO_DETECT));
|
||||
+ mps_data, &model, MPSReaderForm::AUTO_DETECT));
|
||||
return model;
|
||||
}
|
||||
|
||||
@@ -1202,7 +1202,7 @@ absl::StatusOr<MPModelProto> MpsFileToMPModelProto(
|
||||
const std::string& mps_file) {
|
||||
MPModelProto model;
|
||||
RETURN_IF_ERROR(
|
||||
- MPSReaderImpl().ParseFile(mps_file, &model, MPSReader::AUTO_DETECT));
|
||||
+ MPSReaderImpl().ParseFile(mps_file, &model, MPSReaderForm::AUTO_DETECT));
|
||||
return model;
|
||||
}
|
||||
|
||||
diff --git a/ortools/lp_data/mps_reader.h b/ortools/lp_data/mps_reader.h
|
||||
index 33af74971e..202fdb42fb 100644
|
||||
--- a/ortools/lp_data/mps_reader.h
|
||||
+++ b/ortools/lp_data/mps_reader.h
|
||||
@@ -55,6 +55,8 @@ absl::StatusOr<MPModelProto> MpsDataToMPModelProto(const std::string& mps_data);
|
||||
// Parses an MPS model from a file.
|
||||
absl::StatusOr<MPModelProto> MpsFileToMPModelProto(const std::string& mps_file);
|
||||
|
||||
+enum MPSReaderForm { AUTO_DETECT, FREE, FIXED };
|
||||
+
|
||||
// Implementation class. Please use the 2 functions above.
|
||||
//
|
||||
// Reads a linear program in the mps format.
|
||||
@@ -65,22 +67,20 @@ absl::StatusOr<MPModelProto> MpsFileToMPModelProto(const std::string& mps_file);
|
||||
// TODO(user): Remove the MPSReader class.
|
||||
class ABSL_DEPRECATED("Use the direct methods instead") MPSReader {
|
||||
public:
|
||||
- enum Form { AUTO_DETECT, FREE, FIXED };
|
||||
-
|
||||
// Parses instance from a file.
|
||||
absl::Status ParseFile(const std::string& file_name, LinearProgram* data,
|
||||
- Form form = AUTO_DETECT);
|
||||
+ MPSReaderForm form = AUTO_DETECT);
|
||||
|
||||
absl::Status ParseFile(const std::string& file_name, MPModelProto* data,
|
||||
- Form form = AUTO_DETECT);
|
||||
+ MPSReaderForm form = AUTO_DETECT);
|
||||
// Loads instance from string. Useful with MapReduce. Automatically detects
|
||||
// the file's format (free or fixed).
|
||||
absl::Status ParseProblemFromString(const std::string& source,
|
||||
LinearProgram* data,
|
||||
- MPSReader::Form form = AUTO_DETECT);
|
||||
+ MPSReaderForm form = AUTO_DETECT);
|
||||
absl::Status ParseProblemFromString(const std::string& source,
|
||||
MPModelProto* data,
|
||||
- MPSReader::Form form = AUTO_DETECT);
|
||||
+ MPSReaderForm form = AUTO_DETECT);
|
||||
};
|
||||
|
||||
} // namespace glop
|
||||
diff --git a/ortools/pdlp/iteration_stats.h b/ortools/pdlp/iteration_stats.h
|
||||
index 8e85f04172..0fb6291eba 100644
|
||||
--- a/ortools/pdlp/iteration_stats.h
|
||||
+++ b/ortools/pdlp/iteration_stats.h
|
||||
@@ -11,6 +11,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
+#if defined(USE_PDLP)
|
||||
+
|
||||
#ifndef PDLP_ITERATION_STATS_H_
|
||||
#define PDLP_ITERATION_STATS_H_
|
||||
|
||||
@@ -114,3 +116,5 @@ void SetRandomProjections(const ShardedQuadraticProgram& sharded_qp,
|
||||
} // namespace operations_research::pdlp
|
||||
|
||||
#endif // PDLP_ITERATION_STATS_H_
|
||||
+
|
||||
+#endif // #if defined(USE_PDLP)
|
||||
diff --git a/ortools/pdlp/primal_dual_hybrid_gradient.h b/ortools/pdlp/primal_dual_hybrid_gradient.h
|
||||
index d5d38c1c5a..c68cfd76c2 100644
|
||||
--- a/ortools/pdlp/primal_dual_hybrid_gradient.h
|
||||
+++ b/ortools/pdlp/primal_dual_hybrid_gradient.h
|
||||
@@ -10,6 +10,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
+#if defined(USE_PDLP)
|
||||
|
||||
#ifndef PDLP_PRIMAL_DUAL_HYBRID_GRADIENT_H_
|
||||
#define PDLP_PRIMAL_DUAL_HYBRID_GRADIENT_H_
|
||||
@@ -148,3 +149,5 @@ glop::ProblemSolution ComputeStatuses(const QuadraticProgram& qp,
|
||||
} // namespace operations_research::pdlp
|
||||
|
||||
#endif // PDLP_PRIMAL_DUAL_HYBRID_GRADIENT_H_
|
||||
+
|
||||
+#endif // #if defined(USE_PDLP)
|
||||
diff --git a/ortools/pdlp/quadratic_program.h b/ortools/pdlp/quadratic_program.h
|
||||
index a88e1eabc8..05d41df5b2 100644
|
||||
--- a/ortools/pdlp/quadratic_program.h
|
||||
+++ b/ortools/pdlp/quadratic_program.h
|
||||
@@ -10,6 +10,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
+#if defined(USE_PDLP)
|
||||
|
||||
#ifndef PDLP_QUADRATIC_PROGRAM_H_
|
||||
#define PDLP_QUADRATIC_PROGRAM_H_
|
||||
@@ -214,3 +215,5 @@ void CombineRepeatedTripletsInPlace(
|
||||
} // namespace operations_research::pdlp
|
||||
|
||||
#endif // PDLP_QUADRATIC_PROGRAM_H_
|
||||
+
|
||||
+#endif // #if defined(USE_PDLP)
|
||||
diff --git a/ortools/sat/cp_model_utils.cc b/ortools/sat/cp_model_utils.cc
|
||||
index 194a486253..4bca1c61e9 100644
|
||||
--- a/ortools/sat/cp_model_utils.cc
|
||||
+++ b/ortools/sat/cp_model_utils.cc
|
||||
@@ -439,6 +439,7 @@ std::string ConstraintCaseName(
|
||||
case ConstraintProto::ConstraintCase::CONSTRAINT_NOT_SET:
|
||||
return "kEmpty";
|
||||
}
|
||||
+ throw std::logic_error("Unhandled ConstraintCase enum value");
|
||||
}
|
||||
|
||||
std::vector<int> UsedVariables(const ConstraintProto& ct) {
|
||||
diff --git a/ortools/sat/linear_programming_constraint.cc b/ortools/sat/linear_programming_constraint.cc
|
||||
index 532d16caf4..d7084f1244 100644
|
||||
--- a/ortools/sat/linear_programming_constraint.cc
|
||||
+++ b/ortools/sat/linear_programming_constraint.cc
|
||||
@@ -2616,7 +2616,8 @@ LinearProgrammingConstraint::HeuristicLpReducedCostBinary(Model* model) {
|
||||
std::vector<int> num_cost_to_zero(num_vars);
|
||||
int num_calls = 0;
|
||||
|
||||
- return [=]() mutable {
|
||||
+ return [this, &num_calls, &num_vars, &cost_to_zero, &num_cost_to_zero,
|
||||
+ &variables]() mutable {
|
||||
const double kEpsilon = 1e-6;
|
||||
|
||||
// Every 10000 calls, decay pseudocosts.
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
# Copyright 2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit cmake
|
||||
|
||||
DESCRIPTION=" Google's Operations Research tools"
|
||||
HOMEPAGE="https://developers.google.com/optimization"
|
||||
SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
IUSE='doc coinor cplex examples express glop glpk java parser python samples +scip static-libs'
|
||||
|
||||
DEPEND="coinor? (
|
||||
sci-libs/coinor-utils
|
||||
sci-libs/coinor-osi
|
||||
sci-libs/coinor-clp
|
||||
sci-libs/coinor-cgl
|
||||
sci-libs/coinor-cbc
|
||||
)
|
||||
glpk? ( sci-mathematics/glpk )
|
||||
scip? ( sci-libs/scip )
|
||||
python? ( dev-python/pybind11 )"
|
||||
RDEPEND="${DEPEND}"
|
||||
BDEPEND=""
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/Support-for-USE_PDLP-C-23-and-Werror-changes.patch"
|
||||
)
|
||||
|
||||
# S="${WORKDIR}/${PN}-${PV//./}"
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DBUILD_CXX=ON
|
||||
-DBUILD_DEPS=OFF
|
||||
-DBUILD_ZLIB=OFF
|
||||
-DBUILD_absl=OFF
|
||||
-DBUILD_GLOP=OFF
|
||||
-DBUILD_FLATZINC=OFF
|
||||
-DBUILD_Protobuf=OFF
|
||||
-DBUILD_re2=OFF
|
||||
-DBUILD_CoinUtils=OFF
|
||||
-DBUILD_Osi=OFF
|
||||
-DBUILD_Clp=OFF
|
||||
-DBUILD_Cgl=OFF
|
||||
-DBUILD_Cbc=OFF
|
||||
-DBUILD_GLPK=OFF
|
||||
-DBUILD_HIGHS=OFF
|
||||
-DBUILD_Eigen3=OFF
|
||||
-DBUILD_SCIP=OFF
|
||||
-DBUILD_DOTNET=OFF
|
||||
-DBUILD_pybind11=OFF
|
||||
-DBUILD_SHARED_LIBS=$(usex static-libs OFF ON)
|
||||
-DBUILD_PYTHON=$(usex python)
|
||||
-DBUILD_JAVA=$(usex java)
|
||||
-DBUILD_LP_PARSER=$(usex parser)
|
||||
-DBUILD_SAMPLES=$(usex samples)
|
||||
-DBUILD_EXAMPLES=$(usex examples)
|
||||
-DBUILD_DOC=$(usex doc)
|
||||
-DUSE_COINOR=$(usex coinor)
|
||||
-DUSE_GLPK=$(usex glpk)
|
||||
-DUSE_HIGHS=OFF
|
||||
-DUSE_PDLP=OFF
|
||||
-DUSE_SCIP=$(usex scip)
|
||||
-DUSE_CPLEX=$(usex cplex)
|
||||
-DUSE_XPRESS=$(usex express)
|
||||
)
|
||||
|
||||
#if use pdlp; then
|
||||
# mycmakeargs+=( -DBUILD_PDLP=OFF )
|
||||
#fi
|
||||
|
||||
if use python; then
|
||||
mycmakeargs+=( -DBUILD_VENV=OFF )
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
# Copyright 1999-2022 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
PYTHON_COMPAT=( python3_{9..12} )
|
||||
DISTUTILS_SINGLE_IMPL=1
|
||||
|
||||
inherit cmake distutils-r1
|
||||
|
||||
DESCRIPTION="Google's Operations Research tools"
|
||||
HOMEPAGE="https://developers.google.com/optimization/"
|
||||
|
||||
if [[ ${PV} == 9999 ]]; then
|
||||
EGIT_REPO_URI="https://github.com/google/${PN}.git"
|
||||
inherit git-r3
|
||||
else
|
||||
SRC_URI="https://github.com/google/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
KEYWORDS="~amd64 ~arm64 ~x86"
|
||||
fi
|
||||
|
||||
# BSD for bundled pybind
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
IUSE="+python"
|
||||
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
||||
|
||||
DEPEND="sci-libs/coinor-cbc
|
||||
sci-libs/scipoptsuite
|
||||
$(python_gen_cond_dep '
|
||||
>=dev-python/absl-py-0.13[${PYTHON_USEDEP}]
|
||||
>=dev-python/contourpy-1.0.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/cycler-0.10[${PYTHON_USEDEP}]
|
||||
>=dev-python/fonttools-4.22.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/kiwisolver-1.0.1[${PYTHON_USEDEP}]
|
||||
dev-python/matplotlib[${PYTHON_USEDEP}]
|
||||
dev-python/mypy-protobuf[${PYTHON_USEDEP}]
|
||||
>=dev-python/numpy-1.21.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/packaging-20.0[${PYTHON_USEDEP}]
|
||||
dev-python/pandas[${PYTHON_USEDEP}]
|
||||
>=dev-python/pillow-6.2.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/protobuf-python-3.19.4[${PYTHON_USEDEP}]
|
||||
dev-python/pybind11[${PYTHON_USEDEP}]
|
||||
>=dev-python/pyparsing-2.2.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/python-dateutil-2.8.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/pytz-2020.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/six-1.5[${PYTHON_USEDEP}]
|
||||
')
|
||||
${PYTHON_DEPS}"
|
||||
RDEPEND=""
|
||||
BDEPEND=""
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} == 9999 ]]; then
|
||||
git-r3_src_unpack
|
||||
else
|
||||
default_src_unpack
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
cmake_src_prepare
|
||||
|
||||
sed -i -e 's@ABSL_MUST_USE_RESULT @@' \
|
||||
"${S}"/ortools/linear_solver/linear_solver.h \
|
||||
"${S}"/ortools/constraint_solver/constraint_solver.h \
|
||||
|| die "sed failed"
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DBUILD_DEPS=OFF
|
||||
-DCMAKE_SKIP_RPATH="ON"
|
||||
)
|
||||
use python && mycmakeargs+=(
|
||||
-DBUILD_PYTHON=ON
|
||||
-DBUILD_pybind11=OFF
|
||||
-DPython3_EXECUTABLE="${PYTHON}"
|
||||
-DFETCH_PYTHON_DEPS=OFF
|
||||
-DBUILD_VENV=OFF
|
||||
)
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
cmake_src_compile
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake_src_install
|
||||
python_optimize
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
AUX Enforce-WError-C-C-23-GNUInstallDirs.patch 5713 BLAKE2B 4b4a852a774adcda89fc85c2d45d61cf33c869913a4f8697be2deecc97acc0a83737f3fcd03a97735d6b814617690c666fb90b51405102d2e448e558c477d4cd SHA512 8aef3ae367b29fd03885a181eb8dd33bcbddf090dd5a0b28a272cb717d0501dccf25bd0526e87b70f786f5ec891b18b4b66a5a984936df86994743bd2ef7695e
|
||||
DIST scip-8.0.3.tar.gz 9640665 BLAKE2B 55dd535ae7ceb6e35460301892f940f13b198dacefd8974eb90397840a58fae26d9514b872bc7870491cb8bee0cd733aef68ff253c494b122326c1a5c3b71942 SHA512 fc3d04d090f14f2ff0b9ede63d8a26258d0306cd8fccad8acc571fbe1482f93852377d136b4d437f84b654867f9a70f783d0f1805678c2b9e7331e798b11a2f9
|
||||
EBUILD scip-8.0.3.ebuild 978 BLAKE2B ff6995187a3e05ab4ba4f938275becbadd31e2dd5736f87ba51a028e95addd809159e66c5a4b5706dec6b0c6ef5195c68fb11801c8cd691df832bdddd717ff7e SHA512 effdcc4f613a91967fa9350b748509dd3273986344bd9b610e3ece43ead2282b500c9f4b7964525a119cbf637db7de5f0b8bc6f968aee53b6cc908a8fcc8b492
|
||||
@@ -0,0 +1,135 @@
|
||||
From 0f08136b2dcdc4c68b5ddd01601f813b4da716b9 Mon Sep 17 00:00:00 2001
|
||||
From: Amit Prakash Ambasta <amit.prakash.ambasta@gmail.com>
|
||||
Date: Fri, 9 Jun 2023 14:45:19 +0530
|
||||
Subject: [PATCH] Enforce -WError, C/C++-23, GNUInstallDirs
|
||||
|
||||
Signed-off-by: Amit Prakash Ambasta <amit.prakash.ambasta@gmail.com>
|
||||
---
|
||||
CMakeLists.txt | 8 ++++++++
|
||||
src/CMakeLists.txt | 41 ++++++++++++++++++++++-------------------
|
||||
tests/CMakeLists.txt | 6 +++++-
|
||||
3 files changed, 35 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index adfa268..bf5042b 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -10,9 +10,15 @@ if(POLICY CMP0091)
|
||||
cmake_policy(SET CMP0091 NEW)
|
||||
endif()
|
||||
|
||||
+set(CMAKE_C_STANDARD 23)
|
||||
+set(CMAKE_CXX_STANDARD 23)
|
||||
+
|
||||
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
+
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS_RELEASE}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
|
||||
+
|
||||
set(SCIP_VERSION_MAJOR 8)
|
||||
set(SCIP_VERSION_MINOR 0)
|
||||
set(SCIP_VERSION_PATCH 3)
|
||||
@@ -39,7 +45,9 @@ set(CPACK_PACKAGE_VERSION_MINOR "${SCIP_VERSION_MINOR}")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "${SCIP_VERSION_PATCH}")
|
||||
set(CPACK_PACKAGE_VENDOR "Zuse Institute Berlin")
|
||||
set(CPACK_PACKAGE_CONTACT "http://scipopt.org")
|
||||
+
|
||||
include(CPack)
|
||||
+include(GNUInstallDirs)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 604badc..6fc4351 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -7,9 +7,12 @@ function(setLibProperties targetname outputname)
|
||||
MACOSX_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
endfunction(setLibProperties)
|
||||
|
||||
-set(CMAKE_C_STANDARD 99)
|
||||
+set(CMAKE_C_STANDARD 23)
|
||||
+set(CMAKE_C_EXTENSIONS ON)
|
||||
set(CMAKE_C_STANDARD_REQUIRED on)
|
||||
-set(CMAKE_C_EXTENSIONS OFF)
|
||||
+set(CMAKE_CXX_STANDARD 23)
|
||||
+set(CMAKE_CXX_EXTENSIONS ON)
|
||||
+set(CMAKE_CXX_STANDARD_REQUIRED on)
|
||||
|
||||
if(NOT WIN32)
|
||||
set(SCIP_COMP_OPTIONS ${SCIP_COMP_OPTIONS} "$<$<COMPILE_LANGUAGE:C>:-D_XOPEN_SOURCE=600>")
|
||||
@@ -1096,27 +1099,27 @@ target_include_directories(scip PUBLIC
|
||||
|
||||
# set the install rpath to the installed destination
|
||||
set_target_properties(scip PROPERTIES
|
||||
- INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib"
|
||||
+ INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}"
|
||||
INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
# install the header files of scip
|
||||
-install(FILES ${lpiheaders} DESTINATION include/lpi)
|
||||
-install(FILES ${dijkstraheaders} DESTINATION include/dijkstra)
|
||||
-install(FILES ${objscipheaders} DESTINATION include/objscip)
|
||||
-install(FILES ${scipheaders} ${PROJECT_BINARY_DIR}/scip/config.h ${PROJECT_BINARY_DIR}/scip/scip_export.h DESTINATION include/scip)
|
||||
-install(FILES ${tcliqueheaders} DESTINATION include/tclique)
|
||||
-install(FILES ${tinycthreadheader} DESTINATION include/tinycthread)
|
||||
-install(FILES ${tpiheaders} DESTINATION include/tpi)
|
||||
-install(FILES ${xmlheaders} DESTINATION include/xml)
|
||||
-install(FILES ${symheaders} DESTINATION include/symmetry)
|
||||
-install(FILES ${blockmemshellheader} DESTINATION include/blockmemshell)
|
||||
+install(FILES ${lpiheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lpi)
|
||||
+install(FILES ${dijkstraheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dijkstra)
|
||||
+install(FILES ${objscipheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/objscip)
|
||||
+install(FILES ${scipheaders} ${PROJECT_BINARY_DIR}/scip/config.h ${PROJECT_BINARY_DIR}/scip/scip_export.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/scip)
|
||||
+install(FILES ${tcliqueheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tclique)
|
||||
+install(FILES ${tinycthreadheader} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tinycthread)
|
||||
+install(FILES ${tpiheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tpi)
|
||||
+install(FILES ${xmlheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xml)
|
||||
+install(FILES ${symheaders} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/symmetry)
|
||||
+install(FILES ${blockmemshellheader} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/blockmemshell)
|
||||
|
||||
# install the binary and the library to appropriate locations and add them to an export group
|
||||
install(TARGETS scip libscip EXPORT scip-targets
|
||||
- LIBRARY DESTINATION lib
|
||||
- ARCHIVE DESTINATION lib
|
||||
- RUNTIME DESTINATION bin
|
||||
- INCLUDES DESTINATION include)
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
# Add all targets to the build-tree export set
|
||||
export(TARGETS scip libscip ${BLISS_TARGET}
|
||||
@@ -1156,7 +1159,7 @@ configure_file(${PROJECT_SOURCE_DIR}/scip-config.cmake.in
|
||||
|
||||
# install the targets of the scip export group and the config file so that other projects
|
||||
# can link easily against scip
|
||||
-install(EXPORT scip-targets DESTINATION lib/cmake/scip)
|
||||
+install(EXPORT scip-targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/scip)
|
||||
install(FILES "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/scip-config.cmake"
|
||||
${PROJECT_BINARY_DIR}/scip-config-version.cmake
|
||||
- DESTINATION lib/cmake/scip)
|
||||
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/scip)
|
||||
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
|
||||
index eb6925d..b71c312 100644
|
||||
--- a/tests/CMakeLists.txt
|
||||
+++ b/tests/CMakeLists.txt
|
||||
@@ -43,8 +43,12 @@ include(CTest)
|
||||
#
|
||||
# define the C99 standard for older compilers (gcc < 5.0)
|
||||
#
|
||||
-set(CMAKE_C_STANDARD 99)
|
||||
+set(CMAKE_C_STANDARD 23)
|
||||
+set(CMAKE_C_EXTENSIONS ON)
|
||||
set(CMAKE_C_STANDARD_REQUIRED on)
|
||||
+set(CMAKE_CXX_STANDARD 23)
|
||||
+set(CMAKE_CXX_EXTENSIONS ON)
|
||||
+set(CMAKE_CXX_STANDARD_REQUIRED on)
|
||||
|
||||
#
|
||||
# unit tests depend on the presence of the Criterion framework
|
||||
--
|
||||
2.41.0
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
# Copyright 2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit cmake
|
||||
|
||||
DESCRIPTION="SCIP - Solving Constraint Integer Programs"
|
||||
HOMEPAGE="https://scipopt.org/"
|
||||
SRC_URI="https://github.com/scipopt/${PN}/archive/v${PV//./}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="zuse"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
IUSE='ampl ipopt papilo gmp readline static-libs worhp zimpl zlib'
|
||||
|
||||
DEPEND="gmp? ( dev-libs/gmp )
|
||||
ipopt? ( sci-libs/ipopt )
|
||||
readline? ( sys-libs/readline )
|
||||
zlib? ( sys-libs/zlib )"
|
||||
RDEPEND="${DEPEND}"
|
||||
BDEPEND=""
|
||||
|
||||
S="${WORKDIR}/${PN}-${PV//./}"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/Enforce-WError-C-C-23-GNUInstallDirs.patch"
|
||||
)
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DAUTOBUILD=OFF
|
||||
-DBUILD_SHARED=$(usex static-libs OFF ON)
|
||||
-DZLIB=$(usex zlib)
|
||||
-DREADLINE=$(usex readline)
|
||||
-DGMP=$(usex gmp)
|
||||
-DPAPILO=$(usex papilo)
|
||||
-DZIMPL=$(usex zimpl)
|
||||
-DAMPL=$(usex ampl)
|
||||
-DIPOPT=$(usex ipopt)
|
||||
-DWORHP=$(usex worhp)
|
||||
)
|
||||
cmake_src_configure
|
||||
}
|
||||
Reference in New Issue
Block a user