2017-07-21 12:33:07 +00:00
|
|
|
class Glpk < Formula
|
|
|
|
desc "Library for Linear and Mixed-Integer Programming"
|
|
|
|
homepage "https://www.gnu.org/software/glpk/"
|
2017-07-25 09:03:03 +00:00
|
|
|
url "https://ftp.gnu.org/gnu/glpk/glpk-4.63.tar.gz"
|
|
|
|
mirror "https://ftpmirror.gnu.org/glpk/glpk-4.63.tar.gz"
|
|
|
|
sha256 "914d27f1a51c2bf4a51f1bd4a507f875fcca99db7b219380b836a25b29b3e7f6"
|
2017-07-21 12:33:07 +00:00
|
|
|
|
2017-07-21 12:59:25 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2017-09-16 12:13:24 +00:00
|
|
|
sha256 "cf81b5c532d726bb08ae3ebb5c22e7ad763334ecc586b4ec7eafeba49b9a8dc4" => :high_sierra
|
2017-07-25 09:12:21 +00:00
|
|
|
sha256 "c5491836b25e7fe78f37d56b72406f9dabf9caeec8ea97e1b4b0356ab228fd6c" => :sierra
|
|
|
|
sha256 "af604b5830e07dafadc57b26b84c352d6de62904dfb2587dcdc6a201601d8cda" => :el_capitan
|
|
|
|
sha256 "ea544cd7cc6b81e513909ac35825cd4b67ae5d7500d2553dad3eb679939d7f71" => :yosemite
|
2017-07-21 12:59:25 +00:00
|
|
|
end
|
|
|
|
|
2017-07-21 12:33:07 +00:00
|
|
|
depends_on "gmp"
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "./configure", "--prefix=#{prefix}",
|
|
|
|
"--disable-dependency-tracking",
|
|
|
|
"--with-gmp"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2017-10-18 12:55:14 +00:00
|
|
|
(testpath/"test.c").write <<~EOS
|
2017-07-21 12:33:07 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "glpk.h"
|
|
|
|
|
|
|
|
int main(int argc, const char *argv[])
|
|
|
|
{
|
|
|
|
printf("%s", glp_version());
|
|
|
|
return 0;
|
|
|
|
}
|
2017-10-18 12:55:14 +00:00
|
|
|
EOS
|
2017-07-21 12:33:07 +00:00
|
|
|
system ENV.cc, "test.c", "-L#{lib}", "-I#{include}", "-lglpk", "-o", "test"
|
|
|
|
assert_match version.to_s, shell_output("./test")
|
|
|
|
end
|
|
|
|
end
|