Portfile

# $Id: Portfile 23025 2007-03-22 12:36:10Z mww@macports.org $

PortSystem 1.0

name openmpi
version 1.2
categories science parallel net
platforms darwin
maintainers mww@macports.org
description A High Performance Message Passing Library
long_description Open MPI is a project combining technologies and resources \
from several other projects (FT-MPI, LA-MPI, LAM/MPI, and \
PACX-MPI) in order to build the best MPI library available. A \
completely new MPI-2 compliant implementation, Open MPI offers \
advantages for system and software vendors, application developers \
and computer science researchers.

homepage http://www.open-mpi.org/
set subdir ompi/v1.2/downloads/
master_sites http://www.open-mpi.org/software/${subdir} \
http://www.open-mpi.de/software/${subdir} \
http://icl.cs.utk.edu/open-mpi/${subdir} \
freebsd
checksums md5 37e8d4edad54a8d8c3127fbef87ebda1 \
sha1 e42db0b71de3761e7a3c73a7b078e07f6106c71f
use_bzip2 yes

pre-extract { file mkdir ${workpath}/build }

configure.dir ${workpath}/build
configure.cmd ${worksrcpath}/configure
configure.args --disable-f77 --disable-f90 \
--enable-static \
--sysconfdir=${prefix}/etc/${name} \
--includedir=${prefix}/include/${name} \
--bindir=${prefix}/lib/${name}/bin \
--mandir=${prefix}/share/man

build.dir ${configure.dir}

destroot.dir ${build.dir}
post-destroot {
foreach bin { mpicc mpirun } {
system "cd ${destroot}${prefix}/bin \
&& ln -sf ${prefix}/lib/${name}/bin/${bin} open${bin}"
}
}

platform darwin 8 {
configure.env CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0
}

variant fortran {
configure.args-delete --disable-f77 --disable-f90
configure.args-append --enable-f77 --enable-f90
configure.env-append F77=gfortran-dp-4.2 FC=gfortran-dp-4.2
# We need gfortran. Gcc41 doesn't seem to compile on Intel Mac, so we'll take
# gcc42. Too bad that the actual gfortran binary in gcc42 is called
# gfortran-dp-4.2, otherwise we could just say bin:gfortran:gcc42.
depends_build port:gcc42
}