Ticket #49058: Portfile-apbs.diff.5

File Portfile-apbs.diff.5, 4.6 KB (added by dstrubbe (David Strubbe), 9 years ago)
Line 
1Index: Portfile
2===================================================================
3--- Portfile    (revision 142427)
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,13 @@
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 llvm-gcc-4.2
29+# g++ will just fail to link apbs_geoflow. probably about -lstdc++ stuff. So, just use Fortran.
30+compilers.choose        fc
31+
32 switch ${subport} {
33     apbs {
34         compilers.setup
35@@ -99,6 +103,8 @@
36                     -DCMAKE_CXX_COMPILER=${configure.cxx} \
37                     -DMPI_C_COMPILER=${mpi.cc} \
38                     -DMPI_CXX_COMPILER=${mpi.cxx}
39+            # sometimes there will be a failure to link without this
40+            reinplace -W ${worksrcpath} "s/-lmaloc/-lmaloc -lreadline/" CMakeLists.txt
41         }
42 
43         destroot {
44@@ -117,6 +123,28 @@
45     }
46 }
47 
48+variant bem description {Build with support for Boundary Element Method} {
49+    configure.args-delete  -DENABLE_BEM=OFF
50+    configure.args-append  -DENABLE_BEM=ON
51+
52+    if {![fortran_variant_isset]} {
53+        ui_error "+bem requires a Fortran variant, e.g. +gfortran, +gccX, or +g95."
54+        return -code error "+bem requires a Fortran variant."
55+    }
56+
57+    # BEM looks for 'gfortran', hard-coded, and configure fails without it if BEM is enabled, with a syntax error
58+    #CMake Error at CMakeLists.txt:217 (get_filename_component):
59+    #  get_filename_component called with incorrect number of arguments
60+    post-patch {
61+        reinplace "s|get_filename_component(LIBGFORTRANPATH|#get_filename_component(LIBGFORTRANPATH|g" ${worksrcpath}/CMakeLists.txt
62+        reinplace "s|find_path(LIBGFORTRAN_PATH|#find_path(LIBGFORTRAN_PATH|g" ${worksrcpath}/CMakeLists.txt
63+        # -lstdc++ does not seem necessary and may cause trouble; specifying full paths avoid possible use of -ltabip from an earlier installation in ${prefix}
64+        reinplace "s|-L\${LIBGFORTRAN_PATH} -lgfortran -ltabipb -lstdc\+\+|${compilers.libfortran} ${worksrcpath}/lib/libtabipb.a|" ${worksrcpath}/CMakeLists.txt
65+        # provide this information to subsidiary cmake command run in tabipb directory during build phase
66+        reinplace "s|CMAKE_ARGS|CMAKE_ARGS -DCMAKE_Fortran_COMPILER:STRING=${configure.fc}|" ${worksrcpath}/CMakeLists.txt
67+    }
68+}
69+
70 # check for real releases, not github commits
71 livecheck.type   regex
72 livecheck.url    http://www.poissonboltzmann.org/news/
73Index: files/patch-Eigen-include-path.diff
74===================================================================
75--- files/patch-Eigen-include-path.diff (nonexistent)
76+++ files/patch-Eigen-include-path.diff (working copy)
77@@ -0,0 +1,22 @@
78+--- src/geoflow/Mat.h.orig     2015-11-10 18:03:45.000000000 -0500
79++++ src/geoflow/Mat.h  2015-11-10 18:04:15.000000000 -0500
80+@@ -57,7 +57,7 @@
81+ #include <cmath>
82+ #include <vector>
83+
84+-#include <Eigen/Core>
85++#include "Eigen/Core"
86+
87+ // The following is from modules.h, which includes this file, Mat.h.  We need
88+ // the declaration here because we use it below in the deriv method.  If we
89+--- src/geoflow/pbsolvercz.cpp.orig    2015-11-10 18:03:52.000000000 -0500
90++++ src/geoflow/pbsolvercz.cpp 2015-11-10 18:04:31.000000000 -0500
91+@@ -56,7 +56,7 @@
92+ #include <valarray>
93+ #include <vector>
94+
95+-#include <Eigen/Sparse>
96++#include "Eigen/Sparse"
97+
98+ #include "Mat.h"
99+ #include "modules.h"