# -*- 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
PortGroup compiler_blacklist_versions 1.0
maintainers {gmail.com:howarth.at.macports @jwhowarth} openmaintainer
description Adaptive Poisson-Boltzmann Solver
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.
github.setup Electrostatics apbs-pdb2pqr d4e78c62e6a07f92c26924318d83a159fa6af063
homepage http://www.poissonboltzmann.org
worksrcdir ${worksrcdir}/apbs
checksums rmd160 5c4d583e12deb3fbc2b5a8031882311cbfd22c7e \
sha256 f98ce6a51d8f813e1b4fa626c054ddbf7a985403ca30f890733cb1abf2bd6e05
# dependencies are not managed correctly within this code, so errors such as from -lapbs_geoflow might occur
# how to solve: first 'make apbs_geoflow', then 'make all'
configure.optflags -O3 -ffast-math
configure.args-append -DENABLE_OPENMP:BOOL=OFF \
-DCMAKE_C_COMPILER_ARG1:STRING="-I${worksrcpath}/include ${configure.cflags}" \
-DCMAKE_CXX_COMPILER_ARG1:STRING="-I${worksrcpath}/include ${configure.cxxflags} -stdlib=libc++"
# otherwise obsolete subport installation will fail on patch phase and not get to pre-configure error about replacement
if {${subport} eq ${name}} {
patchfiles patch-CMakeLists.txt.diff patch-Eigen-include-path.diff patch-contrib-tabipb-CMakeLists.txt.diff patch-pbsolvercz.cpp.diff
if {[mpi_variant_isset]} {
patchfiles-append patch-tests-apbs_tester.py.diff
ln ${worksrcpath}/tools/manip/inputgen.py ${worksrcpath}/tests/
ln ${worksrcpath}/tools/manip/psize.py ${worksrcpath}/tests/
if {[mpi_variant_isset]} {
if {![catch {sysctl hw.ncpu} result]} {
reinplace "s|mpiexec|\"${mpi.exec}\", \"-n\", \"${njobs}\"|" ${worksrcpath}/tests/apbs_tester.py
ui_msg "Running testsuite with $njobs jobs in parallel"
system -W ${worksrcpath}/tests "python apbs_tester.py"
system -W ${worksrcpath}/tests "cat test.log"
system -W ${worksrcpath}/tests "if grep FAILED test.log; then echo \"FAIL\"; exit 1; fi"
# Some cmake tests will fail with "error: unrecognized option '-arch'" from gcc 4.6 and earlier. Same with dragonegg based on it.
# llvm-gcc-4.2 will fail to build with: error: unrecognized command line option "-std=c++0x"
# It comes with clang for OSX 10.6 so we need to blacklist clang to prevent it being used.
compiler.blacklist macports-gcc-4.4 macports-gcc-4.5 macports-gcc-4.6 \
macports-dragonegg-3.4 gcc-4.2 llvm-gcc-4.2 apple-gcc-4.2 macports-llvm-gcc-4.2 {clang < 425} \
macports-clang-3.4 macports-clang-3.5
# g++ will just fail to link apbs_geoflow. probably about -lstdc++ stuff. So, just use Fortran.
configure.args-append -DENABLE_MPI:BOOL=OFF
set tools ${destroot}${prefix}/share/${subport}/tools
move ${tools}/manip/psize.py ${destroot}${prefix}/bin/apbs-psize.py
file attributes ${destroot}${prefix}/bin/apbs-psize.py \