2010-02-26 09:50:15 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class OpenMpi < Formula
|
2011-03-15 19:41:49 +00:00
|
|
|
homepage 'http://www.open-mpi.org/'
|
2012-10-10 09:22:53 +00:00
|
|
|
url 'http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.2.tar.bz2'
|
|
|
|
sha1 '694fd3bac911cdb22f77175884d819b6fea871df'
|
2012-05-17 20:57:36 +00:00
|
|
|
|
2012-08-03 06:33:49 +00:00
|
|
|
# Reported upstream at version 1.6, both issues
|
2012-05-17 20:57:36 +00:00
|
|
|
# http://www.open-mpi.org/community/lists/devel/2012/05/11003.php
|
2012-08-03 06:33:49 +00:00
|
|
|
# http://www.open-mpi.org/community/lists/devel/2012/08/11362.php
|
2012-05-17 20:57:36 +00:00
|
|
|
fails_with :clang do
|
2012-08-03 06:33:49 +00:00
|
|
|
build 421
|
2012-10-10 09:22:53 +00:00
|
|
|
cause 'fails make check on Lion and ML'
|
2012-05-17 20:57:36 +00:00
|
|
|
end
|
|
|
|
|
2012-10-21 19:47:53 +00:00
|
|
|
option 'disable-fortran', 'Do not build the Fortran bindings'
|
|
|
|
option 'test', 'Verify the build with make check'
|
2010-02-26 09:50:15 +00:00
|
|
|
|
|
|
|
def install
|
2012-05-17 20:57:36 +00:00
|
|
|
args = %W[
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--enable-ipv6
|
|
|
|
]
|
2012-10-21 19:47:53 +00:00
|
|
|
if build.include? 'disable-fortran'
|
2012-05-17 20:57:36 +00:00
|
|
|
args << '--disable-mpi-f77' << '--disable-mpi-f90'
|
|
|
|
else
|
|
|
|
ENV.fortran
|
|
|
|
end
|
2012-06-20 09:58:29 +00:00
|
|
|
|
2012-05-17 20:57:36 +00:00
|
|
|
system './configure', *args
|
|
|
|
system 'make all'
|
2012-10-21 19:47:53 +00:00
|
|
|
system 'make check' if build.include? 'test'
|
2012-05-17 20:57:36 +00:00
|
|
|
system 'make install'
|
2012-06-20 09:58:29 +00:00
|
|
|
|
|
|
|
# If Fortran bindings were built, there will be a stray `.mod` file
|
|
|
|
# (Fortran header) in `lib` that needs to be moved to `include`.
|
2012-05-17 20:57:36 +00:00
|
|
|
mv "#{lib}/mpi.mod", include if File.exists? "#{lib}/mpi.mod"
|
2012-06-20 09:58:29 +00:00
|
|
|
|
2012-05-17 20:57:36 +00:00
|
|
|
mv "#{bin}/vtsetup.jar", libexec
|
|
|
|
(bin+'vtsetup.jar').write <<-EOS.undent
|
|
|
|
#!/bin/bash
|
|
|
|
java -jar "#{libexec}/vtsetup.jar" "$@"
|
|
|
|
EOS
|
2010-02-26 09:50:15 +00:00
|
|
|
end
|
|
|
|
end
|