# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 61439 2009-12-11 14:30:17Z macsforever2000@macports.org $
PortSystem          1.0
name                apbs-mpi
version             1.2.0
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          science
maintainers         bromo.med.uc.edu:howarth
description         APBS mpi version
long_description    APBS is a software package for the numerical solution \
                    of the Poisson-Boltzmann equation, a popular continuum \
                    model for describing electrostatic interactions between \
                    molecular solutes over a wide range of length scales.
homepage            http://apbs.sourceforge.net/
platforms           darwin
master_sites        sourceforge
master_sites.mirror_subdir apbs
distname            apbs-${branch}-source
checksums           md5     ba32bb323b25307204436eaac1ff877b \
                    sha1    43e766a8c6166288c25229e0615a72dca5e8a3b5 \
                    rmd160  62cb82da9ca5276c3d7127a4d1f9737747dac315
depends_lib         port:gcc44 \
                    port:readline \
                    port:openmpi
depends_run         port:apbs
use_parallel_build  no
build.target-delete all
configure.env       F77=openmpif77
configure.cc        openmpicc
configure.cxx       openmpicxx
configure.cflags    -O3
configure.args      --with-blas="-L/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A -lblas -Wl,-framework -Wl,vecLib -Wl,-undefined -Wl,dynamic_lookup" FFLAGS="-O3" -with-openmpi=${prefix}
post-patch {
    reinplace  "s|include/mpi.h|include/openmpi/mpi.h|g" ${worksrcpath}/configure
}
destroot {
      file mkdir ${destroot}${prefix}/bin
      copy ${worksrcpath}/bin/apbs ${destroot}${prefix}/bin/apbs-mpi
      file mkdir ${destroot}${prefix}/share/apbs-mpi
      system "cd ${worksrcpath}; cp -r examples tools doc ${destroot}${prefix}/share/apbs-mpi"
}
