Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add formula for symphony (MIP solver).

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
  • Loading branch information...
commit 2f4cf5383f316b16a5417cd6c861c472cc570765 1 parent efdd19d
Michael Friedlander mpf authored adamv committed

Showing 1 changed file with 42 additions and 0 deletions. Show diff stats Hide diff stats

  1. +42 0 Library/Formula/symphony.rb
42 Library/Formula/symphony.rb
... ... @@ -0,0 +1,42 @@
  1 +require 'formula'
  2 +
  3 +class Symphony < Formula
  4 + url 'http://www.coin-or.org/download/source/SYMPHONY/SYMPHONY-5.3.3.tgz'
  5 + homepage 'http://www.coin-or.org/projects/SYMPHONY.xml'
  6 + md5 '8c34f9fa49ebff325b984408ff1f92fc'
  7 +
  8 + def options
  9 + [
  10 + ["--enable-openmp", "Enable openmp support"],
  11 + ["--with-gmpl", "Add in GNU Modeling Lang. support via GLPK"]
  12 + ]
  13 + end
  14 +
  15 + def install
  16 + args = ["--disable-debug", "--disable-dependency-tracking",
  17 + "--enable-shared=no", # can't get shared libs to work
  18 + "--enable-static-executable",
  19 + "--prefix=#{prefix}"]
  20 +
  21 + if ARGV.include? "--with-gmpl"
  22 + # Symphony uses a patched version of GLPK for reading MPL files.
  23 + # Use a private version rather than require the Homebrew version of GLPK.
  24 + Dir.chdir 'ThirdParty/Glpk' do
  25 + system "./get.Glpk"
  26 + end
  27 + dir_glpk = Pathname.getwd + 'ThirdParty/Glpk/glpk/src'
  28 + ENV.append "CPPFLAGS", "-I#{dir_glpk}"
  29 + ENV.append "CDEFS", "-DUSE_GLPMPL"
  30 + args << "--with-gmpl"
  31 + end
  32 +
  33 + if ARGV.include? "--enable-openmp"
  34 + inreplace 'SYMPHONY/config', /^SYM_COMPILE_IN_LP = TRUE/, "SYM_COMPILE_IN_LP = FALSE"
  35 + args << "--enable-openmp"
  36 + end
  37 +
  38 + system "./configure", *args
  39 + system "make"
  40 + system "make install"
  41 + end
  42 +end

0 comments on commit 2f4cf53

Please sign in to comment.
Something went wrong with that request. Please try again.