Skip to content

or-tools 9.14 #227389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions Formula/o/or-tools.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
class OrTools < Formula
desc "Google's Operations Research tools"
homepage "https://developers.google.com/optimization/"
url "https://github.com/google/or-tools/archive/refs/tags/v9.11.tar.gz"
sha256 "f6a0bd5b9f3058aa1a814b798db5d393c31ec9cbb6103486728997b49ab127bc"
url "https://github.com/google/or-tools/archive/refs/tags/v9.14.tar.gz"
sha256 "9019facf316b54ee72bb58827efc875df4cfbb328fbf2b367615bf2226dd94ca"
license "Apache-2.0"
revision 7
head "https://github.com/google/or-tools.git", branch: "stable"

livecheck do
Expand Down Expand Up @@ -35,22 +34,18 @@
depends_on "protobuf"
depends_on "re2"
depends_on "scip"
uses_from_macos "bzip2"
uses_from_macos "zlib"

# Add missing `#include`s to fix incompatibility with `abseil` 20240722.0.
# https://github.com/google/or-tools/pull/4339
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/bb1af4bcb2ac8b2af4de4411d1ce8a6876ed9c15/or-tools/abseil-vlog-is-on.patch"
sha256 "0f8f28e7363a36c6bafb9b60dc6da880b39d5b56d8ead350f27c8cb1e275f6b6"
end

def install
# FIXME: Upstream enabled Highs support in their binary distribution, but our build fails with it.
# FIXME: turned off SCIP, otherwise or-tools fails to build with "Target SCIP::libscip not available."
args = %w[
-DUSE_HIGHS=OFF
-DBUILD_DEPS=OFF
-DBUILD_SAMPLES=OFF
-DBUILD_EXAMPLES=OFF
-DUSE_SCIP=OFF
]
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
Expand All @@ -60,7 +55,7 @@
pkgshare.install "ortools/sat/samples/simple_sat_program.cc"
end

test do

Check failure on line 58 in Formula/o/or-tools.rb

View workflow job for this annotation

GitHub Actions / Linux x86_64

`brew test --verbose or-tools` failed on Linux x86_64!

/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/test.rb:54:in '<main>'
# Linear Solver & Glop Solver
(testpath/"CMakeLists.txt").write <<~CMAKE
cmake_minimum_required(VERSION 3.14)
Expand All @@ -86,14 +81,22 @@
# Routing Solver
system ENV.cxx, "-std=c++17", pkgshare/"simple_routing_program.cc",
"-I#{include}", "-L#{lib}", "-lortools",
"-DOR_PROTO_DLL=", "-DPROTOBUF_USE_DLLS",
*shell_output("pkg-config --cflags --libs absl_check absl_log").chomp.split,
"-o", "simple_routing_program"
system "./simple_routing_program"

# Sat Solver
absl_libs = %w[
absl_check
absl_log_initialize
absl_flags
absl_flags_parse
]
system ENV.cxx, "-std=c++17", pkgshare/"simple_sat_program.cc",
"-I#{include}", "-L#{lib}", "-lortools",
*shell_output("pkg-config --cflags --libs absl_check absl_log absl_raw_hash_set").chomp.split,
"-DOR_PROTO_DLL=", "-DPROTOBUF_USE_DLLS",
*shell_output("pkg-config --cflags --libs #{absl_libs.join(" ")}").chomp.split,
"-o", "simple_sat_program"
system "./simple_sat_program"
end
Expand Down
Loading