# -*- 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 116402 2014-01-23 20:16:24Z sean@macports.org $

PortSystem          1.0
PortGroup           python 1.0
PortGroup           bitbucket 1.0
PortGroup           mpi 1.0

mpi.setup           require

bitbucket.setup     mpi4py mpi4py 1.3.1
name                py-mpi4py
license             BSD
platforms           darwin
universal_variant   no
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         sean openmaintainer

checksums           rmd160  fb4592632272dc707126e333b2ed75575921dd74 \
                    sha256  d9776a591644c2aaae33440d7ee45b29270e51887a1242d6a707f2337a6fe8f5

python.versions     25 26 27 31 32 33

if {![mpi_variant_isset]} {
    default_variants +mpich
}

if {${name} ne ${subport}} {
    depends_build-append \
                    port:py${python.version}-setuptools \
                    port:py${python.version}-cython


    pre-build {
        build.args-append  "--mpicc=${mpi.cc}"
    }

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