From 4946dec24554b4749fb243c4cffad3b78d309716 Mon Sep 17 00:00:00 2001 From: Thierry Moisan Date: Mon, 10 Aug 2015 18:21:19 -0400 Subject: [PATCH] ibex 2.1.16 (new formula) Closes Homebrew/homebrew#42769. Signed-off-by: Dominyk Tiller --- Formula/ibex.rb | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Formula/ibex.rb diff --git a/Formula/ibex.rb b/Formula/ibex.rb new file mode 100644 index 0000000000..24b9fe70a5 --- /dev/null +++ b/Formula/ibex.rb @@ -0,0 +1,40 @@ +class Ibex < Formula + desc "C++ library for constraint processing over real numbers." + homepage "http://www.ibex-lib.org/" + url "http://www.ibex-lib.org/sites/default/files/ibex-2.1.16.tar.gz" + sha256 "d92ff32f14d27ad7b390ae693beb311b58cf6babccac85bbdaa5f5d0b8648845" + + option "with-java", "Build Java bindings for Choco solver." + + depends_on :java => ["1.8+", :optional] + depends_on "bison" => :build + depends_on "flex" => :build + depends_on "pkg-config" => :build + + def install + args = ["--prefix=#{prefix}"] + + if build.with? "java" + args << "--with-jni" + else + args << "--enable-shared" + end + + system "./waf", "configure", *args + system "./waf", "install" + + cd "examples" do + cxxflags = "-frounding-math -ffloat-store -I#{include} -I#{include}/ibex" + libflags = "-L#{lib} -libex -lprim -lClp -lCoinUtils -lm" + system "make", "defaultsolver", "LIBS=#{libflags}", "CXXFLAGS=#{cxxflags}" + end + + pkgshare.install %w[examples benchs] + end + + test do + cp_r "#{pkgshare}/examples/.", testpath + cp "#{pkgshare}/benchs/cyclohexan3D.bch", testpath + system "./defaultsolver", "cyclohexan3D.bch", "1e-05", "10" + end +end