# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 105836 2013-05-07 18:24:22Z adfernandes@macports.org $

PortSystem      1.0
PortGroup       python 1.0

name            py-mpi4py
version         1.3
revision        3
license         BSD
description     MPI for Python - Python bindings for MPI
long_description \
    MPI for Python (mpi4py) provides bindings of the Message Passing Interface \
    (MPI) standard for the Python programming language, allowing any Python \
    program to exploit multiple processors. This package is constructed on top of \
    the MPI-1/MPI-2 specification and provides an object oriented interface which \
    closely follows MPI-2 C++ bindings. It supports point-to-point (sends, \
    receives) and collective (broadcasts, scatters, gathers) communications of \
    any picklable Python object as well as optimized communications of Python \
    object exposing the single-segment buffer interface (NumPy arrays, builtin \
    bytes/string/array objects).


maintainers     nomaintainer

homepage        http://code.google.com/p/mpi4py/
master_sites    googlecode:mpi4py
distname        mpi4py-${version}
checksums       md5     978472a1a71f3142c866c9463dec7103 \
                sha1    282c1b9e35b242c9bd86126ebc5af6c70d8c2833 \
                rmd160  c5835379dd99521a829aeb46363b458544bfa6b2
platforms       darwin

python.versions 25 26 27 31 32 33

if {$subport != $name} {
    depends_lib-append port:openmpi
    build.args-append  "--mpicc=${prefix}/bin/openmpicc"

    # openmpi and mpich are not universal
    universal_variant no

    if { ${os.platform} != "darwin" || ${os.major} > 8 } {

        variant mpich description {builds with the mpich port} {
            build.args-delete   "--mpicc=${prefix}/bin/openmpicc"
            depends_lib-delete  port:openmpi
            depends_lib-append  path:bin/mpicc:mpich
        }

        variant mpich2 requires mpich description {Legacy compatibility variant} {}
    }

    variant interpreter description {builds an mpi enabled python interpreter} {
        patchfiles-append   patch-conf-mpidistutils.py.diff
    }
}
