2012-02-16 16:26:16 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Mpich2 < Formula
|
|
|
|
homepage 'http://www.mcs.anl.gov/research/projects/mpich2/index.php'
|
2012-10-10 18:35:48 +00:00
|
|
|
url 'http://www.mcs.anl.gov/research/projects/mpich2/downloads/tarballs/1.5/mpich2-1.5.tar.gz'
|
|
|
|
sha1 'be7448227dde5badf3d6ebc0c152b200998421e0'
|
2012-10-21 20:15:36 +00:00
|
|
|
|
2012-05-17 23:10:37 +00:00
|
|
|
head 'https://svn.mcs.anl.gov/repos/mpi/mpich2/trunk'
|
|
|
|
|
|
|
|
# the HEAD version requires the autotools to be installed
|
2012-10-10 18:35:48 +00:00
|
|
|
# (autoconf>=2.67, automake>=1.12.3, libtool>=2.4)
|
2012-10-21 20:15:36 +00:00
|
|
|
if build.head?
|
2012-05-17 23:10:37 +00:00
|
|
|
depends_on 'automake' => :build
|
|
|
|
depends_on 'libtool' => :build
|
|
|
|
end
|
2012-02-16 16:26:16 +00:00
|
|
|
|
2012-10-21 20:15:36 +00:00
|
|
|
option 'disable-fortran', "Do not attempt to build Fortran bindings"
|
2012-05-17 18:29:38 +00:00
|
|
|
|
2012-02-16 16:26:16 +00:00
|
|
|
def install
|
2012-10-21 20:15:36 +00:00
|
|
|
if build.head?
|
2012-05-17 23:10:37 +00:00
|
|
|
# ensure that the consistent set of autotools built by homebrew is used to
|
|
|
|
# build MPICH2, otherwise very bizarre build errors can occur
|
|
|
|
ENV['MPICH2_AUTOTOOLS_DIR'] = (HOMEBREW_PREFIX+'bin')
|
|
|
|
system "./autogen.sh"
|
|
|
|
end
|
|
|
|
|
2012-05-17 18:29:38 +00:00
|
|
|
args = [
|
2012-10-19 08:10:00 +00:00
|
|
|
"--disable-dependency-tracking",
|
|
|
|
"--disable-silent-rules",
|
2012-05-17 18:29:38 +00:00
|
|
|
"--prefix=#{prefix}",
|
2012-10-19 08:10:00 +00:00
|
|
|
"--mandir=#{man}"
|
2012-05-17 18:29:38 +00:00
|
|
|
]
|
2012-10-21 20:15:36 +00:00
|
|
|
if build.include? 'disable-fortran'
|
2012-05-17 18:29:38 +00:00
|
|
|
args << "--disable-f77" << "--disable-fc"
|
|
|
|
else
|
|
|
|
ENV.fortran
|
|
|
|
end
|
|
|
|
|
|
|
|
system "./configure", *args
|
2012-02-16 16:26:16 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
2012-05-17 23:09:52 +00:00
|
|
|
|
|
|
|
# MPE installs several helper scripts like "mpeuninstall" to the sbin
|
|
|
|
# directory, which we don't need when installing via homebrew
|
|
|
|
sbin.rmtree
|
2012-02-16 16:26:16 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
2012-05-17 23:09:52 +00:00
|
|
|
Please be aware that installing this formula along with the `openmpi`
|
2012-02-16 16:26:16 +00:00
|
|
|
formula will cause neither MPI installation to work correctly as
|
|
|
|
both packages install their own versions of mpicc/mpicxx and mpirun.
|
|
|
|
EOS
|
|
|
|
end
|
2012-05-17 23:05:49 +00:00
|
|
|
|
|
|
|
def test
|
|
|
|
# a better test would be to build and run a small MPI program
|
|
|
|
system "#{bin}/mpicc", "-show"
|
|
|
|
end
|
2012-02-16 16:26:16 +00:00
|
|
|
end
|