mpich: phase out :fortran

This commit is contained in:
FX Coudert 2018-01-12 16:11:25 +01:00
parent 0637c2d894
commit 86cdbbc853

View file

@ -4,6 +4,7 @@ class Mpich < Formula
url "https://www.mpich.org/static/downloads/3.2.1/mpich-3.2.1.tar.gz"
mirror "https://fossies.org/linux/misc/mpich-3.2.1.tar.gz"
sha256 "5db53bf2edfaa2238eb6a0a5bc3d2c2ccbfbb1badd79b664a1a919d2ce2330f1"
revision 1
bottle do
sha256 "58cead221276267a7a223e9b6f7804f2b0a6870089e6dafe6182df189700dfcb" => :high_sierra
@ -23,11 +24,10 @@ class Mpich < Formula
depends_on "automake" => :build
depends_on "libtool" => :build
end
deprecated_option "disable-fortran" => "without-fortran"
depends_on :fortran => :recommended
depends_on "gcc" # for gfortran
conflicts_with "open-mpi", :because => "both install mpi__ compiler wrappers"
conflicts_with "open-mpi", :because => "both install MPI compiler wrappers"
def install
if build.head?
@ -37,16 +37,11 @@ class Mpich < Formula
system "./autogen.sh"
end
args = [
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--mandir=#{man}",
]
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--mandir=#{man}"
args << "--disable-fortran" if build.without? "fortran"
system "./configure", *args
system "make"
system "make", "check"
system "make", "install"
@ -73,21 +68,20 @@ class Mpich < Formula
system "#{bin}/mpicc", "hello.c", "-o", "hello"
system "./hello"
system "#{bin}/mpirun", "-np", "4", "./hello"
if build.with? "fortran"
(testpath/"hellof.f90").write <<~EOS
program hello
include 'mpif.h'
integer rank, size, ierror, tag, status(MPI_STATUS_SIZE)
call MPI_INIT(ierror)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierror)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierror)
print*, 'node', rank, ': Hello Fortran world'
call MPI_FINALIZE(ierror)
end
EOS
system "#{bin}/mpif90", "hellof.f90", "-o", "hellof"
system "./hellof"
system "#{bin}/mpirun", "-np", "4", "./hellof"
end
(testpath/"hellof.f90").write <<~EOS
program hello
include 'mpif.h'
integer rank, size, ierror, tag, status(MPI_STATUS_SIZE)
call MPI_INIT(ierror)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierror)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierror)
print*, 'node', rank, ': Hello Fortran world'
call MPI_FINALIZE(ierror)
end
EOS
system "#{bin}/mpif90", "hellof.f90", "-o", "hellof"
system "./hellof"
system "#{bin}/mpirun", "-np", "4", "./hellof"
end
end