2012-02-16 16:26:16 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2013-01-11 22:10:36 +00:00
|
|
|
# This should really be named Mpich now, but homebrew cannot currently handle
|
|
|
|
# formula renames, see homebrew issue #14374.
|
2012-02-16 16:26:16 +00:00
|
|
|
class Mpich2 < Formula
|
2012-11-21 03:21:11 +00:00
|
|
|
homepage 'http://www.mpich.org/'
|
2014-02-20 17:52:54 +00:00
|
|
|
url 'http://www.mpich.org/static/downloads/3.1/mpich-3.1.tar.gz'
|
|
|
|
mirror 'http://fossies.org/linux/misc/mpich-3.1.tar.gz'
|
|
|
|
sha1 'ac3e79482b7645f9512f687404e9be29855258e9'
|
2012-10-21 20:15:36 +00:00
|
|
|
|
2013-09-22 01:47:28 +00:00
|
|
|
head do
|
|
|
|
url 'git://git.mpich.org/mpich.git'
|
2012-05-17 23:10:37 +00:00
|
|
|
|
2013-11-13 17:01:29 +00:00
|
|
|
depends_on 'autoconf' => :build
|
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
|
|
|
|
2013-12-02 16:09:38 +00:00
|
|
|
devel do
|
2014-02-20 17:52:54 +00:00
|
|
|
url 'http://www.mpich.org/static/downloads/3.1/mpich-3.1.tar.gz'
|
|
|
|
sha1 'ac3e79482b7645f9512f687404e9be29855258e9'
|
2013-12-02 16:09:38 +00:00
|
|
|
end
|
2013-09-22 01:47:28 +00:00
|
|
|
|
|
|
|
option 'disable-fortran', "Do not attempt to build Fortran bindings"
|
2014-02-20 17:52:54 +00:00
|
|
|
option 'disable-shared', "Do not build shared libraries"
|
2013-09-22 01:47:28 +00:00
|
|
|
|
2013-06-24 03:29:13 +00:00
|
|
|
depends_on :fortran unless build.include? 'disable-fortran'
|
2012-11-29 00:05:59 +00:00
|
|
|
|
2013-03-26 05:31:24 +00:00
|
|
|
conflicts_with 'open-mpi', :because => 'both install mpi__ compiler wrappers'
|
|
|
|
|
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
|
2013-01-11 22:10:36 +00:00
|
|
|
# build MPICH, otherwise very bizarre build errors can occur
|
2014-05-17 05:17:05 +00:00
|
|
|
ENV['MPICH_AUTOTOOLS_DIR'] = HOMEBREW_PREFIX+'bin'
|
2012-05-17 23:10:37 +00:00
|
|
|
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"
|
|
|
|
end
|
|
|
|
|
2013-12-02 16:09:38 +00:00
|
|
|
# MPICH configure up to version 3.0.4 defaults to "--disable-shared"
|
2014-02-20 17:52:54 +00:00
|
|
|
if build.include? 'disable-shared'
|
2013-12-02 16:09:38 +00:00
|
|
|
args << "--disable-shared"
|
2012-11-29 00:05:59 +00:00
|
|
|
end
|
|
|
|
|
2012-05-17 18:29:38 +00:00
|
|
|
system "./configure", *args
|
2012-02-16 16:26:16 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
|
2014-02-23 21:31:41 +00:00
|
|
|
test do
|
2012-05-17 23:05:49 +00:00
|
|
|
# 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
|