<commit_before>class Glpk < Formula
  homepage "https://www.gnu.org/software/glpk/"
  url "http://ftpmirror.gnu.org/glpk/glpk-4.52.tar.gz"
  mirror "https://ftp.gnu.org/gnu/glpk/glpk-4.52.tar.gz"
  sha1 "44b30b0de777a0a07e00615ac6791af180ff4d2c"

  bottle do
    root_url "https://downloads.sf.net/project/machomebrew/Bottles/science"
    cellar :any
    sha1 "0ccfb05a60ae7ddbc9c53d5333b0a51b3e86694e" => :yosemite
    sha1 "da31c189499c716772e13ec8037ae896d01866ab" => :mavericks
    sha1 "0d02d5430580f440c1477996dffa596871931796" => :mountain_lion
  end

  def install
    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}"
    system "make"
    system "make", "check"
    system "make", "install"
  end

  test do
    (testpath/"test.c").write <<-EOF.undent
    #include "stdio.h"
    #include "glpk.h"

    int main(int argc, const char *argv[])
    {
        printf("%s", glp_version());
        return 0;
    }
    EOF
    system ENV.cc, "test.c", "-lglpk", "-o", "test"
    assert_equal `./test`, version.to_s
  end
end<commit_msg>glpk: build with gmp<commit_after>class Glpk < Formula
  homepage "https://www.gnu.org/software/glpk/"
  url "http://ftpmirror.gnu.org/glpk/glpk-4.52.tar.gz"
  mirror "https://ftp.gnu.org/gnu/glpk/glpk-4.52.tar.gz"
  sha1 "44b30b0de777a0a07e00615ac6791af180ff4d2c"

  bottle do
    root_url "https://downloads.sf.net/project/machomebrew/Bottles/science"
    cellar :any
    sha1 "0ccfb05a60ae7ddbc9c53d5333b0a51b3e86694e" => :yosemite
    sha1 "da31c189499c716772e13ec8037ae896d01866ab" => :mavericks
    sha1 "0d02d5430580f440c1477996dffa596871931796" => :mountain_lion
  end

  depends_on "gmp" => :recommended

  def install
    args = %W[--disable-dependency-tracking --prefix=#{prefix}]
    args << "--with-gmp" if build.with? "gmp"
    system "./configure", *args
    system "make"
    system "make", "check"
    system "make", "install"
  end

  test do
    (testpath/"test.c").write <<-EOF.undent
    #include "stdio.h"
    #include "glpk.h"

    int main(int argc, const char *argv[])
    {
        printf("%s", glp_version());
        return 0;
    }
    EOF
    system ENV.cc, "test.c", "-lglpk", "-o", "test"
    assert_equal `./test`, version.to_s
  end
end
{'fraction_non_alphanumeric': 0.14993365767359576, 'fraction_numerical': 0.10437859354268023, 'mean_word_length': 3.097826086956522, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 10, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '267170', 'n_tokens_mistral': 1054, 'n_tokens_neox': 920, 'n_words': 156}