master build - shibroken- resolved

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
freman
Veteran
Posts: 2200
Joined: Tue Nov 27, 2018 10:30 pm

master build - shibroken- resolved

Post by freman »

Hi,

I tried to update master and after solving a regression with Coin3D cmake file I did get a clean build. However, I get runtime failures from shiboken and cannot do anything with FreeCAD.

On start up:

Code: Select all

Traceback (most recent call last):                                                                                                                       
  File "<string>", line 1, in <module>                                                                                                                   
  File "/usr/lib64/python3.10/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import                                    
    return original_import(name, *args, **kwargs)                                                                                                        
<class 'ImportError'>: /~/freecad-build-master/Mod/Mesh/Mesh.so: undefined symbol: _ZN4Base5Line3IdEC1ERKNS_7Vector3IdEES5_                            
/~/freecad-build-master/Mod/Mesh/Mesh.so: undefined symbol: _ZN4Base5Line3IdEC1ERKNS_7Vector3IdEES5_      

here are the relevant lines from cmake output:

Code: Select all

-- Designer plugin:     not built per user request (BUILD_DESIGNER_PLUGIN)
-- Shiboken2:           5.15.2 [/lib64/cmake/Shiboken2-5.15.2] [/usr/include/shiboken2;/usr/include/python3.10]
-- PySide2:             5.15.2 [/usr/include/PySide2]
Can anyone cast any light on what to do here?

TIA.

Code: Select all

OS: Fedora Linux 35 (Thirty Five) (LXQt//usr/share/xsessions/lxqt)
Word size of FreeCAD: 64-bit
Version: 0.21.29925 (Git)
Build type: Release
Branch: master
Hash: 322080d4f114d0d27083729f3a2db53242ae3f4d
Python 3.10.5, Qt 5.15.2, Coin 4.0.0, Vtk 9.0.3, OCC 7.5.0
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * FreeCAD_Assembly4 0.11.10
  * FreeCAD_assembly3
Last edited by freman on Sun Aug 07, 2022 3:19 pm, edited 1 time in total.
User avatar
freman
Veteran
Posts: 2200
Joined: Tue Nov 27, 2018 10:30 pm

Re: master build - shibroken

Post by freman »

I just tried starting a previously working master build from May 2022. It shows a similar message with an undefined symbol, though is a different context.

Code: Select all

08:57:13  During initialization the error "module 'FreeCAD' has no attribute 'EndingAdd'" occurred in /~/freecad-build-master.clone/Mod/Image/InitGui.py
08:57:13  Please look into the log file for further information
08:57:13  During initialization the error "module 'FreeCAD' has no attribute 'EndingAdd'" occurred in /~/freecad-build-master.clone/Mod/Spreadsheet/InitGui.py
08:57:13  Please look into the log file for further information
08:57:17  /~/freecad-build-master.clone/Mod/Path/Path.so: undefined symbol: _ZN4Base7Vector3IdEC1ERKS1_
08:57:17  Wizard shaft module cannot be loaded
08:57:17  /~/freecad-build-master.clone/Mod/PartDesign/PartDesignGui.so: undefined symbol: _ZN4Base7Vector3IdEaSERKS1_
It seems the chopping and changing I had to do in trying to resolve the Coin cmake changes may have broken something else.

Any Ideas on where to look to get this working again ?
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: master build - shibroken

Post by wmayer »

freman wrote: Fri Aug 05, 2022 8:26 am However, I get runtime failures from shiboken and cannot do anything with FreeCAD
shiboken isn't the problem. shiboken has implemented a special import loader mechanism as discussed here https://forum.freecadweb.org/viewtopic. ... 20#p397620 and this always jumps in if a module has failed to load. If also shiboken's import loader fails then the reported error message contains something with shiboken. Unfortunately this distracts from the actual problem.

Your actual problem is this linker error:
<class 'ImportError'>: /~/freecad-build-master/Mod/Mesh/Mesh.so: undefined symbol: _ZN4Base5Line3IdEC1ERKNS_7Vector3IdEES5_
/~/freecad-build-master/Mod/Mesh/Mesh.so: undefined symbol: _ZN4Base5Line3IdEC1ERKNS_7Vector3IdEES5_
It's about the class Base::Line3 that has been added to FreeCADBase recently and used by the Mesh module. You probably have to do a clean rebuild.
User avatar
freman
Veteran
Posts: 2200
Joined: Tue Nov 27, 2018 10:30 pm

Re: master build - shibroken

Post by freman »

Hi, thanks for the explanation.

I have done a clean rebuild of opencascade, opencamlib which I build locally and a clean installation of FC, with the cmake change you suggested in the other thread.

It is somewhat cleaner but I'm still getting similar errors:

Code: Select all

11:39:11  1.550142 <asm3.main> init_gui.py(14): no solver backend found
11:39:11  /usr/local/lib64/Import.so: undefined symbol: _ZN24BRepBuilderAPI_MakeShape5BuildEv
Still getting a [word censored] load of errors when I open a previous project

Code: Select all

11:45:05  Cannot create object 'Body': (/usr/local/lib64/PartGui.so: undefined symbol: _ZN24BRepBuilderAPI_MakeShape5BuildEv)
11:45:05  Cannot create object 'Sketch': (/usr/local/lib64/PartGui.so: undefined symbol: _ZN24BRepBuilderAPI_MakeShape5BuildEv)
11:45:05  Cannot create object 'Job001': (/usr/local/lib64/Import.so: undefined symbol: _ZN24BRepBuilderAPI_MakeShape5BuildEv)
11:45:05  Cannot create object 'TC__Default_Tool': (/usr/local/lib64/Import.so: undefined symbol: _ZN24BRepBuilderAPI_MakeShape5BuildEv)
11:45:05  Cannot create object '_0_Deg__V_Bit': (/usr/local/lib64/Import.so: undefined symbol: _ZN24BRepBuilderAPI_MakeShape5BuildEv)
11:45:05  Cannot create object 'Vcarve': (/usr/local/lib64/Import.so: undefined symbol: _ZN24BRepBuilderAPI_MakeShape5BuildEv)
11:45:05  Cannot create object 'Deburr': (/usr/local/lib64/Import.so: undefined symbol: _ZN24BRepBuilderAPI_MakeShape5BuildEv)
Last edited by freman on Sat Aug 06, 2022 11:40 am, edited 1 time in total.
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: master build - shibroken

Post by wmayer »

It is somewhat cleaner but I'm still getting similar errors:
If I got you right you use a local build of OCC that is linked by your FreeCAD build. Do you additionally have a system OCC version installed?
If yes, then your installed FreeCAD version apparently tries to load that OCC version and due to binary incompatibilities it fails. To fix this you must define the environment variable LD_LIBRARY_PATH accordingly.

I recommend to write a freecad.sh script that sets the environment variable and executes FreeCAD. You then have to use this script when starting FreeCAD.

The file would be like this:

Code: Select all

#!/bin/sh

export LD_LIBRARY_PATH=<<--- Put here the abs. path to your local OCC's lib directory -->>
<<--- Put here the abs. path to the FreeCAD executable -->>
Then make the script executable with

Code: Select all

chmod u+x freecad.sh
User avatar
freman
Veteran
Posts: 2200
Joined: Tue Nov 27, 2018 10:30 pm

Re: master build - shibroken

Post by freman »

Thanks.

In principal I only have the local build of OCC , though with all the to-ing an fro-ing with chasing down the cmake problem I do not have 100% confidence there is not some cruft left somewhere.

There is also the possibility that the package manager removed some deps when I uninstalled the distro Coin pkg that I needed to keep, though I do have a clean build compiling correctly so in principal all is there.

printenv tells me :
LD_LIBRARY_PATH=/usr/local/lib:/usr/lib64/openmpi/lib/:/usr/local/lib64/

I run FC directly from the build tree with ./FreeCAD , which is what I have always done in several years of building master FreeCAD.
User avatar
freman
Veteran
Posts: 2200
Joined: Tue Nov 27, 2018 10:30 pm

Re: master build - shibroken

Post by freman »

OK , I was confused after all the back and forth.

I am using distro provided opencascasde 7.5.0 , Coin4 and only OCL is built locally.

I cleaned out all the OCC files manually ( since they don't provide make uninstall target ).
I deleted the entire FreeCAD build tree and did a clean build.

Code: Select all

-- OCC:                 7.5.0 [TKFillet;TKMesh;TKernel;TKG2d;TKG3d;TKMath;TKIGES;TKSTL;TKShHealing;TKXSBase;TKBool;TKBO;TKBRep;TKTopAlgo;TKGeomAlgo;TKGeomBase;TKOffset;TKPrim;TKSTEPBase;TKSTEPAttr;TKSTEP209;TKSTEP;TKHLR;TKFeat] [/usr/lib64] [/usr/include/opencascade]
-- SMESH:               7.7.1.0 build internal
Still essentially the same problem:

Code: Select all

12:08:48  Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3.10/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
<class 'ImportError'>: ~/freecad-build-master/Mod/Mesh/Mesh.so: undefined symbol: _ZN4Base5Line3IdEC1ERKNS_7Vector3IdEES5_
12:08:48  ~/freecad-build-master/Mod/Mesh/Mesh.so: undefined symbol: _ZN4Base5Line3IdEC1ERKNS_7Vector3IdEES5_
Fedora offers smesh-9.6.0 , am I better using that or the built-in 7.7.1.0 ? Is the Mod/Mesh problem related to smesh ?

How can that be done ? -DBUILD_SMESH=OFF does not seem to change this.


Thanks for your help .
Last edited by freman on Sun Aug 07, 2022 12:27 pm, edited 1 time in total.
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: master build - shibroken

Post by wmayer »

Is the Mod/Mesh problem related to smesh ?
No, it's totally unrelated.
/svn/freecad-build-master/Mod/Mesh/Mesh.so: undefined symbol: _ZN4Base5Line3IdEC1ERKNS_7Vector3IdEES5_
This function requires this type.

For some reason your libFreeCADBase.so seem to lack of the symbols of Base::Line3f and Base::Line3d.

What's the output of

Code: Select all

nm libFreeCADBase.so | grep Line3
?
User avatar
freman
Veteran
Posts: 2200
Joined: Tue Nov 27, 2018 10:30 pm

Re: master build - shibroken

Post by freman »

Code: Select all

 nm ../lib/libFreeCADBase.so | grep Base5Line3IdEC
00000000002d1738 W _ZN4Base5Line3IdEC1EOS1_
00000000002d17ae W _ZN4Base5Line3IdEC1ERKNS_7Vector3IdEES5_
00000000002d16ea W _ZN4Base5Line3IdEC1ERKS1_
00000000002d1738 W _ZN4Base5Line3IdEC2EOS1_
00000000002d17ae W _ZN4Base5Line3IdEC2ERKNS_7Vector3IdEES5_
00000000002d16ea W _ZN4Base5Line3IdEC2ERKS1_
There we find the thing it says is missing but I had to point it to the right directory.

Code: Select all

$ nm ../lib/libFreeCADBase.so | grep _ZN4Base5Line3IdEC1ERKNS_7Vector3IdEES5_ 
00000000002d17ae W _ZN4Base5Line3IdEC1ERKNS_7Vector3IdEES5_
AH, I FOUND IT.

Code: Select all

find /usr -iname libFreeCADBase.so
find: ‘/usr/share/empty.sshd’: Permission denied
find: ‘/usr/share/polkit-1/rules.d’: Permission denied
find: ‘/usr/libexec/initscripts/legacy-actions/auditd’: Permission denied
/usr/local/lib64/libFreeCADBase.so
There is a bunch of FreeCAD stuff in there, dated 4th Aug 2022. I'm guessing that I accidentally ran install on FreeCAD on one of a dozen builds I've done in the past few days. As we've seen that is in my load path so was getting pulled in first.

Cleaning that out and it seems to be working without error now . PHEW.

Many thanks for the insider knowledge. There is no way I would have got from those cryptic messages to the cause of this without your expertise.
Post Reply