[SOLVED] Compilation fails with OCCT 7.5.2.

Having trouble installing or compiling FreeCAD? Get help here.
fcaduser
Posts: 355
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

[SOLVED] Compilation fails with OCCT 7.5.2.

Postby fcaduser » Sun Apr 25, 2021 1:23 pm

Hello FC team.

I'm using the last version, that is 7.5.2 :
https://git.dev.opencascade.org/gitweb/?p=occt.git

(Debian, but clearly that's not the point here.)

Code: Select all

mainuser@station1:~/software/freecad_source/build_2021-04-25$ make -j 1
[  0%] Built target MEFISTO2
[  1%] Built target SMDS
[  1%] Built target SMESHDS
[  2%] Built target Driver
[  2%] Built target DriverSTL
[  2%] Built target DriverDAT
[  2%] Built target DriverUNV
[  3%] Built target SMESH
[  5%] Built target StdMeshers
[  6%] Built target lazy_loader
[  6%] Automatic MOC for target FreeCADBase
[  6%] Built target FreeCADBase_autogen
[  8%] Built target FreeCADBase
[  8%] Generating version_check
git
/home/mainuser/software/freecad_source/build_2021-04-25/src/Build/Version.h.out written
[  8%] Generating Version.h
[  8%] Built target fc_version
[  8%] Automatic MOC for target FreeCADApp
[  8%] Built target FreeCADApp_autogen
[ 10%] Built target FreeCADApp
[ 10%] Automatic MOC for target FreeCADMainCmd
[ 10%] Built target FreeCADMainCmd_autogen
[ 10%] Built target FreeCADMainCmd
[ 10%] Automatic MOC for target FreeCADGui
[ 10%] Built target FreeCADGui_autogen
[ 21%] Built target FreeCADGui
[ 21%] Automatic MOC for target FreeCADMain
[ 21%] Built target FreeCADMain_autogen
[ 21%] Built target FreeCADMain
[ 21%] Automatic MOC for target FreeCADGuiPy
[ 21%] Built target FreeCADGuiPy_autogen
[ 21%] Built target FreeCADGuiPy
[ 21%] Automatic MOC for target FreeCADMainPy
[ 21%] Built target FreeCADMainPy_autogen
[ 21%] Built target FreeCADMainPy
[ 21%] Automatic MOC for target Points
[ 21%] Built target Points_autogen
[ 22%] Built target Points
[ 22%] Automatic MOC for target PointsGui
[ 22%] Built target PointsGui_autogen
[ 22%] Built target PointsGui
[ 22%] Built target Test
[ 22%] Automatic MOC for target QtUnitGui
[ 22%] Built target QtUnitGui_autogen
[ 22%] Built target QtUnitGui
[ 22%] Built target ImageScripts
[ 22%] Automatic MOC for target Image
[ 22%] Built target Image_autogen
[ 22%] Built target Image
[ 22%] Automatic MOC for target ImageGui
[ 22%] Built target ImageGui_autogen
[ 23%] Built target ImageGui
[ 23%] Built target MeshScripts
[ 23%] Automatic MOC for target Mesh
[ 23%] Built target Mesh_autogen
[ 26%] Built target Mesh
[ 26%] Automatic MOC for target MeshGui
[ 26%] Built target MeshGui_autogen
[ 27%] Built target MeshGui
[ 28%] Built target PartScripts
[ 28%] Automatic MOC for target Part
[ 28%] Built target Part_autogen
[ 28%] Building CXX object src/Mod/Part/App/CMakeFiles/Part.dir/ShapeUpgrade/UnifySameDomainPyImp.cpp.o
In file included from /home/mainuser/software/freecad_source/build_2021-04-25/src/Mod/Part/App/ShapeUpgrade/UnifySameDomainPy.h:8,
                 from /home/mainuser/software/freecad_source/src/Mod/Part/App/ShapeUpgrade/UnifySameDomainPyImp.cpp:30:
/home/mainuser/software/occt-0dc2c37/include/opencascade/ShapeUpgrade_UnifySameDomain.hxx:72:15: error: field ‘UnionEdges’ has incomplete type ‘TopoDS_Edge’
   TopoDS_Edge UnionEdges;
               ^~~~~~~~~~
In file included from /home/mainuser/software/occt-0dc2c37/include/opencascade/BRepTools_History.hxx:20,
                 from /home/mainuser/software/occt-0dc2c37/include/opencascade/ShapeUpgrade_UnifySameDomain.hxx:20,
                 from /home/mainuser/software/freecad_source/build_2021-04-25/src/Mod/Part/App/ShapeUpgrade/UnifySameDomainPy.h:8,
                 from /home/mainuser/software/freecad_source/src/Mod/Part/App/ShapeUpgrade/UnifySameDomainPyImp.cpp:30:
/home/mainuser/software/occt-0dc2c37/include/opencascade/TopExp.hxx:31:7: note: forward declaration of ‘class TopoDS_Edge’
 class TopoDS_Edge;
       ^~~~~~~~~~~
make[2]: *** [src/Mod/Part/App/CMakeFiles/Part.dir/build.make:2199: src/Mod/Part/App/CMakeFiles/Part.dir/ShapeUpgrade/UnifySameDomainPyImp.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2293: src/Mod/Part/App/CMakeFiles/Part.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
Last edited by fcaduser on Wed Jun 09, 2021 10:50 am, edited 1 time in total.
wmayer
Site Admin
Posts: 17317
Joined: Thu Feb 19, 2009 10:32 am

Re: Compilation fails with OCCT 7.5.2.

Postby wmayer » Sun Apr 25, 2021 1:57 pm

This looks like an error in OCCT source code.

Code: Select all

TopoDS_Edge UnionEdges;
looks like a new member of the class ShapeUpgrade_UnifySameDomain (it was not there in version 7.5.0). However, the file ShapeUpgrade_UnifySameDomain.hxx doesn't include TopoDS_Edge.hxx.

There is only a forward declaration of TopoDS_Edge in TopExp.hxx but due to the new member of type TopoDS_Edge its class declaration must be known to the compiler.

A workaround is to include TopoDS_Edge.hxx before ShapeUpgrade_UnifySameDomain.hxx in client code but since this is an OCCT issue it's better to report the failure upstream.
wmayer
Site Admin
Posts: 17317
Joined: Thu Feb 19, 2009 10:32 am

Re: Compilation fails with OCCT 7.5.2.

Postby wmayer » Mon Apr 26, 2021 6:05 am

This change causes the failure: https://git.dev.opencascade.org/gitweb/ ... 121cf07caf

This struct has been added to ShapeUpgrade_UnifySameDomain.hxx

Code: Select all

struct SubSequenceOfEdges
{
  TopTools_SequenceOfShape SeqsEdges;
  TopoDS_Edge UnionEdges;
};
without including TopoDS_Edge.hxx

I have reported it to OCCT: https://tracker.dev.opencascade.org/view.php?id=32328
fcaduser
Posts: 355
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Compilation fails with OCCT 7.5.2.

Postby fcaduser » Mon Apr 26, 2021 10:02 am

Thank you very much, I will keep an eye on that.
User avatar
Kunda1
Posts: 10520
Joined: Thu Jan 05, 2017 9:03 pm

Re: Compilation fails with OCCT 7.5.2.

Postby Kunda1 » Mon Apr 26, 2021 11:27 pm

Tracking in 'OCC Bugs in the Bugtracker' forum thread: https://forum.freecadweb.org/viewtopic.php?f=10&t=20264
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
looo
Posts: 3649
Joined: Mon Nov 11, 2013 5:29 pm

Re: Compilation fails with OCCT 7.5.2.

Postby looo » Wed May 12, 2021 11:47 am

wmayer wrote: Mon Apr 26, 2021 6:05 am This change causes the failure: https://git.dev.opencascade.org/gitweb/ ... 121cf07caf

This struct has been added to ShapeUpgrade_UnifySameDomain.hxx

Code: Select all

struct SubSequenceOfEdges
{
  TopTools_SequenceOfShape SeqsEdges;
  TopoDS_Edge UnionEdges;
};
without including TopoDS_Edge.hxx

I have reported it to OCCT: https://tracker.dev.opencascade.org/view.php?id=32328
Do we have a patch for this issue? I would like to update the conda-forge package:
https://github.com/conda-forge/occt-feedstock/pull/67
wmayer
Site Admin
Posts: 17317
Joined: Thu Feb 19, 2009 10:32 am

Re: Compilation fails with OCCT 7.5.2.

Postby wmayer » Wed May 12, 2021 12:04 pm

Do we have a patch for this issue? I would like to update the conda-forge package:
No, but a workaround is to include TopoDS_Edge.hxx before ShapeUpgrade_UnifySameDomain.hxx.
User avatar
looo
Posts: 3649
Joined: Mon Nov 11, 2013 5:29 pm

Re: Compilation fails with OCCT 7.5.2.

Postby looo » Wed May 12, 2021 1:29 pm

wmayer wrote: Wed May 12, 2021 12:04 pm
Do we have a patch for this issue? I would like to update the conda-forge package:
No, but a workaround is to include TopoDS_Edge.hxx before ShapeUpgrade_UnifySameDomain.hxx.
thanks. Can you confirm this patch is correct?
https://github.com/conda-forge/occt-fee ... rade.patch
wmayer
Site Admin
Posts: 17317
Joined: Thu Feb 19, 2009 10:32 am

Re: Compilation fails with OCCT 7.5.2.

Postby wmayer » Wed May 12, 2021 2:15 pm

looo wrote: Wed May 12, 2021 1:29 pm
wmayer wrote: Wed May 12, 2021 12:04 pm
Do we have a patch for this issue? I would like to update the conda-forge package:
No, but a workaround is to include TopoDS_Edge.hxx before ShapeUpgrade_UnifySameDomain.hxx.
thanks. Can you confirm this patch is correct?
https://github.com/conda-forge/occt-fee ... rade.patch
It's correct but you can then remove #include <TopoDS_Shape.hxx> because it's included by TopoDS_Edge.hxx
fcaduser
Posts: 355
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: [SOLVED] Compilation fails with OCCT 7.5.2.

Postby fcaduser » Wed Jun 09, 2021 10:53 am

A workaround is provided.