I tried to patch this in the cmake file of salomesmesh but found out that the header files are in two places, see
https://packages.debian.org/sid/amd64/n ... s/filelist
The files in /usr/include/netgen/include seem to include the other files again.
Thus this should do the trick:
Code: Select all
--- a/src/3rdParty/salomesmesh/CMakeLists.txt
+++ b/src/3rdParty/salomesmesh/CMakeLists.txt
@@ -20,6 +20,10 @@ if (VTK_OPTIONS)
add_definitions(${VTK_OPTIONS})
endif()
+if (NOT NETGEN_INCLUDE_DIR)
+ MESSAGE("Netgen include dir is not set!" FATAL_ERROR)
+endif(NOT NETGEN_INCLUDE_DIR)
+
include_directories(
src/SMDS
src/Driver
@@ -35,6 +39,17 @@ include_directories(
${OCC_INCLUDE_DIR}
${NGLIB_INCLUDE_DIR}
${NETGEN_INCLUDE_DIRS}
+ ${NETGEN_INCLUDE_DIR}/include
${ZLIB_INCLUDE_DIR}
${VTK_INCLUDE_DIRS}
${HDF5_INCLUDE_DIR}
But this raises a ton of new errors like:
Code: Select all
Building CXX object src/3rdParty/salomesmesh/CMakeFiles/NETGENPlugin.dir/src/NETGENPlugin/NETGENPlugin_Mesher.cpp.o
cd /build/FreeCAD/obj-x86_64-linux-gnu/src/3rdParty/salomesmesh && /usr/bin/ccache /usr/lib/ccache/c++ -DCSFDB -DHAVE_CONFIG_H -DHAVE_LIMITS_H -DLIN -DNETGENPlugin_EXPORTS -DNO_PARALLEL_THREADS -DOCCGEOMETRY -DOCC_CONVERT_SIGNALS -D_OCC64 -I/build/FreeCAD/obj-x86_64-linux-gnu -I/build/FreeCAD/obj-x86_64-linux-gnu/src -I/build/FreeCAD/src -I/build/FreeCAD/src/3rdParty/salomesmesh/src/SMDS -I/build/FreeCAD/src/3rdParty/salomesmesh/src/Driver -I/build/FreeCAD/src/3rdParty/salomesmesh/src/DriverUNV -I/build/FreeCAD/src/3rdParty/salomesmesh/src/DriverDAT -I/build/FreeCAD/src/3rdParty/salomesmesh/src/DriverSTL -I/build/FreeCAD/src/3rdParty/salomesmesh/src/StdMeshers -I/build/FreeCAD/src/3rdParty/salomesmesh/inc -I/build/FreeCAD/obj-x86_64-linux-gnu/src/3rdParty/salomesmesh -I/usr/include/occt -I/usr/include/netgen -I/usr/include/netgen/include -I/usr/include/vtk-6.3 -I/usr/include/x86_64-linux-gnu -I/usr/include/hdf5/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/include/jsoncpp -I/usr/include/freetype2 -Wall -Wextra -Wno-write-strings -Wall -DHAVE_SWIG=1 -fpermissive -g -O2 -fdebug-prefix-map=/build/FreeCAD=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++11 -D_OCC64 -Wno-sign-compare -Wno-reorder -Wno-switch -Wno-unused-variable -Wno-unused-but-set-variable -Wno-comment -Wno-unused-parameter -O3 -DNDEBUG -fPIC -I/usr/include/openmpi -I/usr/include/hdf5/openmpi -pthread -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -o CMakeFiles/NETGENPlugin.dir/src/NETGENPlugin/NETGENPlugin_Mesher.cpp.o -c /build/FreeCAD/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp
In file included from /usr/include/netgen/include/../general/myadt.hpp:17,
from /usr/include/netgen/include/../meshing/../include/myadt.hpp:1,
from /usr/include/netgen/include/../meshing/meshing.hpp:6,
from /usr/include/netgen/include/meshing.hpp:1,
from /usr/include/netgen/include/../occ/occgeom.hpp:12,
from /usr/include/netgen/include/occgeom.hpp:1,
from /build/FreeCAD/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp:80:
/usr/include/netgen/include/../general/../include/mydefs.hpp:26: warning: "DLL_HEADER" redefined
#define DLL_HEADER __attribute__ ((visibility ("default")))
In file included from /build/FreeCAD/src/3rdParty/salomesmesh/inc/NETGENPlugin_Mesher.hxx:42,
from /build/FreeCAD/src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp:30:
/usr/include/netgen/nglib.h:33: note: this is the location of the previous definition
#define DLL_HEADER
For me this looks like that netgen requires some (better) import guards.
It is also interesting, that the header files directly in /usr/include/netgen are from libnglib-dev but the others are from netgen-headers, which depends on libnglib-dev.
The problem seems to be, if somewhere nglib.h is included, the build breaks as nglib.h redefines stuff from netgen-headers but does not guard it.