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
-alex-
Veteran
Posts: 1853
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: FreeCAD and Raspberry Pi 4

Post by -alex- »

sgrogan wrote: Tue May 05, 2020 11:38 pm
-alex- wrote: Tue May 05, 2020 11:26 pm Netgen is still missing in Mesh design WB
How about FEM and Path?
Pls see here https://forum.freecadweb.org/viewtopic. ... 71#p395647
User avatar
-alex-
Veteran
Posts: 1853
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: FreeCAD and Raspberry Pi 4

Post by -alex- »

kkremitzki wrote: Tue May 05, 2020 11:41 pm libboost-signals-dev is not in Ubuntu 20.04 but it doesn't seem to be needed if you use -DUSE_PYBIND11=ON in your CMake call.
Thank you for the trick, I will try that tomorrow. Time to sleep this side of Atlantic ;)
User avatar
-alex-
Veteran
Posts: 1853
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: FreeCAD and Raspberry Pi 4

Post by -alex- »

sgrogan wrote: Tue May 05, 2020 11:38 pm E: Unable to locate package python3-pyside2uic
There is a pyside2 QT5 clash on some systems. See here: https://forum.freecadweb.org/viewtopic. ... 20#p395462
Thank you guys!! that did the trick, thank you @hko, I can confirm that works with (X)ubuntu 20.04.

So, FreeCAD 0.19 compiled with Py3/Qt5 works like a charme :D
Some minor issue remains with FEM, I'll investigate about that in FEM subforum.
freecad_0_19_Py3Qt5_RPI4_Ubuntu_20-04LTS.png
freecad_0_19_Py3Qt5_RPI4_Ubuntu_20-04LTS.png (184.12 KiB) Viewed 9347 times
FreeCAD_019_Py3-Qt5_RPI4_Ubuntu20_04.gif
FreeCAD_019_Py3-Qt5_RPI4_Ubuntu20_04.gif (522.22 KiB) Viewed 9347 times

FreeCAD 0.19 on RPI4 rocks! Thank you guys :D

OS: Ubuntu 20.04 LTS (XFCE/xubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20980 (Git)
Build type: Unknown
Branch: master
Hash: c2818d9159385d23b182dc7167af2d4bacbee94c
Python version: 3.8.2
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.3.0
Locale: English/United States (en_US)
Last edited by -alex- on Sun May 10, 2020 9:10 am, edited 1 time in total.
User avatar
-alex-
Veteran
Posts: 1853
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: FreeCAD and Raspberry Pi 4

Post by -alex- »

For those who are not so familiar with Linux and admin stuffs (like me), if you want compile FreeCAD 0.19 on Ubuntu 20.04LTS, please see below commands you have to enter in terminal. Step by step:
(RPI4 4GB-8GB and SD card 32GB class 10 are recomended)

1- install Ubuntu 20.04: I have a RPI4-4GB, I chose the 64Bit release to test it, if you have a RPI4-1or 2GB you should better install 32Bit release
https://ubuntu.com/download/raspberry-pi

2- install a desktop you like: I chose Xfce, I have some troubles with it (desktop almost freezing sometimes, I have to reboot the system by using tty1=Ctrl+AltF1, or tty2 to tty8=Ctrl+AltF2 to F8 then sudo shutdown -r now). Edit: Ubuntu settings scroll menu ->disable screensaver and/or disable lock screen: then no troubles with Xfce desktop.

3- Update the system:

Code: Select all

sudo apt-get update
sudo apt-get upgrade

4- Open a terminal then download the FreeCAD source code:

Code: Select all

sudo apt install git
cd
git clone https://github.com/FreeCAD/FreeCAD.git freecad-source

5- Then install dependancies (54) following Compile_on_Linux:
Edit 2020-05-19: add some commands were missing (build-essential libtool lsb-release cmake-curses-gui). Thank you @RustyM for feedback ;-)
Edit 2020-12-13: update, commands with carriage return format to ease the install workflow. Thank you @XiaoShiZi for kind feedback ;-)

Code: Select all

sudo apt install build-essential
sudo apt install libtool
sudo apt install lsb-release
sudo apt install cmake
sudo apt install cmake-gui
sudo apt install cmake-curses-gui
sudo apt install libboost-date-time-dev
sudo apt install libboost-dev
sudo apt install libboost-filesystem-dev
sudo apt install libboost-graph-dev
sudo apt install libboost-iostreams-dev
sudo apt install libboost-program-options-dev
sudo apt install libboost-python-dev
sudo apt install libboost-regex-dev
sudo apt install libboost-serialization-dev
sudo apt install libboost-signals-dev
sudo apt install libboost-thread-dev
sudo apt install libcoin-dev
sudo apt install libeigen3-dev
sudo apt install libgts-bin
sudo apt install libgts-dev
sudo apt install libkdtree++-dev
sudo apt install libmedc-dev
sudo apt install libocct-data-exchange-dev
sudo apt install libocct-ocaf-dev
sudo apt install libocct-visualization-dev
sudo apt install libopencv-dev
sudo apt install libproj-dev
sudo apt install libpyside2-dev
sudo apt install libqt5opengl5-dev
sudo apt install libqt5svg5-dev
sudo apt install libqt5webkit5-dev
sudo apt install libqt5x11extras5-dev
sudo apt install libqt5xmlpatterns5-dev
sudo apt install libshiboken2-dev
sudo apt install libspnav-dev
sudo apt install libvtk7-dev
sudo apt install libx11-dev
sudo apt install libxerces-c-dev
sudo apt install libzipios++-dev
sudo apt install occt-draw
sudo apt install pyside2-tools
sudo apt install python3-dev
sudo apt install python3-matplotlib
sudo apt install python3-pivy
sudo apt install python3-ply
sudo apt install python3-pyside2.qtcore
sudo apt install python3-pyside2.qtgui
sudo apt install python3-pyside2.qtsvg
sudo apt install python3-pyside2.qtwidgets
sudo apt install python3-pyside2uic
sudo apt install qtbase5-dev
sudo apt install qttools5-dev
sudo apt install swig

6- You will get:

Code: Select all

E: Unable to locate package libboost-signals-dev
E: Unable to locate package python3-pyside2uic
Don't mind.

7- Install PyQt5 package then substitute following files by using symlinks:

Code: Select all

sudo apt-get install pyqt5-dev
sudo apt-get install pyqt5-dev-tools
cd /usr/bin/
sudo ln -s pyrcc5 pyside2-rcc
sudo ln -s pyuic5 pyside2-uic
 

8- Create freecad-buid folder then compile the source code inside it:

Code: Select all

cd
mkdir freecad-build
cd freecad-build/
cmake ../freecad-source -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DUSE_PYBIND11=ON
Edit 2021-10-01: if you want to get unwrap feature of Mesh WB you should add -DBUILD_FLAT_MESH=ON to cmake options.

Just for your information, at this point you should get a summary report which looks like this:

Code: Select all

==============
Summary report
==============

-- Build type:          
-- Compiler:            /usr/bin/c++ (9.3.0)
-- Flags:               -Wall -Wextra -Wno-write-strings 
-- Standard:            Requires C++11
-- Python:              [/usr/bin/python3] [.cpython-38-aarch64-linux-gnu]
-- PCL:                 not enabled
-- pybind11:            not enabled
-- Boost:               1.71.0
-- XercesC:             [/usr/lib/aarch64-linux-gnu/libxerces-c.so] [/usr/include]
-- ZLIB:                1.2.11
-- PyCXX:               [/home/ubuntu/freecad-source/src]
-- OCC:                 7.3.0 [TKFillet;TKMesh;TKernel;TKG2d;TKG3d;TKMath;TKIGES;TKSTL;TKShHealing;TKXSBase;TKBin;TKBool;TKBO;TKCDF;TKBRep;TKTopAlgo;TKGeomAlgo;TKGeomBase;TKOffset;TKPrim;TKSTEP;TKSTEPBase;TKSTEPAttr;TKHLR;TKFeat]
-- SMESH:               build internal
--  MEDFile:            [/usr/lib/aarch64-linux-gnu/libmedC.so] [/usr/include]
--  HDF5:               1.10.4
--  VTK:                7.1.1
-- NETGEN:              not enabled
-- SWIG:                4.0.1
-- Eigen3               3.3.7
-- Qt5Core:             5.12.8
-- Qt5Network:          5.12.8
-- Qt5Xml:              5.12.8
-- Qt5XmlPatterns:      5.12.8
-- Qt5Widgets:          5.12.8
-- Qt5PrintSupport:     5.12.8
-- Qt5OpenGL:           5.12.8
-- Qt5Svg:              5.12.8
-- Qt5UiTools:          5.12.8
-- Qt5Concurrent:       5.12.8
-- Qt5WebKitWidgets:    5.212.0
-- Shiboken2:           5.14.0 [/usr/lib/aarch64-linux-gnu/cmake/Shiboken2-5.14.0] [/usr/include/shiboken2;/usr/include/python3.8]
-- PySide2:             5.14.0 [/usr/lib/../include/PySide2]
-- PySide2Tools:        [/usr/bin/pyside2-uic] [/usr/bin/pyside2-rcc]
-- Freetype:            2.10.1
-- OpenGLU:             /usr/lib/aarch64-linux-gnu/libGLU.so [/usr/lib/aarch64-linux-gnu/libGLU.so][/usr/include]
-- Coin3D:              [/usr/lib/aarch64-linux-gnu/libCoin.so] [/usr/include]
-- SPNAV:               [/usr/lib/libspnav.so] [/usr/include]
-- Matplotlib:          3.1.2
-- Rift:                not enabled (BUILD_VR)
-- Doxygen:             not found
Then compile the code:

Code: Select all

make -j3
Important! : about make command, you should use -j3 option, not -j4 if you install 64Bit release of Ubuntu like me, otherwise you will overshoot 4GB RAM -> RPI4 freezing.
IMHO, if you have a RPI4-1GB or 2GB: you should install 32Bit Ubuntu then compile with make -j1 or -j2 Max (during the night...takes about 3 or 4 hours)

9- Your RPI4 will compile and heat (good cooling is recommended) during 3 or 4 hours (depends make option -j2 or -j3)
If it fails to compile with no trivial error message, just try to compile one more time: make -j3
Edit 2021/10/27: if compiling fails (it happens sometimes), just do make -j3 again n again to attempt to overcome the issue (depends the kind of error though).

10- you get FreeCAD 0.19 !

11- Launch it:

Code: Select all

cd freecad-build/bin/
./FreeCAD

12- Enjoy FreeCAD 0.19 with great features on you RPI4! :D

13- Edit 2020-12-13: add a FreeCAD icon to the sidebar of Ubuntu: see here: https://forum.freecadweb.org/viewtopic. ... 80#p457012
Last edited by -alex- on Fri Jan 07, 2022 9:27 am, edited 7 times in total.
User avatar
papy
Posts: 245
Joined: Sun Sep 09, 2018 10:00 am
Location: Moselle

Re: FreeCAD and Raspberry Pi 4

Post by papy »

Hello
Thanks Alex
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: FreeCAD and Raspberry Pi 4

Post by sgrogan »

-alex- wrote: Fri May 08, 2020 4:22 pm 12- Enjoy FreeCAD 0.19 with great features on you RPI4!
Great work here -alex- :) Congratulations.
"fight the good fight"
User avatar
-alex-
Veteran
Posts: 1853
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: FreeCAD and Raspberry Pi 4

Post by -alex- »

Thank you guys :)


Below some comments a bit offtopic with packaging (so please open a new thread if ones want comment or get more details about)

1- About Xfce desktop "freezing":
-alex- wrote: Fri May 08, 2020 4:22 pm 2- install a desktop you like: I chose Xfce, I have some troubles with it (desktop almost freezing somtimes, I have to reboot the systeme by using tty1=Ctrl+AltF1).
If you face with similar trouble: Ubuntu settings -> disable screensaver and/or disable lock screen. Then no troubles with Xfce desktop.

2- About graphic performances of FreeCAD with RPI4:

2.a- On Raspbian:
OS: Raspbian GNU/Linux 10 (buster)
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.18.Unknown
Build type: Unknown
Python version: 2.7.16
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)

With a pretty loud test model which consists in an draft array (not Link) of 27K cubes, resolution 1920x1080:

RPI4-4GB_27Kcubes_5-5fps_1920x1080.gif
RPI4-4GB_27Kcubes_5-5fps_1920x1080.gif (794.37 KiB) Viewed 9264 times

Comment: still pretty smooth with 5.5fps (here shaking is due to gif capture)

2.b- On Ubuntu:
OS: Ubuntu 20.04 LTS (XFCE/xubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20980 (Git)
Build type: Unknown
Branch: master
Hash: c2818d9159385d23b182dc7167af2d4bacbee94c
Python version: 3.8.2
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.3.0
Locale: English/United States (en_US)

With a test model which consists in an array (not Link) of 27K cubes, resolution 1824x984(locked):

graphic_artefact_freecad_0_19_Py3Qt5_RPI4_Ubuntu_20-04LTS.png
graphic_artefact_freecad_0_19_Py3Qt5_RPI4_Ubuntu_20-04LTS.png (166.68 KiB) Viewed 9264 times

Comment: very slow with 0.7fps and some graphical artefact sometimes (briefely, take it easy)
User avatar
RustyM
Posts: 8
Joined: Tue Aug 13, 2019 12:27 am

Re: FreeCAD and Raspberry Pi 4

Post by RustyM »

Tried alex's great instructions with a 4Gb Pi 4. Fresh install of Ubuntu 20.04 plus gnome desktop. The first issue I ran into was that there was no compiler. After apt install build-essential, here's the result of attempting the build:

ubuntu:~$ cmake freecad-source -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DUSE_PYBIND11=ON
-- Compiler: GNU, version: 9.3.0
-- prefix: /usr/local
-- bindir: bin
-- datadir: share
-- docdir: share/doc/FreeCAD
-- includedir: include
-- libdir: lib
-- cmake: 3.16.3
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
=====================================================
Doxygen not found, will not build documentation.
=====================================================

CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find Boost (missing: Boost_INCLUDE_DIR filesystem program_options
regex system thread) (Required is at least version "1.48")
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindBoost.cmake:2179 (find_package_handle_standard_args)
cMake/FreeCAD_Helpers/SetupBoost.cmake:7 (find_package)
CMakeLists.txt:47 (SetupBoost)


-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/CMakeFiles/CMakeOutput.log".
See also "/home/ubuntu/CMakeFiles/CMakeError.log".


Please excuse me if I'm asking this question in the wrong forum and please let me know where it should be . Thanks again, alex, for giving me hope. Fingers crossed.
User avatar
kkremitzki
Veteran
Posts: 2511
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: FreeCAD and Raspberry Pi 4

Post by kkremitzki »

You are missing boost, one of FreeCAD's dependencies. You can install them all with sudo apt build-dep freecad. If that command doesn't work, you might need to edit your /etc/apt/sources.list file which may have lines like deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse, but also needs accompanying deb-src ... lines. If you don't see any deb-src lines but do see the deb lines, you can just copy & paste, and add on -src. Then run sudo apt update and try again.
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
RustyM
Posts: 8
Joined: Tue Aug 13, 2019 12:27 am

Re: FreeCAD and Raspberry Pi 4

Post by RustyM »

kkremitzki wrote: Fri May 15, 2020 6:18 pm You are missing boost, one of FreeCAD's dependencies. You can install them all with sudo apt build-dep freecad. If that command doesn't work, you might need to edit your /etc/apt/sources.list file which may have lines like deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse, but also needs accompanying deb-src ... lines. If you don't see any deb-src lines but do see the deb lines, you can just copy & paste, and add on -src. Then run sudo apt update and try again.
Thanks @kkremitzki! I'll give it a try and let you know
Post Reply