Skip to content

Commit

Permalink
or-tools 8.0 (new formula)
Browse files Browse the repository at this point in the history
Closes #62790.

Signed-off-by: Dawid Dziurla <[email protected]>
Signed-off-by: Sean Molenaar <[email protected]>
  • Loading branch information
Mizux authored and SMillerDev committed Oct 19, 2020
1 parent 4cfe776 commit 3b40849
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions Formula/or-tools.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
class OrTools < Formula
desc "Google's Operations Research tools"
homepage "https://developers.google.com/optimization/"
url "https://github.com/google/or-tools/archive/v8.0.tar.gz"
sha256 "ac01d7ebde157daaeb0e21ce54923a48e4f1d21faebd0b08a54979f150f909ee"
license "Apache-2.0"
head "https://github.com/google/or-tools.git"

depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "abseil"
depends_on "cbc"
depends_on "cgl"
depends_on "clp"
depends_on "coinutils"
depends_on "gflags"
depends_on "glog"
depends_on "osi"
depends_on "protobuf"

def install
system "cmake", "-S.", "-Bbuild", *std_cmake_args,
"-DUSE_SCIP=OFF", "-DBUILD_SAMPLES=OFF", "-DBUILD_EXAMPLES=OFF"
system "cmake", "--build", "build", "-v"
system "cmake", "--build", "build", "--target", "install"
pkgshare.install "ortools/linear_solver/samples/simple_lp_program.cc"
pkgshare.install "ortools/constraint_solver/samples/simple_routing_program.cc"
pkgshare.install "ortools/sat/samples/simple_sat_program.cc"
end

test do
# Linear Solver & Glop Solver
system ENV.cxx, "-std=c++17",
"-I#{include}", "-L#{lib}", "-lortools",
"-L#{Formula["gflags"].opt_lib}", "-lgflags",
"-L#{Formula["glog"].opt_lib}", "-lglog",
pkgshare/"simple_lp_program.cc", "-o", "simple_lp_program"
system "./simple_lp_program"
# Routing Solver
system ENV.cxx, "-std=c++17",
"-I#{include}", "-L#{lib}", "-lortools",
"-L#{Formula["gflags"].opt_lib}", "-lgflags",
"-L#{Formula["glog"].opt_lib}", "-lglog",
pkgshare/"simple_routing_program.cc", "-o", "simple_routing_program"
system "./simple_routing_program"
# Sat Solver
system ENV.cxx, "-std=c++17",
"-I#{include}", "-L#{lib}", "-lortools",
"-L#{Formula["gflags"].opt_lib}", "-lgflags",
"-L#{Formula["glog"].opt_lib}", "-lglog",
pkgshare/"simple_sat_program.cc", "-o", "simple_sat_program"
system "./simple_sat_program"
end
end

0 comments on commit 3b40849

Please sign in to comment.