forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mrbayes.rb
64 lines (52 loc) · 1.89 KB
/
mrbayes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require 'formula'
class Mrbayes < Formula
homepage 'http://mrbayes.sourceforge.net/'
url 'http://sourceforge.net/projects/mrbayes/files/mrbayes/3.2.1/mrbayes-3.2.1.tar.gz'
sha1 '8fcb2b7055bde57b33120e6d17ce1a12e399a9a8'
head 'https://mrbayes.svn.sourceforge.net/svnroot/mrbayes/trunk/', :using => :svn
option 'with-beagle', 'Build with BEAGLE library support'
option 'with-mpi', 'Build with MPI parallel support'
depends_on :autoconf => :build
depends_on :automake => :build
depends_on MPIDependency.new(:cc) if build.include? 'with-mpi'
depends_on 'beagle' => :optional if build.include? 'with-beagle'
fails_with :llvm do
build 2336
cause "build hangs at calling `as`: http://sourceforge.net/tracker/index.php?func=detail&aid=3426528&group_id=129302&atid=714418"
end
def install
args = ["--disable-debug", "--prefix=#{prefix}"]
if build.include? 'with-beagle'
args << "--with-beagle=#{Formula.factory('beagle').opt_prefix}"
else
args << "--with-beagle=no"
end
if build.include? 'with-mpi'
# Open-mpi builds only with llvm-gcc due to a bug (see open-mpi formula)
# therefore open-mpi attempts to run llvm-gcc instead of clang.
# But MrBayes hangs with llvm-gcc!
# https://sourceforge.net/tracker/index.php?func=detail&aid=3426528&group_id=129302&atid=714418
ENV['OMPI_CC'] = ENV.cc
args << "--enable-mpi=yes"
end
cd 'src' do
system "autoconf"
system "./configure", *args
system "make"
bin.install "mb"
end
# Doc and examples are not included in the svn
(share/'mrbayes').install ['documentation', 'examples'] unless build.head?
end
def caveats
unless build.head?
<<-EOS.undent
The documentation and examples are installed to
#{HOMEBREW_PREFIX}/share/mrbayes
EOS
end
end
def test
system "echo 'version' | #{bin}/mb"
end
end