Help needed: 0.17 for Fedora package

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
hobbes1069
Posts: 291
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Help needed: 0.17 for Fedora package

Post by hobbes1069 »

I've been trying without success to build official packages for Fedora. There's quite the web of issues so I'll try to be succinct but thorough at the same time (wish me luck).
  • 0.17 bundles smesh 5.X, Fedora has 6.7.5 from the fork provided by the OCE guys[1].
  • The bundled smesh requires libmed which is not in Fedora, when using system smesh its not explicitly required (but probably a good idea long term).
  • There is a pull request[2] that was accepted to make FreeCAD compliant with smesh 7.
  • The pull request fixes some of the compilation issues with smesh 6.X but causes others
  • I added some logic[3] around smesh in cmake for linking with the right libraries but now that patch is all interwoven with the pull request.
So I've been trying for over a month to get this sorted out but at this point I've largely given up. Hopefully some people smarter than me can help :)

Thanks,
Richard
Fedora FreeCAD maintainer

[1] https://github.com/tpaviot/smesh
[2] https://github.com/FreeCAD/FreeCAD/pull/1407
[3] https://hobbes1069.fedorapeople.org/fre ... mesh.patch
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Help needed: 0.17 for Fedora package

Post by looo »

I am currently using this patch [1] to link to the full paths of smesh. THis is needed for osx-conda-packages. Maybe you can try if this solves any issues for you.
hobbes1096 wrote: The pull request fixes some of the compilation issues with smesh 6.X but causes others
Can you explain your problems?


[1] https://github.com/looooo/staged-recipe ... mesh.patch
User avatar
hobbes1069
Posts: 291
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Re: Help needed: 0.17 for Fedora package

Post by hobbes1069 »

I tried in the pull request but both you and wmayer stopped responding...

I implemented a similar solution myself:

Code: Select all

             if(NOT SMESH_FOUND)
+                # Find libraries manually
+                foreach(smesh_lib SMDS SMESH SMESHDS StdMeshers)
+                    find_library(SMESH_${smesh_lib} ${smesh_lib})
+                    if(SMESH_${smesh_lib})
+                        list(APPEND SMESH_LIBRARIES ${SMESH_${smesh_lib}})
+                    else()
+                        message(ERROR "  ==========================\n"
+                              "  SMESH library ${smesh_lib} not found.\n"
+                              "  ==========================\n")
+                    endif()
+                endforeach()
+                message(STATUS "smesh libs found: ${SMESH_LIBRARIES}")
+                find_path(SMESH_INCLUDE_DIR SMESH_SMESH.hxx
+                    PATH_SUFFIXES smesh)
+            endif()
I'm currently trying to build with a slight modification to your pull request, some of the conditionals you added around what headers to include appear to be OK for smesh 6 as well. I'm trying a build but I still expect a failure due to the commit to the bundled smesh to implement a single smesh generator per session of Freecad[4,5].

Perhaps you could come up with an additional conditional that would be appropriate for smesh 6?

[4] https://github.com/FreeCAD/FreeCAD/commit/55534e98d
[5] https://github.com/FreeCAD/FreeCAD/commit/381425102
User avatar
hobbes1069
Posts: 291
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Re: Help needed: 0.17 for Fedora package

Post by hobbes1069 »

There are a TON of warnings but here's the actual errors:

Code: Select all

BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp: In member function 'void Fem::FemMesh::copyMeshData(const Fem::FemMesh&)':
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:178:65: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
BUILDSTDERR:                                                static_cast<const SMDS_VtkVolume*>(elem)->GetQuantities(),
BUILDSTDERR:                                                                  ^~~~~~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:178:65: error: expected '>' before 'SMDS_VtkVolume'
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:178:65: error: expected '(' before 'SMDS_VtkVolume'
BUILDSTDERR:                                                static_cast<const SMDS_VtkVolume*>(elem)->GetQuantities(),
BUILDSTDERR:                                                                  ^~~~~~~~~~~~~~
BUILDSTDERR:                                                                  (
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:178:65: error: 'SMDS_VtkVolume' was not declared in this scope
BUILDSTDERR:                                                static_cast<const SMDS_VtkVolume*>(elem)->GetQuantities(),
BUILDSTDERR:                                                                  ^~~~~~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:178:65: note: suggested alternative: 'SMDS_MeshVolume'
BUILDSTDERR:                                                static_cast<const SMDS_VtkVolume*>(elem)->GetQuantities(),
BUILDSTDERR:                                                                  ^~~~~~~~~~~~~~
BUILDSTDERR:                                                                  SMDS_MeshVolume
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:178:80: error: expected primary-expression before '>' token
BUILDSTDERR:                                                static_cast<const SMDS_VtkVolume*>(elem)->GetQuantities(),
BUILDSTDERR:                                                                                 ^
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:178:89: error: 'const class SMDS_MeshElement' has no member named 'GetQuantities'
BUILDSTDERR:                                                static_cast<const SMDS_VtkVolume*>(elem)->GetQuantities(),
BUILDSTDERR:                                                                                          ^~~~~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:181:18: error: 'SMDSEntity_Ball' was not declared in this scope
BUILDSTDERR:              case SMDSEntity_Ball:
BUILDSTDERR:                   ^~~~~~~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:181:18: note: suggested alternative: 'SMDSEntity_Last'
BUILDSTDERR:              case SMDSEntity_Ball:
BUILDSTDERR:                   ^~~~~~~~~~~~~~~
BUILDSTDERR:                   SMDSEntity_Last
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:183:35: error: 'ElemFeatures' is not a member of 'SMESH_MeshEditor'
BUILDSTDERR:                  SMESH_MeshEditor::ElemFeatures elemFeat;
BUILDSTDERR:                                    ^~~~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:184:17: error: 'elemFeat' was not declared in this scope
BUILDSTDERR:                  elemFeat.Init(static_cast<const SMDS_BallElement*>(elem)->GetDiameter());
BUILDSTDERR:                  ^~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:184:17: note: suggested alternative: 'qMemSet'
BUILDSTDERR:                  elemFeat.Init(static_cast<const SMDS_BallElement*>(elem)->GetDiameter());
BUILDSTDERR:                  ^~~~~~~~
BUILDSTDERR:                  qMemSet
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:184:49: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
BUILDSTDERR:                  elemFeat.Init(static_cast<const SMDS_BallElement*>(elem)->GetDiameter());
BUILDSTDERR:                                                  ^~~~~~~~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:184:49: error: expected '>' before 'SMDS_BallElement'
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:184:49: error: expected '(' before 'SMDS_BallElement'
BUILDSTDERR:                  elemFeat.Init(static_cast<const SMDS_BallElement*>(elem)->GetDiameter());
BUILDSTDERR:                                                  ^~~~~~~~~~~~~~~~
BUILDSTDERR:                                                  (
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/Fem/App/FemMesh.cpp:184:49: error: 'SMDS_BallElement' was not declared in this scope
BUILDSTDERR:                  elemFeat.Init(static_cast<const SMDS_BallElement*>(elem)->GetDiameter());
BUILDSTDERR:                                                  ^~~~~~~~~~~~~~~~
This is with forcing SMESH_VERSION_MAJOR to 7...
User avatar
hobbes1069
Posts: 291
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Re: Help needed: 0.17 for Fedora package

Post by hobbes1069 »

After chainging SMESH_VERSION_MAJOR to 6 (and after changing the conditionals to >= 6 for the includes) I get this:

Code: Select all

BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/MeshPart/App/Mesher.cpp: In member function 'Mesh::MeshObject* MeshPart::Mesher::createMesh() const':
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/MeshPart/App/Mesher.cpp:327:37: error: 'get' is not a member of 'SMESH_Gen'
BUILDSTDERR:      SMESH_Gen* meshgen = SMESH_Gen::get();
BUILDSTDERR:                                      ^~~
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/MeshPart/App/Mesher.cpp:410:9: error: 'StdMeshers_TrianglePreference' was not declared in this scope
BUILDSTDERR:          StdMeshers_TrianglePreference* hyp2d_1 = new StdMeshers_TrianglePreference(hyp++,0,meshgen);
BUILDSTDERR:          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/MeshPart/App/Mesher.cpp:410:9: note: suggested alternative: 'StdMeshers_QuadranglePreference'
BUILDSTDERR:          StdMeshers_TrianglePreference* hyp2d_1 = new StdMeshers_TrianglePreference(hyp++,0,meshgen);
BUILDSTDERR:          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BUILDSTDERR:          StdMeshers_QuadranglePreference
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/MeshPart/App/Mesher.cpp:410:40: error: 'hyp2d_1' was not declared in this scope
BUILDSTDERR:          StdMeshers_TrianglePreference* hyp2d_1 = new StdMeshers_TrianglePreference(hyp++,0,meshgen);
BUILDSTDERR:                                         ^~~~~~~
BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Mod/MeshPart/App/Mesher.cpp:410:54: error: expected type-specifier before 'StdMeshers_TrianglePreference'
BUILDSTDERR:          StdMeshers_TrianglePreference* hyp2d_1 = new StdMeshers_TrianglePreference(hyp++,0,meshgen);
BUILDSTDERR:                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Help needed: 0.17 for Fedora package

Post by looo »

Maybe you can look where the external smesh defines SMDS_VtkVolume?
User avatar
hobbes1069
Posts: 291
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Re: Help needed: 0.17 for Fedora package

Post by hobbes1069 »

It doesn't look like smesh 6 has 'SMDS_VtkVolume'...
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Help needed: 0.17 for Fedora package

Post by PrzemoF »

Hi Richard,
What version of fedora do you use? Rawhide?

Let me know if you're interested in joining the group: https://copr.fedorainfracloud.org/group ... cad/coprs/

Edit: libmed is in fedora-28 (packages med & med-devel), but there are problems with finding it, so I use cmake with

Code: Select all

-DMEDFILE_INCLUDE_DIRS=%{_includedir}/med/
in .spec
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Help needed: 0.17 for Fedora package

Post by looo »

hobbes1069 wrote: Tue Jun 12, 2018 6:41 pm It doesn't look like smesh 6 has 'SMDS_VtkVolume'...
It looks like it is mandatory.
Maybe it's easier to use the internal smesh. I guess you should be able to run an external smesh and the internal smesh of FreeCAD side by side if you install freecad to /usr/lib/freecad like it is done for ubuntu.
User avatar
hobbes1069
Posts: 291
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Re: Help needed: 0.17 for Fedora package

Post by hobbes1069 »

Ok, it looks like just the fork I use doesn't integrate Vtk so I opened up an issue on their github issue tracker:

https://github.com/tpaviot/smesh/issues/55

I tried building the smesh you mention[5] in the pull request but I get an error building:

Code: Select all

In file included from /home/build/rpmbuild/SMESH/BUILD/SMESH-8.3.0-b0/inc/SMESH_MeshVSLink.hxx:31,
                 from /home/build/rpmbuild/SMESH/BUILD/SMESH-8.3.0-b0/src/SMESH/SMESH_MeshVSLink.cxx:28:
/home/build/rpmbuild/SMESH/BUILD/SMESH-8.3.0-b0/inc/Handle_SMESH_MeshVSLink.hxx:45:1: error: 'SMESH_EXPORT' does not name a type
 SMESH_EXPORT Handle(Standard_Type)& STANDARD_TYPE(SMESH_MeshVSLink);
 ^~~~~~~~~~~~
[5] https://github.com/LaughlinResearch/SMESH
Post Reply