# -*- 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 73977 2010-11-30 22:02:00Z adfernandes@macports.org $

PortSystem      1.0
PortGroup       python26 1.0

name            py26-mpi4py
version         1.2.2
revision        1
categories      python
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     adfernandes openmaintainer

homepage        http://code.google.com/p/mpi4py/
master_sites    googlecode:mpi4py
distname        mpi4py-${version}
checksums       md5     91c1b962529adfd90b9f9f98db5624b7 \
                sha1    e08d09257794a85d010a22ad9bda9d1c89a6258f \
                rmd160  434d411aa4e954706f2ca8bdde115dc654b58f21
platforms       darwin

depends_lib-append port:mpich2

# mpich2 and openmpi are not universal
universal_variant no

if { ${os.major} < 9 } {
    default_variants +openmpi 
}

if {  ${os.major} < 9 &&  ![variant_isset openmpi] } {
    error "Mac OS 10.4 and earlier require the openmpi variant"
}

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

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