Debian Buster Compilation Fails

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
wmayer
Founder
Posts: 20203
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Debian Buster Compilation Fails

Post by wmayer »

Your OCE libraries link against libpthreads.so which possibly is missing on your system.

At https://deb.debian.org/debian/pool/main/o/oce/ the OCE Debian packages are hosted and when downloading e.g. liboce-foundation11_0.18.2-3_amd64.deb and extracting its content one could use ldd to check the dependencies.

So, with

Code: Select all

ldd libTKernel.so.11.0.0 
you get
linux-vdso.so.1 (0x00007ffcb719b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f42a3a13000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f42a380f000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f42a3486000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f42a30e8000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f42a2ed0000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f42a2adf000)
/lib64/ld-linux-x86-64.so.2 (0x00007f42a4040000)
When going to https://www.debian.org/distrib/packages and searching for all packages with the content libpthread.so.0 you will get:
https://packages.debian.org/search?sear ... e&arch=any

So, the package is libc6.

Can you check if it's installed and if not install it and retry the build?

Further down in the list there is also a package libc6-amd64-cross that installs libpthread.so.0 into /usr/x86_64-linux-gnu/lib/. So, if the above is not the problem try to install this package, too.
user1234
Veteran
Posts: 3261
Joined: Mon Jul 11, 2016 5:08 pm

Re: Debian Buster Compilation Fails

Post by user1234 »

Thanks for your input. Just said, i am not a expert, just want to help. But when i read
hhassey wrote: Thu Jun 10, 2021 10:15 pmMy error.log still ends with

/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
and search phthreads it on my system, i get boost/signals2*** in my system. But when i search phthread, i get libc6. But if he has not libc6, he has no python3, no g++, no cmake, or a system in general, since the half of the Debian needs libc6.

This is the reason i think, that he can not compile, is that the OCE is still on his harddisc and cmake has it seize up on it. And there was maybe a update that the OCE can not use the newer libraries, since OCE is really old and FreeCAD needs newer libraries for C++14. But so or so, the first thing i will do is going through the dependencies.

Greetings
user1234

*** edit: or libevent
User avatar
kkremitzki
Veteran
Posts: 2509
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Debian Buster Compilation Fails

Post by kkremitzki »

Typically when I have seen this error message, it is a sort of red herring in that the actual error message/problem is elsewhere. Two things I noticed skimming the thread: at one point there is mention of doing some_command > output.txt, but this will only redirect stdout and miss stderr, you want to use some_command &> output.txt to capture both. Also, I noticed the log files seem to only be snippets and not the complete thing (which could be related to the first point), often the actual error to look for will be significantly earlier on.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
hhassey
Posts: 246
Joined: Thu Jun 04, 2015 8:01 pm
Location: Ensenada, Mexico

Re: Debian Buster Compilation Fails

Post by hhassey »

oce-draw is NOT installed
occt-draw IS installed

Code: Select all

root@manuel:~# apt purge oce-draw
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'oce-draw' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
libc6 is installed
ibc6-amd64-cross is installed.

Code: Select all

ldd libTKernel.so.11.0.0 
ldd: ./libTKernel.so.11.0.0: No such file or directory
Still crashing
user1234
Veteran
Posts: 3261
Joined: Mon Jul 11, 2016 5:08 pm

Re: Debian Buster Compilation Fails

Post by user1234 »

Just for completeness: some OCE libraries was installed (a good overview for that is the synaptic). But the main reason for that FreeCAD did not want to build was that cmake got the wrong path from OCCT (but OCE was wiped completely before the cmake runs, absolutely cleans sources and clean build folder before run cmake). Never saw that before.

The right path is

Code: Select all

-DOpenCASCADE_DIR:PATH=/usr/lib/cmake/opencascade
0.png
0.png (57.39 KiB) Viewed 3039 times
No idea why cmake take the wrong path. Just guessing: FreeCAD0.18 libs are installed for the stable version. But should have that an impact? Just wondering.

Greetings
user1234

edit: typo
User avatar
hhassey
Posts: 246
Joined: Thu Jun 04, 2015 8:01 pm
Location: Ensenada, Mexico

Re: Debian Buster Compilation Fails

Post by hhassey »

Just to keep the information flowing, and maybe benefit someone else, here how we go it to work:

Fisrt, I can not thank @user1234 enough, he took the time to videoconference for hours with me using Jitsi sharing our screens and with a lot of patience. Thank you. This community is really awesome!
  • The main problem was that without knowing, even though I did not have OCE installed there were a bunch of OCE libraries installed.
  • Also cmake had the wrong location for the occt libraries.
Once we deleted the OCE libraries and installed the coresponding OCCT ones, and set the correct location on cmake, compilation went smoothly.

Now the problem is when trying to open the Part Workbench on the compiled FreeCAD, it crashes with:

Code: Select all

/opt/freecad-source/freecad-build/Mod/Part/Part.so: undefined symbol: _ZNK18Adaptor2d_HCurve2d11DynamicTypeEv
Traceback (most recent call last):
  File "<string>", line 43, in Initialize
Any ideas why?
wmayer
Founder
Posts: 20203
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Debian Buster Compilation Fails

Post by wmayer »

Now the problem is when trying to open the Part Workbench on the compiled FreeCAD, it crashes with:
Check with ldd which libraries Part.so depends on:

Code: Select all

ldd /opt/freecad-source/freecad-build/Mod/Part/Part.so
user1234
Veteran
Posts: 3261
Joined: Mon Jul 11, 2016 5:08 pm

Re: Debian Buster Compilation Fails

Post by user1234 »

hhassey wrote: Wed Jun 16, 2021 5:56 pmAny ideas why?
Crashes it or error massage? Crash is then FreeCAD closes. As we got FreeCAD compiling, we switched previously the cmake files from OCCT. But some parts before build successfully. In fact you have now ccache installed and the compiler starts where it before stopped, it could be, that the build is partly corrupted. I would make a

Code: Select all

make clean
and rebuild it again. This is the first thing i would do.

Greetings
user1234
User avatar
hhassey
Posts: 246
Joined: Thu Jun 04, 2015 8:01 pm
Location: Ensenada, Mexico

Re: Debian Buster Compilation Fails

Post by hhassey »

Crashes it or error massage?
Send's this error message

Code: Select all

/opt/freecad-source/freecad-build/Mod/Part/Part.so: undefined symbol: _ZNK18Adaptor2d_HCurve2d11DynamicTypeEv
Traceback (most recent call last):
  File "<string>", line 43, in Initialize
Then after

Code: Select all

make clean
the compilation still goes smoothly to 100% but the compiled FreeCAD is still unusable.

here is my error log and my output log.

There are a lot of salomesmesh entries there, but interestingly they look almost exactly as the ones I get on my personal computer where the compiled FreeCAD is perfectly usable.

please help
Attachments
salida.txt
(434.87 KiB) Downloaded 48 times
error.txt
(25.34 KiB) Downloaded 49 times
User avatar
hhassey
Posts: 246
Joined: Thu Jun 04, 2015 8:01 pm
Location: Ensenada, Mexico

Re: Debian Buster Compilation Fails

Post by hhassey »

wmayer wrote: Fri Jun 18, 2021 8:42 am
Now the problem is when trying to open the Part Workbench on the compiled FreeCAD, it crashes with:
Check with ldd which libraries Part.so depends on:

Code: Select all

ldd /opt/freecad-source/freecad-build/Mod/Part/Part.so

Code: Select all

ldd /opt/freecad-source/freecad-build/Mod/Part/Part.so 

	linux-vdso.so.1 (0x00007ffc45ddc000)
	libhdf5_openmpi.so.103 => /lib/x86_64-linux-gnu/libhdf5_openmpi.so.103 (0x00007ff05143d000)
	libmpi.so.40 => /lib/x86_64-linux-gnu/libmpi.so.40 (0x00007ff051334000)
	libmpi_cxx.so.40 => /lib/x86_64-linux-gnu/libmpi_cxx.so.40 (0x00007ff051316000)
	libTKMesh.so.7 => /usr/local/lib/libTKMesh.so.7 (0x00007ff05120d000)
	libTKIGES.so.7 => /usr/local/lib/libTKIGES.so.7 (0x00007ff050e29000)
	libTKSTL.so.7 => /usr/local/lib/libTKSTL.so.7 (0x00007ff050e0b000)
	libTKOffset.so.7 => /usr/local/lib/libTKOffset.so.7 (0x00007ff050c89000)
	libTKSTEP.so.7 => /usr/local/lib/libTKSTEP.so.7 (0x00007ff05097f000)
	libTKHLR.so.7 => /usr/local/lib/libTKHLR.so.7 (0x00007ff05085a000)
	libTKFeat.so.7 => /usr/local/lib/libTKFeat.so.7 (0x00007ff050740000)
	libFreeCADApp.so => /opt/freecad-source/freecad-build/lib/libFreeCADApp.so (0x00007ff050248000)
	libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007ff05018c000)
	libTKFillet.so.7 => /usr/local/lib/libTKFillet.so.7 (0x00007ff04ff0d000)
	libTKSTEPAttr.so.7 => /usr/local/lib/libTKSTEPAttr.so.7 (0x00007ff04fe02000)
	libTKSTEP209.so.7 => /usr/local/lib/libTKSTEP209.so.7 (0x00007ff04fd5d000)
	libTKSTEPBase.so.7 => /usr/local/lib/libTKSTEPBase.so.7 (0x00007ff04fad0000)
	libTKXSBase.so.7 => /usr/local/lib/libTKXSBase.so.7 (0x00007ff04f82f000)
	libTKBool.so.7 => /usr/local/lib/libTKBool.so.7 (0x00007ff04f42b000)
	libTKBO.so.7 => /usr/local/lib/libTKBO.so.7 (0x00007ff04f1a3000)
	libTKShHealing.so.7 => /usr/local/lib/libTKShHealing.so.7 (0x00007ff04ef20000)
	libTKPrim.so.7 => /usr/local/lib/libTKPrim.so.7 (0x00007ff04eeba000)
	libTKTopAlgo.so.7 => /usr/local/lib/libTKTopAlgo.so.7 (0x00007ff04ebd0000)
	libTKGeomAlgo.so.7 => /usr/local/lib/libTKGeomAlgo.so.7 (0x00007ff04e6bc000)
	libTKBRep.so.7 => /usr/local/lib/libTKBRep.so.7 (0x00007ff04e5b1000)
	libTKGeomBase.so.7 => /usr/local/lib/libTKGeomBase.so.7 (0x00007ff04e0bf000)
	libTKG3d.so.7 => /usr/local/lib/libTKG3d.so.7 (0x00007ff04df9b000)
	libTKG2d.so.7 => /usr/local/lib/libTKG2d.so.7 (0x00007ff04df40000)
	libTKMath.so.7 => /usr/local/lib/libTKMath.so.7 (0x00007ff04dcc9000)
	libTKernel.so.7 => /usr/local/lib/libTKernel.so.7 (0x00007ff04daef000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff04dae5000)
	libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff04d95f000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff04d95a000)
	libtbb.so.2 => /lib/x86_64-linux-gnu/libtbb.so.2 (0x00007ff04d91b000)
	libtbbmalloc.so.2 => /lib/x86_64-linux-gnu/libtbbmalloc.so.2 (0x00007ff04d8db000)
	libFreeCADBase.so => /opt/freecad-source/freecad-build/lib/libFreeCADBase.so (0x00007ff04d72f000)
	libxerces-c-3.2.so => /lib/x86_64-linux-gnu/libxerces-c-3.2.so (0x00007ff04d384000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff04d164000)
	libpython3.7m.so.1.0 => /lib/x86_64-linux-gnu/libpython3.7m.so.1.0 (0x00007ff04cc67000)
	libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007ff04cc62000)
	libzipios.so.0 => /lib/x86_64-linux-gnu/libzipios.so.0 (0x00007ff04cc31000)
	libboost_filesystem.so.1.67.0 => /lib/x86_64-linux-gnu/libboost_filesystem.so.1.67.0 (0x00007ff04cc13000)
	libboost_program_options.so.1.67.0 => /lib/x86_64-linux-gnu/libboost_program_options.so.1.67.0 (0x00007ff04cb8c000)
	libboost_regex.so.1.67.0 => /lib/x86_64-linux-gnu/libboost_regex.so.1.67.0 (0x00007ff04ca75000)
	libboost_system.so.1.67.0 => /lib/x86_64-linux-gnu/libboost_system.so.1.67.0 (0x00007ff04ca6e000)
	libboost_thread.so.1.67.0 => /lib/x86_64-linux-gnu/libboost_thread.so.1.67.0 (0x00007ff04ca42000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff04ca21000)
	libboost_chrono.so.1.67.0 => /lib/x86_64-linux-gnu/libboost_chrono.so.1.67.0 (0x00007ff04ca16000)
	libboost_date_time.so.1.67.0 => /lib/x86_64-linux-gnu/libboost_date_time.so.1.67.0 (0x00007ff04ca02000)
	libboost_atomic.so.1.67.0 => /lib/x86_64-linux-gnu/libboost_atomic.so.1.67.0 (0x00007ff04c9fb000)
	libQt5Xml.so.5 => /lib/x86_64-linux-gnu/libQt5Xml.so.5 (0x00007ff04c9bc000)
	libQt5Core.so.5 => /lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007ff04c4c1000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff04c33e000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff04c324000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff04c163000)
	libsz.so.2 => /lib/x86_64-linux-gnu/libsz.so.2 (0x00007ff04bf5e000)
	libopen-rte.so.40 => /lib/x86_64-linux-gnu/libopen-rte.so.40 (0x00007ff04bea6000)
	libopen-pal.so.40 => /lib/x86_64-linux-gnu/libopen-pal.so.40 (0x00007ff04bdf9000)
	libhwloc.so.5 => /lib/x86_64-linux-gnu/libhwloc.so.5 (0x00007ff04bdb7000)
	libevent-2.1.so.6 => /lib/x86_64-linux-gnu/libevent-2.1.so.6 (0x00007ff04bb61000)
	libevent_pthreads-2.1.so.6 => /lib/x86_64-linux-gnu/libevent_pthreads-2.1.so.6 (0x00007ff04b95e000)
	libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007ff04b923000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ff051d56000)
	libatomic.so.1 => /lib/x86_64-linux-gnu/libatomic.so.1 (0x00007ff04b917000)
	libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007ff04b8fe000)
	libcurl-gnutls.so.4 => /lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007ff04b870000)
	libicuuc.so.63 => /lib/x86_64-linux-gnu/libicuuc.so.63 (0x00007ff04b6a1000)
	libicudata.so.63 => /lib/x86_64-linux-gnu/libicudata.so.63 (0x00007ff049cb1000)
	libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007ff049c72000)
	libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007ff049c38000)
	libicui18n.so.63 => /lib/x86_64-linux-gnu/libicui18n.so.63 (0x00007ff04995d000)
	libpcre2-16.so.0 => /lib/x86_64-linux-gnu/libpcre2-16.so.0 (0x00007ff0498e2000)
	libdouble-conversion.so.1 => /lib/x86_64-linux-gnu/libdouble-conversion.so.1 (0x00007ff0498cb000)
	libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007ff0497aa000)
	libaec.so.0 => /lib/x86_64-linux-gnu/libaec.so.0 (0x00007ff0495a2000)
	libnuma.so.1 => /lib/x86_64-linux-gnu/libnuma.so.1 (0x00007ff049594000)
	libltdl.so.7 => /lib/x86_64-linux-gnu/libltdl.so.7 (0x00007ff049589000)
	libnghttp2.so.14 => /lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007ff049561000)
	libidn2.so.0 => /lib/x86_64-linux-gnu/libidn2.so.0 (0x00007ff049540000)
	librtmp.so.1 => /lib/x86_64-linux-gnu/librtmp.so.1 (0x00007ff049323000)
	libssh2.so.1 => /lib/x86_64-linux-gnu/libssh2.so.1 (0x00007ff0492f5000)
	libpsl.so.5 => /lib/x86_64-linux-gnu/libpsl.so.5 (0x00007ff0492e2000)
	libnettle.so.6 => /lib/x86_64-linux-gnu/libnettle.so.6 (0x00007ff0492aa000)
	libgnutls.so.30 => /lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007ff0490fd000)
	libgssapi_krb5.so.2 => /lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007ff0490ae000)
	libkrb5.so.3 => /lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007ff048fce000)
	libk5crypto.so.3 => /lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007ff048f9a000)
	libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007ff048f94000)
	libldap_r-2.4.so.2 => /lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007ff048f40000)
	liblber-2.4.so.2 => /lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007ff048f2f000)
	libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007ff048eb9000)
	libunistring.so.2 => /lib/x86_64-linux-gnu/libunistring.so.2 (0x00007ff048d35000)
	libhogweed.so.4 => /lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007ff048cfc000)
	libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10 (0x00007ff048c79000)
	libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007ff048b5b000)
	libp11-kit.so.0 => /lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007ff048a2a000)
	libtasn1.so.6 => /lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007ff048817000)
	libkrb5support.so.0 => /lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007ff048808000)
	libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007ff048801000)
	libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007ff0487e7000)
	libsasl2.so.2 => /lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007ff0487c8000)
	libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007ff0487a5000)
	libffi.so.6 => /lib/x86_64-linux-gnu/libffi.so.6 (0x00007ff04879b000)
I am not exactly sure what to do with this list. Is there an easy way to check if these dependencies are already installed or do I need to Sudo apt install every one of them?

Thanks @wmayer
Post Reply