68 lines
2.5 KiB
Ruby
68 lines
2.5 KiB
Ruby
class OrTools < Formula
|
|
desc "Google's Operations Research tools"
|
|
homepage "https://developers.google.com/optimization/"
|
|
url "https://github.com/google/or-tools/archive/v8.1.tar.gz"
|
|
sha256 "beb9fe379977033151045d0815d26c628ad99d74d68b9f3b707578492723731e"
|
|
license "Apache-2.0"
|
|
revision 1
|
|
head "https://github.com/google/or-tools.git"
|
|
|
|
livecheck do
|
|
url :stable
|
|
strategy :github_latest
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any, big_sur: "7f7b982dc5ef05f671a7054cdc75c3b44d1f45286176c05a2dabce60d153bb7b"
|
|
sha256 cellar: :any, catalina: "7c32b55ad051a22b0803f977faf76c9dac47d3a4d6b756dec58ae3833441cb14"
|
|
sha256 cellar: :any, mojave: "821de8ceea139f1b674190ef66ce25f39bafeb1f92fe64a5168d47a3dae3e2af"
|
|
end
|
|
|
|
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",
|
|
"-L#{Formula["abseil"].opt_lib}", "-labsl_time",
|
|
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
|