2011-03-30 21:49:19 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Symphony < Formula
|
|
|
|
homepage 'http://www.coin-or.org/projects/SYMPHONY.xml'
|
2012-02-21 06:04:21 +00:00
|
|
|
url 'http://www.coin-or.org/download/source/SYMPHONY/SYMPHONY-5.3.3.tgz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 'afc38ee5655b52fc3fa0a5854b5cc5a7f31618cc'
|
2011-03-30 21:49:19 +00:00
|
|
|
|
2012-08-25 16:54:43 +00:00
|
|
|
option "enable-openmp", "Enable openmp support"
|
|
|
|
option "with-gmpl", "GNU Modeling Language support via GLPK"
|
2011-03-30 21:49:19 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
args = ["--disable-debug", "--disable-dependency-tracking",
|
|
|
|
"--enable-shared=no", # can't get shared libs to work
|
|
|
|
"--enable-static-executable",
|
|
|
|
"--prefix=#{prefix}"]
|
|
|
|
|
2012-08-25 16:54:43 +00:00
|
|
|
if build.include? "with-gmpl"
|
2011-03-30 21:49:19 +00:00
|
|
|
# Symphony uses a patched version of GLPK for reading MPL files.
|
|
|
|
# Use a private version rather than require the Homebrew version of GLPK.
|
2012-02-21 06:04:21 +00:00
|
|
|
cd 'ThirdParty/Glpk' do
|
2011-03-30 21:49:19 +00:00
|
|
|
system "./get.Glpk"
|
|
|
|
end
|
2012-05-08 05:35:59 +00:00
|
|
|
|
|
|
|
ENV.append "CPPFLAGS", "-I#{buildpath}/ThirdParty/Glpk/glpk/src"
|
2011-03-30 21:49:19 +00:00
|
|
|
ENV.append "CDEFS", "-DUSE_GLPMPL"
|
|
|
|
args << "--with-gmpl"
|
|
|
|
end
|
|
|
|
|
2012-08-25 16:54:43 +00:00
|
|
|
if build.include? "enable-openmp"
|
2011-03-30 21:49:19 +00:00
|
|
|
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
|