[149254] trunk/dports/science/apbs/Portfile

dstrubbe at macports.org dstrubbe at macports.org
Tue Jun 7 12:12:06 PDT 2016


Revision: 149254
          https://trac.macports.org/changeset/149254
Author:   dstrubbe at macports.org
Date:     2016-06-07 12:12:06 -0700 (Tue, 07 Jun 2016)
Log Message:
-----------
apbs, apbs-mpi: Fixes to enable BEM as variant. Blacklisting compilers, only choose the Fortran one. Fix MPI maloc linking error. Some comments. Fixes #48544 and #49058 (openmaintainer/maintainer timeout #49058).

Modified Paths:
--------------
    trunk/dports/science/apbs/Portfile

Modified: trunk/dports/science/apbs/Portfile
===================================================================
--- trunk/dports/science/apbs/Portfile	2016-06-07 19:03:28 UTC (rev 149253)
+++ trunk/dports/science/apbs/Portfile	2016-06-07 19:12:06 UTC (rev 149254)
@@ -6,8 +6,6 @@
 PortGroup               mpi 1.0
 PortGroup               github 1.0
 
-compilers.choose        cc cxx
-
 name                    apbs
 subport                 apbs-mpi {}
 # set revision separately for each subport, below.
@@ -35,13 +33,12 @@
 depends_lib             port:maloc \
                         port:readline
 
-# dependencies are not managed correctly within this code, so errors such as from Eigen or -lapbs_geoflow might occur
+# 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'
 use_parallel_build no
 
-# BEM needs 'gfortran', hard-coded, and configure fails without it if BEM is enabled, with a syntax error
-#CMake Error at CMakeLists.txt:217 (get_filename_component):
-#  get_filename_component called with incorrect number of arguments
-# To enable, need not only to fix that check, but also fix configure in tapipb directory to use chosen FC compiler.
+# do +debug and +universal work?
+# do we really want -g?
 configure.args-append   -DENABLE_OPENMP:BOOL=OFF \
                         -DENABLE_BEM=OFF \
                         -DCMAKE_C_COMPILER_ARG1:STRING="-I${worksrcpath}/include -O3 -ffast-math -g" \
@@ -60,6 +57,13 @@
     mergedx mergedx2 mgmesh multivalue similarity smooth tensor2dx
     uhbd_asc2bin value}
 
+# 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"
+compiler.blacklist      macports-gcc-4.4 macports-gcc-4.5 macports-gcc-4.6 \
+                        macports-dragonegg-3.3 macports-dragonegg-3.4 llvm-gcc-4.2
+# g++ will just fail to link apbs_geoflow. probably about -lstdc++ stuff. So, just use Fortran.
+compilers.choose        fc
+
 switch ${subport} {
     apbs {
         compilers.setup
@@ -99,6 +103,8 @@
                     -DCMAKE_CXX_COMPILER=${configure.cxx} \
                     -DMPI_C_COMPILER=${mpi.cc} \
                     -DMPI_CXX_COMPILER=${mpi.cxx}
+            # sometimes there will be a failure to link without this
+            reinplace -W ${worksrcpath} "s/-lmaloc/-lmaloc -lreadline/" CMakeLists.txt
         }
 
         destroot {
@@ -117,6 +123,29 @@
     }
 }
 
+variant bem description {Build with support for Boundary Element Method} {
+    configure.args-delete  -DENABLE_BEM=OFF
+    configure.args-append  -DENABLE_BEM=ON
+
+    if {![fortran_variant_isset]} {
+        ui_error "+bem requires a Fortran variant, e.g. +gfortran, +gccX, or +g95."
+        return -code error "+bem requires a Fortran variant."
+    }
+
+    # BEM looks for 'gfortran', hard-coded, and configure fails without it if BEM is enabled, with a syntax error
+    #CMake Error at CMakeLists.txt:217 (get_filename_component):
+    #  get_filename_component called with incorrect number of arguments
+    post-patch {
+        reinplace "s|get_filename_component(LIBGFORTRANPATH|#get_filename_component(LIBGFORTRANPATH|g" ${worksrcpath}/CMakeLists.txt 
+        reinplace "s|find_path(LIBGFORTRAN_PATH|#find_path(LIBGFORTRAN_PATH|g" ${worksrcpath}/CMakeLists.txt 
+        # -lstdc++ does not seem necessary and may cause trouble; specifying full paths avoid possible use of -ltabip from an earlier installation in ${prefix}
+        reinplace "s|-L\${LIBGFORTRAN_PATH} -lgfortran -ltabipb -lstdc\+\+|${compilers.libfortran} ${worksrcpath}/lib/libtabipb.a|" ${worksrcpath}/CMakeLists.txt
+        # provide this information to subsidiary cmake command run in tabipb directory during build phase
+        reinplace "s|CMAKE_ARGS|CMAKE_ARGS -DCMAKE_Fortran_COMPILER:STRING=${configure.fc}|" ${worksrcpath}/CMakeLists.txt
+        system -W ${worksrcpath} "echo 'include_directories(\${APBS_ROOT}/include)' >> CMakeLists.txt"
+    }
+}
+
 # check for real releases, not github commits
 livecheck.type   regex
 livecheck.url    http://www.poissonboltzmann.org/news/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160607/ee941625/attachment.html>


More information about the macports-changes mailing list