FTBFS with Netgen 6.2.2201 and later

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
StefanBruens
Posts: 24
Joined: Sun Nov 29, 2020 5:30 am

FTBFS with Netgen 6.2.2201 and later

Post by StefanBruens »

Current FC fails to build with Netgen 6.2.2201:

Code: Select all

[  998s] /home/abuild/rpmbuild/BUILD/FreeCAD-0.20/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp: In function 'void {anonymous}::updateTriangulation(const TopoDS_Shape&)':
[  998s] /home/abuild/rpmbuild/BUILD/FreeCAD-0.20/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp:528:11: error: 'BRepMesh_IncrementalMesh' was not declared in this scope
...
[  998s] /home/abuild/rpmbuild/BUILD/FreeCAD-0.20/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp: In static member function 'static void NETGENPlugin_Mesher::PrepareOCCgeometry(netgen::OCCGeometry&, const TopoDS_Shape&, SMESH_Mesh&, std::__cxx11::list<SMESH_subMesh*>*, NETGENPlugin_Internals*)':
[  998s] /home/abuild/rpmbuild/BUILD/FreeCAD-0.20/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp:611:3: error: 'BRepBndLib' has not been declared
...
[  998s] /home/abuild/rpmbuild/BUILD/FreeCAD-0.20/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp: In static member function 'static int NETGENPlugin_Mesher::FillSMesh(const netgen::OCCGeometry&, netgen::Mesh&, const NETGENPlugin_ngMeshInfo&, SMESH_Mesh&, std::vector<const SMDS_MeshNode*>&, SMESH_Comment&, SMESH_MesherHelper*)':
[  998s] /home/abuild/rpmbuild/BUILD/FreeCAD-0.20/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp:2260:18: error: aggregate 'TopoDS_Solid aSolid' has incomplete type and cannot be defined
This is likely caused by https://github.com/NGSolve/netgen/commi ... 9da1be7669 - BRepMesh_IncrementalMesh.hxx is no longer implicitly included

The fix is apparently trivial:

Code: Select all

--- a/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp
+++ b/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp
@@ -50,7 +50,9 @@
 
 #include <utilities.h>
 
+#include <BRepBndLib.hxx>
 #include <BRepBuilderAPI_Copy.hxx>
+#include <BRepMesh_IncrementalMesh.hxx>
 #include <BRep_Tool.hxx>
 #include <Bnd_B3d.hxx>
 #include <NCollection_Map.hxx>
@@ -66,6 +68,7 @@
 #include <TopTools_DataMapOfShapeShape.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopoDS.hxx>
+#include <TopoDS_Solid.hxx>
 
 #ifdef _MSC_VER
 #pragma warning(disable : 4067)
 --- a/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cpp
+++ b/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cpp
@@ -39,6 +39,8 @@
 #include <StdMeshers_MaxElementArea.hxx>
 #include <StdMeshers_QuadranglePreference.hxx>
 #include <StdMeshers_ViscousLayers2D.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
 
 #include <Precision.hxx>
 #include <Standard_ErrorHandler.hxx>
 
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: FTBFS with Netgen 6.2.2201 and later

Post by uwestoehr »

StefanBruens wrote: Mon Aug 15, 2022 11:10 pm The fix is apparently trivial:
Thanks. I committed this: git commit 8b056f156
Please give it a try.
Post Reply