Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add formula for symphony (MIP solver).

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
  • Loading branch information...
commit 2f4cf5383f316b16a5417cd6c861c472cc570765 1 parent efdd19d
Michael Friedlander authored adamv committed
Showing with 42 additions and 0 deletions.
  1. +42 −0 Library/Formula/symphony.rb
42 Library/Formula/symphony.rb
View
@@ -0,0 +1,42 @@
+require 'formula'
+
+class Symphony < Formula
+ url 'http://www.coin-or.org/download/source/SYMPHONY/SYMPHONY-5.3.3.tgz'
+ homepage 'http://www.coin-or.org/projects/SYMPHONY.xml'
+ md5 '8c34f9fa49ebff325b984408ff1f92fc'
+
+ def options
+ [
+ ["--enable-openmp", "Enable openmp support"],
+ ["--with-gmpl", "Add in GNU Modeling Lang. support via GLPK"]
+ ]
+ end
+
+ def install
+ args = ["--disable-debug", "--disable-dependency-tracking",
+ "--enable-shared=no", # can't get shared libs to work
+ "--enable-static-executable",
+ "--prefix=#{prefix}"]
+
+ if ARGV.include? "--with-gmpl"
+ # Symphony uses a patched version of GLPK for reading MPL files.
+ # Use a private version rather than require the Homebrew version of GLPK.
+ Dir.chdir 'ThirdParty/Glpk' do
+ system "./get.Glpk"
+ end
+ dir_glpk = Pathname.getwd + 'ThirdParty/Glpk/glpk/src'
+ ENV.append "CPPFLAGS", "-I#{dir_glpk}"
+ ENV.append "CDEFS", "-DUSE_GLPMPL"
+ args << "--with-gmpl"
+ end
+
+ if ARGV.include? "--enable-openmp"
+ inreplace 'SYMPHONY/config', /^SYM_COMPILE_IN_LP = TRUE/, "SYM_COMPILE_IN_LP = FALSE"
+ args << "--enable-openmp"
+ end
+
+ system "./configure", *args
+ system "make"
+ system "make install"
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.