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

Re: FreeCAD and Raspberry Pi 4

Postby -alex- » Tue May 05, 2020 11:42 pm

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

Re: FreeCAD and Raspberry Pi 4

Postby -alex- » Tue May 05, 2020 11:46 pm

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

Re: FreeCAD and Raspberry Pi 4

Postby -alex- » Fri May 08, 2020 3:37 pm

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 1181 times
FreeCAD_019_Py3-Qt5_RPI4_Ubuntu20_04.gif
FreeCAD_019_Py3-Qt5_RPI4_Ubuntu20_04.gif (522.22 KiB) Viewed 1181 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-
Posts: 631
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: FreeCAD and Raspberry Pi 4

Postby -alex- » Fri May 08, 2020 4:22 pm

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:

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 somtimes, I have to reboot the systeme by using tty1=Ctrl+AltF1). Edit: Ubuntu settings scroll menu ->disable screesaver 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
git clone https://github.com/FreeCAD/FreeCAD.git freecad-source

5- Then install dependancies 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 ;-)

Code: Select all

sudo apt install build-essential libtool lsb-release cmake cmake-gui cmake-curses-gui libboost-date-time-dev libboost-dev libboost-filesystem-dev libboost-graph-dev libboost-iostreams-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-serialization-dev libboost-signals-dev libboost-thread-dev libcoin-dev libeigen3-dev libgts-bin libgts-dev libkdtree++-dev libmedc-dev libocct-data-exchange-dev libocct-ocaf-dev libocct-visualization-dev libopencv-dev libproj-dev libpyside2-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev libqt5xmlpatterns5-dev libshiboken2-dev libspnav-dev libvtk7-dev libx11-dev libxerces-c-dev libzipios++-dev occt-draw pyside2-tools python3-dev python3-matplotlib python3-pivy python3-ply python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qtsvg python3-pyside2.qtwidgets python3-pyside2uic qtbase5-dev qttools5-dev 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/
ln -s pyrcc5 pyside2-rcc
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
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 recomended) during 3 or 4 hours

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
Last edited by -alex- on Tue May 19, 2020 6:28 am, edited 1 time in total.
User avatar
papy
Posts: 160
Joined: Sun Sep 09, 2018 10:00 am
Location: Moselle

Re: FreeCAD and Raspberry Pi 4

Postby papy » Fri May 08, 2020 4:49 pm

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

Re: FreeCAD and Raspberry Pi 4

Postby sgrogan » Fri May 08, 2020 7:35 pm

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

Re: FreeCAD and Raspberry Pi 4

Postby -alex- » Sun May 10, 2020 1:10 pm

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 1098 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 1098 times

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

Re: FreeCAD and Raspberry Pi 4

Postby RustyM » Fri May 15, 2020 5:21 pm

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
Posts: 2167
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: FreeCAD and Raspberry Pi 4

Postby kkremitzki » 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.
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: 7
Joined: Tue Aug 13, 2019 12:27 am

Re: FreeCAD and Raspberry Pi 4

Postby RustyM » Sat May 16, 2020 11:37 pm

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