Ticket #49058: Portfile-apbs.diff.3

File Portfile-apbs.diff.3, 3.9 KB (added by dstrubbe (David Strubbe), 9 years ago)
Line 
1Index: Portfile
2===================================================================
3--- Portfile    (revision 142406)
4+++ Portfile    (working copy)
5@@ -35,13 +35,10 @@
6 depends_lib             port:maloc \
7                         port:readline
8 
9-# dependencies are not managed correctly within this code, so errors such as from Eigen or -lapbs_geoflow might occur
10+# dependencies are not managed correctly within this code, so errors such as from -lapbs_geoflow might occur
11+# how to solve: first 'make apbs_geoflow', then 'make all'
12 use_parallel_build no
13 
14-# BEM needs 'gfortran', hard-coded, and configure fails without it if BEM is enabled, with a syntax error
15-#CMake Error at CMakeLists.txt:217 (get_filename_component):
16-#  get_filename_component called with incorrect number of arguments
17-# To enable, need not only to fix that check, but also fix configure in tapipb directory to use chosen FC compiler.
18 configure.args-append   -DENABLE_OPENMP:BOOL=OFF \
19                         -DENABLE_BEM=OFF \
20                         -DCMAKE_C_COMPILER_ARG1:STRING="-I${worksrcpath}/include" \
21@@ -60,6 +57,12 @@
22     mergedx mergedx2 mgmesh multivalue similarity smooth tensor2dx
23     uhbd_asc2bin value}
24 
25+# Some cmake tests will fail with "error: unrecognized option '-arch'" from gcc 4.6 and earlier. Same with dragonegg based on it.
26+# llvm-gcc-4.2 will fail to build with: error: unrecognized command line option "-std=c++0x"
27+compiler.blacklist      macports-gcc-4.4 macports-gcc-4.5 macports-gcc-4.6 \
28+                        macports-dragonegg-3.3 macports-dragonegg-3.4 macports-llvm-gcc-4.2
29+compilers.choose        cc cxx fc
30+
31 switch ${subport} {
32     apbs {
33         compilers.setup
34@@ -117,6 +120,27 @@
35     }
36 }
37 
38+variant bem description {Build with support for Boundary Element Method} {
39+    configure.args-delete  -DENABLE_BEM=OFF
40+    configure.args-append  -DENABLE_BEM=ON
41+
42+    if {![fortran_variant_isset]} {
43+        ui_error "+bem requires a Fortran variant, e.g. +gfortran, +gccX, or +g95."
44+        return -code error "+bem requires a Fortran variant."
45+    }
46+
47+    # BEM looks for 'gfortran', hard-coded, and configure fails without it if BEM is enabled, with a syntax error
48+    #CMake Error at CMakeLists.txt:217 (get_filename_component):
49+    #  get_filename_component called with incorrect number of arguments
50+    post-patch {
51+        reinplace "s|get_filename_component(LIBGFORTRANPATH|#|g" ${worksrcpath}/CMakeLists.txt
52+        reinplace "s|find_path(LIBGFORTRAN_PATH|#|g" ${worksrcpath}/CMakeLists.txt
53+        reinplace "s|-L\${LIBGFORTRAN_PATH} -lgfortran|${compilers.libfortran}|" ${worksrcpath}/CMakeLists.txt
54+        # provide this information to subsidiary cmake command run in tabipb directory during build phase
55+        reinplace "s|CMAKE_ARGS|CMAKE_ARGS -DCMAKE_Fortran_COMPILER:STRING=${configure.fc}|" ${worksrcpath}/CMakeLists.txt
56+    }
57+}
58+
59 # check for real releases, not github commits
60 livecheck.type   regex
61 livecheck.url    http://www.poissonboltzmann.org/news/
62Index: files/patch-Eigen-include-path.diff
63===================================================================
64--- files/patch-Eigen-include-path.diff (nonexistent)
65+++ files/patch-Eigen-include-path.diff (working copy)
66@@ -0,0 +1,22 @@
67+--- src/geoflow/Mat.h.orig     2015-11-10 18:03:45.000000000 -0500
68++++ src/geoflow/Mat.h  2015-11-10 18:04:15.000000000 -0500
69+@@ -57,7 +57,7 @@
70+ #include <cmath>
71+ #include <vector>
72+
73+-#include <Eigen/Core>
74++#include "Eigen/Core"
75+
76+ // The following is from modules.h, which includes this file, Mat.h.  We need
77+ // the declaration here because we use it below in the deriv method.  If we
78+--- src/geoflow/pbsolvercz.cpp.orig    2015-11-10 18:03:52.000000000 -0500
79++++ src/geoflow/pbsolvercz.cpp 2015-11-10 18:04:31.000000000 -0500
80+@@ -56,7 +56,7 @@
81+ #include <valarray>
82+ #include <vector>
83+
84+-#include <Eigen/Sparse>
85++#include "Eigen/Sparse"
86+
87+ #include "Mat.h"
88+ #include "modules.h"