homebrew-core/Formula/mpich2.rb

64 lines
1.8 KiB
Ruby
Raw Normal View History

require 'formula'
# This should really be named Mpich now, but homebrew cannot currently handle
# formula renames, see homebrew issue #14374.
class Mpich2 < Formula
homepage 'http://www.mpich.org/'
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'
2013-11-13 17:01:29 +00:00
depends_on 'autoconf' => :build
depends_on 'automake' => :build
depends_on 'libtool' => :build
end
devel do
url 'http://www.mpich.org/static/downloads/3.1/mpich-3.1.tar.gz'
sha1 'ac3e79482b7645f9512f687404e9be29855258e9'
end
2013-09-22 01:47:28 +00:00
option 'disable-fortran', "Do not attempt to build Fortran bindings"
option 'disable-shared', "Do not build shared libraries"
2013-09-22 01:47:28 +00:00
depends_on :fortran unless build.include? 'disable-fortran'
2013-03-26 05:31:24 +00:00
conflicts_with 'open-mpi', :because => 'both install mpi__ compiler wrappers'
def install
2012-10-21 20:15:36 +00:00
if build.head?
# ensure that the consistent set of autotools built by homebrew is used to
# build MPICH, otherwise very bizarre build errors can occur
ENV['MPICH_AUTOTOOLS_DIR'] = HOMEBREW_PREFIX+'bin'
system "./autogen.sh"
end
args = [
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--mandir=#{man}"
]
2012-10-21 20:15:36 +00:00
if build.include? 'disable-fortran'
args << "--disable-f77" << "--disable-fc"
end
# MPICH configure up to version 3.0.4 defaults to "--disable-shared"
if build.include? 'disable-shared'
args << "--disable-shared"
end
system "./configure", *args
system "make"
system "make install"
end
test do
# a better test would be to build and run a small MPI program
system "#{bin}/mpicc", "-show"
end
end