Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-mathematics/netgen/files/, sci-mathematics/netgen/
Date: Mon, 22 Feb 2016 08:38:24
Message-Id: 1456130191.903b613b84b3e2622dd16d94dbee41d368ba8fe3.jlec@gentoo
1 commit: 903b613b84b3e2622dd16d94dbee41d368ba8fe3
2 Author: Grégory Salvan <apieum <AT> gmail <DOT> com>
3 AuthorDate: Sun Feb 21 00:52:54 2016 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 22 08:36:31 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=903b613b
7
8 Added fedora fixes patch
9
10 .../netgen/files/netgen-5.x-fedora-fixes.patch | 223 +++++++++++++++++++++
11 sci-mathematics/netgen/netgen-5.3.1.ebuild | 2 +
12 2 files changed, 225 insertions(+)
13
14 diff --git a/sci-mathematics/netgen/files/netgen-5.x-fedora-fixes.patch b/sci-mathematics/netgen/files/netgen-5.x-fedora-fixes.patch
15 new file mode 100644
16 index 0000000..5cb399e
17 --- /dev/null
18 +++ b/sci-mathematics/netgen/files/netgen-5.x-fedora-fixes.patch
19 @@ -0,0 +1,223 @@
20 +diff -uwrN netgen-5.3.1/libsrc/meshing/meshtype.cpp netgen/libsrc/meshing/meshtype.cpp
21 +--- netgen-5.3.1/libsrc/meshing/meshtype.cpp 2016-02-20 21:55:59.226450843 +0100
22 ++++ netgen/libsrc/meshing/meshtype.cpp 2016-02-20 23:54:12.293646166 +0100
23 +@@ -1,4 +1,5 @@
24 + #include <mystdlib.h>
25 ++#include <float.h> // to get DBL_MIN defined
26 +
27 + #include "meshing.hpp"
28 +
29 +@@ -666,7 +667,8 @@
30 +
31 + double det = trans.Det();
32 +
33 +- if (det <= 0)
34 ++ // if (det <= 0)
35 ++ if (det <= DBL_MIN) // avoid FPE
36 + err += 1e12;
37 + else
38 + err += frob * frob / det;
39 +@@ -722,7 +724,8 @@
40 +
41 + double det = trans(0,0)*trans(1,1)-trans(1,0)*trans(0,1);
42 +
43 +- if (det <= 0)
44 ++ // if (det <= 0)
45 ++ if (det <= DBL_MIN) // avoid FPE
46 + {
47 + dd = 0;
48 + return 1e12;
49 +@@ -806,7 +809,8 @@
50 + = dtrans(0,0) * trans(1,1) - trans(0,1) * dtrans(1,0)
51 + + trans(0,0) * dtrans(1,1) - dtrans(0,1) * trans(1,0);
52 +
53 +- if (det <= 0)
54 ++ // if (det <= 0)
55 ++ if (det <= DBL_MIN) // avoid FPE
56 + err += 1e12;
57 + else
58 + {
59 +@@ -856,7 +860,8 @@
60 + frob /= 2;
61 +
62 + double det = trans.Det();
63 +- if (det <= 0)
64 ++ //if (det <= 0)
65 ++ if (det <= DBL_MIN) // avoid FPE
66 + err += 1e12;
67 + else
68 + err += frob * frob / det;
69 +@@ -1864,7 +1869,8 @@
70 + case PYRAMID:
71 + {
72 + double noz = 1-p(2);
73 +- if (noz == 0.0) noz = 1e-10;
74 ++ //if (noz == 0.0) noz = 1e-10;
75 ++ if (noz <= DBL_MIN) noz = 1e-10; // avoid FPE
76 +
77 + double xi = p(0) / noz;
78 + double eta = p(1) / noz;
79 +@@ -2513,10 +2519,10 @@
80 +
81 + MeshingParameters :: MeshingParameters ()
82 + {
83 +- optimize3d = "cmdmustm";
84 ++ optimize3d = (char*)"cmdmustm"; // optimize3d = "cmdmustm";
85 + //optimize3d = "cmdmstm";
86 + optsteps3d = 3;
87 +- optimize2d = "smsmsmSmSmSm";
88 ++ optimize2d = (char*)"smsmsmSmSmSm"; // optimize2d = "smsmsmSmSmSm";
89 + optsteps2d = 3;
90 + opterrpow = 2;
91 + blockfill = 1;
92 +diff -uwrN netgen-5.3.1/libsrc/meshing/meshtype.hpp netgen/libsrc/meshing/meshtype.hpp
93 +--- netgen-5.3.1/libsrc/meshing/meshtype.hpp 2016-02-20 21:55:59.226450843 +0100
94 ++++ netgen/libsrc/meshing/meshtype.hpp 2016-02-20 23:54:12.295646166 +0100
95 +@@ -15,6 +15,7 @@
96 + Classes for NETGEN
97 + */
98 +
99 ++class Mesh; // added due to compilation errors on some platforms
100 +
101 +
102 + enum ELEMENT_TYPE {
103 +diff -uwrN netgen-5.3.1/libsrc/meshing/smoothing2.cpp netgen/libsrc/meshing/smoothing2.cpp
104 +--- netgen-5.3.1/libsrc/meshing/smoothing2.cpp 2016-02-20 21:55:59.228450843 +0100
105 ++++ netgen/libsrc/meshing/smoothing2.cpp 2016-02-20 23:54:12.298646166 +0100
106 +@@ -361,7 +361,8 @@
107 + vgrad = 0;
108 + double badness = 0;
109 +
110 +- ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
111 ++ //normal already computed: ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
112 ++ n = ld.normal;
113 + pp1 = ld.sp1 + x(0) * ld.t1 + x(1) * ld.t2;
114 +
115 + // meshthis -> ProjectPoint (surfi, pp1);
116 +@@ -577,7 +578,8 @@
117 + vgrad = 0;
118 + badness = 0;
119 +
120 +- ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
121 ++ //normal already computed: ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
122 ++ n = ld.normal;
123 +
124 + pp1 = ld.sp1 + x(0) * ld.t1 + x(1) * ld.t2;
125 +
126 +@@ -649,7 +651,8 @@
127 + vgrad = 0;
128 + badness = 0;
129 +
130 +- ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
131 ++ //normal already computed: ld.meshthis -> GetNormalVector (ld.surfi, ld.sp1, ld.gi1, n);
132 ++ n = ld.normal;
133 +
134 + // pp1 = sp1;
135 + // pp1.Add2 (x.Get(1), t1, x.Get(2), t2);
136 +diff -uwrN netgen-5.3.1/libsrc/occ/occconstruction.cpp netgen/libsrc/occ/occconstruction.cpp
137 +--- netgen-5.3.1/libsrc/occ/occconstruction.cpp 2016-02-20 21:53:44.420447131 +0100
138 ++++ netgen/libsrc/occ/occconstruction.cpp 2016-02-20 23:54:12.299646166 +0100
139 +@@ -28,7 +28,7 @@
140 + #include <BRepAlgoAPI_Common.hxx>
141 + #include <BRepAlgoAPI_Fuse.hxx>
142 + #include <BRepAlgoAPI_Section.hxx>
143 +-#include <BRepOffsetAPI_Sewing.hxx>
144 ++//#include <BRepOffsetAPI_Sewing.hxx>
145 + //#include <BRepAlgo_Sewing.hxx>
146 + #include <BRepOffsetAPI_MakeOffsetShape.hxx>
147 + #include <ShapeFix_Shape.hxx>
148 +diff -uwrN netgen-5.3.1/libsrc/occ/occmeshsurf.cpp netgen/libsrc/occ/occmeshsurf.cpp
149 +--- netgen-5.3.1/libsrc/occ/occmeshsurf.cpp 2016-02-20 21:53:44.421447131 +0100
150 ++++ netgen/libsrc/occ/occmeshsurf.cpp 2016-02-20 23:54:12.310646166 +0100
151 +@@ -6,6 +6,7 @@
152 + #include <meshing.hpp>
153 + #include <GeomLProp_SLProps.hxx>
154 + #include <ShapeAnalysis_Surface.hxx>
155 ++#include <GeomAPI_ProjectPointOnCurve.hxx> // -- moved here from occgeom.hpp
156 +
157 +
158 + namespace netgen
159 +@@ -689,7 +691,7 @@
160 + }
161 +
162 + newp = hnewp;
163 +- }
164 ++ }//; -- to compile with -Wall -pedantic
165 +
166 +
167 + void OCCRefinementSurfaces ::
168 +
169 +
170 +diff -uwrN netgen-5.3.1/libsrc/occ/Partition_Inter3d.cxx netgen/libsrc/occ/Partition_Inter3d.cxx
171 +--- netgen-5.3.1/libsrc/occ/Partition_Inter3d.cxx 2016-02-20 21:53:44.418447131 +0100
172 ++++ netgen/libsrc/occ/Partition_Inter3d.cxx 2016-02-20 23:54:12.311646166 +0100
173 +@@ -243,8 +243,10 @@
174 + Standard_Integer i, nbExt = anExtPS.NbExt();
175 + Extrema_POnSurf aPOnSurf;
176 + for (i = 1; i <= nbExt; ++i )
177 ++ // porting to OCCT6.5.1
178 + // if (anExtPS.Value( i ) <= TolE) // V6.3
179 +- if (anExtPS.SquareDistance( i ) <= TolE) // V6.5
180 ++ // if (anExtPS.SquareDistance( i ) <= TolE) // V6.5
181 ++ if (anExtPS.SquareDistance( i ) <= TolE * TolE)
182 + {
183 + aPOnSurf = anExtPS.Point( i );
184 + break;
185 +diff -uwrN netgen-5.3.1/libsrc/occ/Partition_Spliter.cxx netgen/libsrc/occ/Partition_Spliter.cxx
186 +--- netgen-5.3.1/libsrc/occ/Partition_Spliter.cxx 2016-02-20 21:53:44.420447131 +0100
187 ++++ netgen/libsrc/occ/Partition_Spliter.cxx 2016-02-20 23:54:12.313646166 +0100
188 +@@ -1169,8 +1169,10 @@
189 + for (; j<=nbj && ok; ++j) {
190 + if (Extrema.IsMin(j)) {
191 + hasMin = Standard_True;
192 ++ // porting to OCCT6.5.1
193 + // ok = Extrema.Value(j) <= tol; // V6.3
194 +- ok = Extrema.SquareDistance(j) <= tol; // V6.5
195 ++ // ok = Extrema.SquareDistance(j) <= tol; // V6.5
196 ++ ok = Extrema.SquareDistance(j) <= tol * tol;
197 + }
198 + }
199 + }
200 +diff -uwrN netgen-5.3.1/libsrc/occ/utilities.h netgen/libsrc/occ/utilities.h
201 +--- netgen-5.3.1/libsrc/occ/utilities.h 2016-02-20 21:53:44.421447131 +0100
202 ++++ netgen/libsrc/occ/utilities.h 2016-02-20 23:54:12.314646166 +0100
203 +@@ -33,6 +33,7 @@
204 +
205 + #include <string>
206 + #include <iostream>
207 ++#include <iomanip>
208 + #include <cstdlib>
209 + // #include "SALOME_Log.hxx"
210 +
211 +diff -uwrN netgen-5.3.1/libsrc/stlgeom/stlgeommesh.cpp netgen/libsrc/stlgeom/stlgeommesh.cpp
212 +--- netgen-5.3.1/libsrc/stlgeom/stlgeommesh.cpp 2016-02-20 21:55:59.234450844 +0100
213 ++++ netgen/libsrc/stlgeom/stlgeommesh.cpp 2016-02-20 23:54:12.315646166 +0100
214 +@@ -1435,7 +1435,8 @@
215 + /*
216 + if (!optstring || strlen(optstring) == 0)
217 + {
218 +- mparam.optimize2d = "smcm";
219 ++ //mparam.optimize2d = (char*)"smcm";
220 ++ mparam.optimize2d = (char*)"smcm";
221 + }
222 + else
223 + {
224 +@@ -1453,7 +1454,7 @@
225 + mesh -> LoadLocalMeshSize (mparam.meshsizefilename);
226 + mesh -> CalcLocalHFromSurfaceCurvature (mparam.grading,
227 + stlparam.resthsurfmeshcurvfac);
228 +- mparam.optimize2d = "cmsmSm";
229 ++ mparam.optimize2d = "(char*)cmsmSm";
230 + STLSurfaceOptimization (*stlgeometry, *mesh, mparam);
231 + #ifdef STAT_STREAM
232 + (*statout) << GetTime() << " & ";
233 +@@ -1560,7 +1561,8 @@
234 + /*
235 + if (!optstring || strlen(optstring) == 0)
236 + {
237 +- mparam.optimize3d = "cmdmstm";
238 ++ //mparam.optimize3d = "cmdmstm";
239 ++ mparam.optimize3d = (char*)"cmdmstm";
240 + }
241 + else
242 + {
243
244 diff --git a/sci-mathematics/netgen/netgen-5.3.1.ebuild b/sci-mathematics/netgen/netgen-5.3.1.ebuild
245 index 1161cbd..3d5b624 100644
246 --- a/sci-mathematics/netgen/netgen-5.3.1.ebuild
247 +++ b/sci-mathematics/netgen/netgen-5.3.1.ebuild
248 @@ -40,6 +40,8 @@ src_prepare() {
249 epatch "${FILESDIR}/${PN}-5.x-occ-stl-api-change.patch"
250 # Taken from http://pkgs.fedoraproject.org/cgit/rpms/netgen-mesher.git/tree/netgen-5.3.1_build.patch
251 epatch "${FILESDIR}/${PN}-5.3.1_build.patch"
252 + # Adapted from http://pkgs.fedoraproject.org/cgit/rpms/netgen-mesher.git/tree/netgen-5.3.0_fixes.patch
253 + epatch "${FILESDIR}/${PN}-5.x-fedora-fixes.patch"
254 if use mpi; then
255 export CC=mpicc
256 export CXX=mpic++