FreeCAD and Raspberry Pi 4

Hi everyone,
Have you planned a freeCAD package for the Raspberry Pi 4 under Raspbian Buster?
Thank you for your answer and possible evolution.
Papy

[Edit] : ATM there is not fix yet to run FreeCAD py3/Qt5 (from apt repo) with no graphic crash on Raspberry OS 32B.
However you can enjoy FreeCAD by compiling it:

  • on Raspberry OS64B-beta: works great with V3D graphic acceleration (+/-20fps with std parts). The best choice ATM IMHO.
  • on Ubuntu 20.04LTS: FC works fine here, compiled with Py3/Qt5, but a bit slow because CPU graphic acceleration.
  • on Raspberry OS32B: compiled with Py2/Qt4 libs (not the best way, Py2 is outdated, FC 0.19.2 is the very last release Py2 friendly and some addons workbenches will fail)

There has been discussion about FC on RaspberryPi but I’m not sure how much it has evolved? Do you have experience packaging ?

@kkremitzi was interested at the time.

Hi,

Unfortunately no experience :frowning:

Hi,
On reading the topic: https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=244151&p=1493027#p1492154
I installed FeeCAD (0.18) and it runs normally. But when creating a new file, freecad crashes.
I have the following error message:

Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.
Program received signal SIGSEGV, Segmentation fault.
#0 /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer+0)

Do you have a solution or idea to solve this problem?

I would make a new thread asking for help on this topic and then linking back to this thread. The error seems to be coming from Coin3d

Although it has value, you should consider whether FreeCAD is really worth running in a Raspberry Pi. It has very little RAM and a relatively slow processor. Although it has a GPU, nothing guarantees that it can handle 3D shapes that FreeCAD manipulates. On the other hand, since FreeCAD depends on OCCT, Coin3d, Qt5, etc., you should verify that one of these libraries actually works in the Pi. If even a single dependency doesn’t work in ARM, it may be impossible to make FreeCAD work.

Hi,

FreeCad 0.16 worked well in one of the previous version of the OS. The use of FreeCad can be interesting in the domain of 3D printing.
There is an operational version on RPI3 + B (http://www.micrometer.xyz/cdn/node/1) with acceptable reaction times.
The RPI4 has more RAM (max 4GB) and faster so even more comfortable for the user.

Other thread for FreeCad on RPI4 : https://forum.freecadweb.org/viewtopic.php?p=323897#p323897

It seems like conda-forge is trying to package qt for aarch64. So once this is done we could also try to build freecad (and dependencies) for aarch64. But a lot of work is necessary to get it done. Could be a nice gsoc project for next year.

With the performance increase of the Raspberry Pi 4 it should definitely be possible to run FreeCAD for light to medium uses, and the potential this has for low-cost use of FreeCAD for education is huge, which in turn would have a big impact on adoption and growth. Getting this working is on my backlog and if anyone is interested trying to troubleshoot to dig deeper into the problem I’d be glad to help.

Performance wase already pretty cool on Raspberry 3B+, I ran Freecad on it for educational purpose and it was perfectly suitable with small and medium models. The 1Go RAM was the limitation.
So indeed, RPI4 could be really more suitable. A package would be so great :slight_smile:

Off topic, not about packaging I mean: I own a RPI4B4, last weekend Tetsujin (https://forum.freecadweb.org/viewtopic.php?f=3&t=38204) helped me to compile the Freecad actual source code on it. After solved some dependancies issues, compiling failed at 96%. Gcc returned an error about a circular dependancy with a file of techdraw module copying on itself. Sorry I have no more informations to paste here cause I have formated the sd card to re-start from fresh Raspbian installation. Do you think I could success to compile Freecad on RPI4? Or some QT5 dependancy and so one are still missing about ARMHF core?

Edit: I’m just reading your recent posts on raspberry forum.
https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=244151&p=1508866&hilit=freecad&sid=b2a5becc00deb9e5e4cdbcd5b16aa3f1#p1515198
Ok, I should try again to compile following your advices. Please feel you free to tell me about eventual traps to avoid about Freecad compiling on arm64, cause my skills are very limited about compiling, dépendencies and so on.
For now I’m using https://www.freecadweb.org/wiki/CompileOnUnix as starting point. Is it up to date?

I updated CompileOnUnix recently, so the information should be up to date. I tested on an Ubuntu system, which is what I personally use, so I assume the process should work pretty similarly for other Debian based systems.

But as I said before, if only one library isn’t available in ARM, you may have problems. If you have errors, with say, TechDraw, I suggest you disable it, and try to compile without it; look into the Cmake flags. Try to compile a bare FreeCAD with no workbenches, and then try to compile with a few workbenches enabled, and test if it fails at some point.

4083 - A bug in the Coin3D library causing app to crash on RPi4
opened by ‘FrankGould’

Thank you, I succed to compile source code on my RPI4B :smiley:
Unfortunately I get the same error like others when creating a new document:

pi@raspberrypi:~/freecad-build/bin $ ./FreeCAD
FreeCAD 0.19, Libs: 0.19R17651 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2019
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

connect failed: No such file or directory
Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.
Program received signal SIGSEGV, Segmentation fault.
#0  /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer+0) [0xb22f4120]
pi@raspberrypi:~/freecad-build/bin $

So, I hope that solving the 4083 will fix concerning Coin3D will fix this trouble.
Would be so great to test Freecad on RPI4 :slight_smile:

OS: Raspbian GNU/Linux 10 (buster) (LXDE/LXDE-pi)
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.19.17651 (Git)
Build type: Unknown
Branch: master
Hash: 16c26cb3b1cd7209ea8efc8cb30b3b18fd80cf95
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

Dedicated discussion for 4083 is at https://forum.freecadweb.org/viewtopic.php?f=8&t=39444

FYI, saw this recently: https://www.instagram.com/p/B2KXv6Ahfjt/

Sometimes in a debug build on Windows I get the same Coin3d warning but FreeCAD doesn’t crash afterwards. It also was said above that it worked with older FreeCAD versions but Coin3d is very likely the exact same version.

So the question is whether Coin3d is really related to the crash or whether something else (e.g. move from Qt4 to Qt5, system changes, …) could be the problem.

Now the error message doesn’t contain a lot of information and I wonder if it would be possible to run FreeCAD inside a debugger in the hope that we get more information about the call stack.

To get a backtrace you need to compile FreeCAD as a “Debug” build.

cmake -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_BUILD_TYPE=Debug ../freecad-source

Then you start the program with the debugger.

pi@raspberrypi:~/freecad-build/bin $ gdb ./FreeCAD

Then you run FreeCAD and try to produce the crash

(gdb) run

Once you get the crash, FreeCAD will freeze; then you can issue the backtrace command

(gdb) bt full

To finish just quit.

(gdb) quit

If the cause is the Qt5 and Coin3d libraries, you may not get a lot of information. For this you have to install what is called “debug symbols”. In Debian, and Raspbian, these should be packages that have a suffix -dbg or -dbgsym. You should retry the debugging once the symbols are installed.

Thanks for your advices :slight_smile:
if I have time next days I’ll try to compile it again with DEBUG=ON and so on…
I hope I will success despite my very limited skills.

Or… or… you could donate a Raspberry Pi 4 to me, and to Werner. Wink, wink. And then we could test it ourselves. Wink, wink.

The callstack can be found here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=931458