Skip to content

Commit

Permalink
math/or-tools: Fix build with abseil 20230125.0+ and re2 20230601+
Browse files Browse the repository at this point in the history
  • Loading branch information
sunpoet committed Sep 11, 2023
1 parent 5740e7f commit cd1837f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions math/or-tools/Makefile
Expand Up @@ -35,6 +35,7 @@ USE_LDCONFIG= yes
CMAKE_OFF= BUILD_PYTHON BUILD_DEPS INSTALL_BUILD_DEPS BUILD_EXAMPLES BUILD_SAMPLES
CMAKE_ON= BUILD_CXX
CMAKE_TESTING_ON= BUILD_EXAMPLES BUILD_CXX_EXAMPLES
CXXFLAGS+= -DABSL_LEGACY_THREAD_ANNOTATIONS

CONFIGURE_ENV= UNIX_CBC_DIR=${LOCALBASE} UNIX_CLP_DIR=${LOCALBASE}

Expand Down
20 changes: 20 additions & 0 deletions math/or-tools/files/patch-abseil
@@ -0,0 +1,20 @@
--- ortools/lp_data/lp_parser.cc.orig 2022-11-25 09:21:54 UTC
+++ ortools/lp_data/lp_parser.cc
@@ -185,7 +185,7 @@ bool LPParser::ParseIntegerVariablesList(StringPiece l

bool LPParser::ParseConstraint(StringPiece constraint) {
const StatusOr<ParsedConstraint> parsed_constraint_or_status =
- ::operations_research::glop::ParseConstraint(constraint.as_string());
+ ::operations_research::glop::ParseConstraint(std::string(constraint));
if (!parsed_constraint_or_status.ok()) return false;
const ParsedConstraint& parsed_constraint =
parsed_constraint_or_status.value();
@@ -414,7 +414,7 @@ StatusOr<ParsedConstraint> ParseConstraint(absl::strin
if (ConsumeToken(&constraint, &consumed_name, &consumed_coeff) !=
TokenType::END) {
return absl::InvalidArgumentError(absl::StrCat(
- "End of input was expected, found: ", constraint.as_string()));
+ "End of input was expected, found: ", std::string(constraint)));
}
}

0 comments on commit cd1837f

Please sign in to comment.