FreeCAD and Raspberry Pi 4

This subforum is specifically to discuss packaging issues on different platforms (windows, mac, linux), and using different packaging systems (conda, etc...)
User avatar
ThierryM
Posts: 25
Joined: Tue Mar 04, 2014 2:51 am
Location: Les Corbières, France
Contact:

Re: FreeCAD and Raspberry Pi 4

Post by ThierryM »

Hi,

First, thanks for your sharing.
I'm trying to install FreeCAD on a Raspberry Pi 4 under Primtux 6 (based on Raspian Buster 10) for pupils (details here in french : https://lofurol.fr/joomla/impression-3d ... s-primtux6) :

Code: Select all

OS: Raspbian GNU/Linux 10 (buster) (/usr/share/xsessions/fluxbox)
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.19.Unknown
Build type: Unknown
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)
I followed the mel instructions here to build 2 versions of FreeCAD (master 0.20 and the "old" 0.19) : https://forum.freecadweb.org/search.php ... ed4c2593d2
But FreeCAD bugs when a create a new document with the same segmentation error in both builts :

Code: Select all

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) [0xb16d2120]
Have you got an idea of this problem ?
Thanks for your help, regards,

Thierry
Linux Mint 21.2, 64 bits, Freecad 0.21
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: FreeCAD and Raspberry Pi 4

Post by -alex- »

Hi my fellow citizen ;-)
ThierryM wrote: Thu Jun 24, 2021 7:29 am Have you got an idea of this problem ?
Yes and no, this is what this whole thread is talking about, but there is no fix yet for RPIOS 32B.
My "official" advice to run FC on RPI4 for now is to use RPIOS 64B beta test.
That said, you can run FC succesffuly on RPIOS 32B if you compile it with Py2 and Qt4 cmake options. See here:
https://forum.freecadweb.org/viewtopic. ... 60#p339166
Be aware that Py2 is quite outdated, if you compile FC 0.19.2 release it should be OK (last FC release with Py2 support). But some add-on workbenchs with Py3 code inside could fail (sheetmetal, gears, etc...).

Hum, maybe I have another idea, I have to investigate before to talk about.

Do not hesitate to open a topic in french subforum to talk about your project.

PS: offtopic, Slic3r runs fine on RPI4 for 3d prints. You can use great macro of @2cv001: https://forum.freecadweb.org/viewtopic.php?f=12&t=52138
User avatar
ThierryM
Posts: 25
Joined: Tue Mar 04, 2014 2:51 am
Location: Les Corbières, France
Contact:

Re: FreeCAD and Raspberry Pi 4

Post by ThierryM »

Hi Alex,

Thanks for your reply.
For my use (pupils), I don't need a powerfull FreeCAD ;) . My idea was to simplify/personnalize the GUI in order that young children can obtain simple parts.
But I've discovered BlocksCAD (that can be used offline, no need of Internet connection), a Scratch-like and OpenSCAD-like, and I think that I'm going to explore this solution rather than FreeCAD at the moment (until an ARM installable version of FC appears ;) ).
Regards,

Thierry
Linux Mint 21.2, 64 bits, Freecad 0.21
Michaelv
Posts: 6
Joined: Tue Sep 28, 2021 7:06 pm
Location: Los Angeles

Re: FreeCAD and Raspberry Pi 4

Post by Michaelv »

Hello,

So I was able to do everything according to alex' method and got Freecad 0.20 working great on raspi 4-8GB-Raspi OS 64

When I type in terminal: cd/freecad-build/bin
and then ./FreecCAD it launches and works great

If I do just FreeCAD (and I'm in the proper directory) it doesn't ("command not found" because the file is showing as a shared library)
So first I don't quite understand this process (the ./name) (I looked online, couldn't find anything)

If I'm in the home directory and type in terminal ~/freecad-build/bin/FreeCAD it works as well and launches
If I'm in that directory and type ls -la, the file shows up with x (executable)
Permissions show anyone can execute

Then what I'm trying to do is create a main menu icon. In the command line I type either ./FreeCAD or ~/freecad-build/bin/FreeCAD and it doesn't recognize it as a "command" or executable, so it doesn't let me validate the menu item (OK button remains grayed)

Any help? Thanks
Last edited by Michaelv on Wed Sep 29, 2021 7:40 pm, edited 1 time in total.
LarryWoestman
Posts: 98
Joined: Fri Oct 09, 2020 4:56 pm
Location: Oregon, USA

Re: FreeCAD and Raspberry Pi 4

Post by LarryWoestman »

If "./foo" works, but "foo" doesn't, then is it quite likely that the directory containing the "foo" file isn't on your "PATH".
In Linux, your "PATH" is a list of directories which should be searched for possible executables.
You can see what your current "PATH" is by typing "echo $PATH". You usually modify the default "PATH"
by editing your ~/.profile file (or equivalent, depending on what shell you have chosen to use)
Michaelv
Posts: 6
Joined: Tue Sep 28, 2021 7:06 pm
Location: Los Angeles

Re: FreeCAD and Raspberry Pi 4

Post by Michaelv »

Thanks, indeed not in path.
It's because I compiled the source instead of installing it (which was necessary apparently) and I'm above my pay grade to fully master what I'm doing (I'm essentially following recipes). Compilation worked but now devil is in the details obviously (so wrong location maybe, and ...)
So I have 2 options as I see it:
1- Add to the path
2- Move "foo" to a location that already is in the path

So I tried to add the path by doing:
~/.profile PATH=$PATH: followed by path of folder containing FreeCAD (launch file)
It told me
bash: /home/pi/.profile: permission denied

I tried to move it too (to not have the program in the document folder, but rather in the folder with all other program, and that didn't work either, also permission denied somehow. yet permission is "owner", so shouldn't be an issue.
LarryWoestman
Posts: 98
Joined: Fri Oct 09, 2020 4:56 pm
Location: Oregon, USA

Re: FreeCAD and Raspberry Pi 4

Post by LarryWoestman »

Another possible option is to use a symbolic link to put a "link" or "pointer" to your executable in a directory that is already being searched.

For example, if the "/usr/bin" directory is on your "PATH" and your compiled FreeCAD executable is in a "freecad-build" directory under your home directory you should be able to execute the following commands:

Code: Select all

cd /usr/bin
ln -s /home/your_login_name/freecad-build/bin/FreeCAD .
That should put a link named "FreeCAD" in the "/usr/bin" directory that "points to" the file at "/home/your_login_name/freecad-build/bin/FreeCAD". After that you should just be able to type

Code: Select all

FreeCAD
and have the system find your executable by finding and following the link.
LarryWoestman
Posts: 98
Joined: Fri Oct 09, 2020 4:56 pm
Location: Oregon, USA

Re: FreeCAD and Raspberry Pi 4

Post by LarryWoestman »

You would need to edit your .profile file, then find the place where the PATH environment variable is set to change the default path. You don't want to run the .profile file with some arguments. Once you have the .profile file modified, you log out and back in, and the .profile file is read and executed during the login process.

On linux there is a difference between a "normal" login and a login with "root" or "everything" powers. Odds are pretty high that your login is a "normal" login. There are ways to get "everything" powers either by using the "sudo" program if it is installed and configured or perhaps by using the "su" program if you have a "root" login set up with a password (less common these days).
Michaelv
Posts: 6
Joined: Tue Sep 28, 2021 7:06 pm
Location: Los Angeles

Re: FreeCAD and Raspberry Pi 4

Post by Michaelv »

Larry,

Thank you so much for your help. So here is the result (I assumed the dot at the end was a mistake):

Code: Select all

cd /usr/bin
ln -s /home/your_login_name/freecad-build/bin/FreeCAD
Returns: failed to create a symbolic link './FreeCAD': permission denied

Then I went into the permission for FreeCAD, and changed the "changed content" to anyone instead of owner only, it made no difference (reversed it).

Then I went and tried to create a launcher item, just to check, this time it works. I haven't changed anything since I've tried first (permission denied every time) but this time the OK was clickable. And the icon now launches FreeCAD YEAH!!!!

This is a big mystery to me, but since the 64bit OS is beta, maybe it has to do with that, or I really fumbled somewhere.

Anyway, problem solved, thanks, now I get to learn FreeCAD which shouldn't be too hard and hopefully contribute to this community and software.
With a speedy card (170mb/s) Raspi OS 64bit on a raspi 4-8GB and FreeCAD 0.20, it looks pretty good, I was able to install workbenches and they work (they didn't work under raspi OS 32 and python 2.7 compilation). Speed looks good so far, but I haven't tried a big file. more exactly I've tried a BIG file (120MB) and that is just too slow for practical purposes but not surprising in regard to the file and its size.
LarryWoestman
Posts: 98
Joined: Fri Oct 09, 2020 4:56 pm
Location: Oregon, USA

Re: FreeCAD and Raspberry Pi 4

Post by LarryWoestman »

No, the dot at the end of the command was supposed to be there.
Post Reply