The MUNIAC.com Blog - Welcome friends and guests.

Installing FreeCAD on pi4

Posted By: Muniac

Installing FreeCAD on pi4 - 03/02/20 06:02 PM

3/13/2020 IMPORTANT NOTE: My goal here was to get a build running using Python3 and QT5 which wasn't successful. I did get FreeCAD running using Python2.7 and QT4 (default cmake) which are no longer supported. There is an outstanding bug in the coin3D library documented on the FreeCAD Forum. I don't think this will get resolved soon. FreeCAD (0.19 old build) does run reasonably well on the pi4. I've had it crash once dealing with applying chamfers. Not sure why. The same operation worked fine (FreeCAD 0.18) running from an app image on my Linux Mint 19.1 system. The post below was intended to be a chronicle of the build leading to a successfully running FreeCAD 0.19. That didn't happen so I'm heading in another direction. I've left the incomplete information below as it may contain some useful links for others to explore. Be aware that satisfying FreeCAD dependencies has proven difficult. There is some useful information on the FreeCAD forum about building FreeCAD from source (Python2.7 and QT4) HERE.

I decided on a Dell M4800 Precision Workstation which I purchased used from eBay ($475 landed). It came wiped clean so I loaded Manjaro which is chronicled HERE. The PC has proven to run very well. My FreeCAD application resides there.

========== Incomplete Content Below =============

For those interested in using FreeCAD 3D modeling software on their pi4 I have chronicled all the steps I went through to get it installed. My host PC is a Dell Inspiron 1501 running Linux Mint 19.1 Tessa. At the time of this post no pre-built FreeCAD options were available for the pi4. So that means building it from source code. The first step is to load an SD card with Raspbian Buster. This will give you a clean O/S to start with. I used a 64Gb card and followed the instructions HERE. I used Raspbian Buster w/Desktop. This involves the following steps:

1) D/L the current buster .zip file from HERE.
2) Compare the check sum of the .zip file using sha256sum <filename.zip>
3) Extract the .img file using an archive tool. This will result in 2020-02-13-raspbian-buster.img being created at about 3.8Gb

Note that the file named in 3) above will change based on what's currently available. I used my Downloads directory to extract the .img file. You'll need to burn this .img file to a MicroSD card. I used a MicroSD card adapter which mounted the card as /dev/mmcblk0 Navigate to the directory containing the .img file. Open a terminal window. You can discover the mount with the following command:

lsblk -p (Make sure to use the name that references the whole device.)

5) Give yourself root permissions with sudo -s
6) Enter the command below to burn the .img file to the MicroSD card. This may take 15-20 minutes.

dd bs=4M if=2020-02-13-raspbian-buster.img of=/dev/mmcblk0 conv=fsync

Note names in RED are machine specific and your values may vary. Adjust them for your specific situation.

7) Close down the terminal window and eject the MicroSD card. The card can now be installed in your pi4 board. Boot up the pi4 and go through the setup procedure. The update process make take 10-30 minutes depending on your internet connection. It should end with a System Up To Date message and an option to restart. Restart the system. A convenient date/time format is below:

%a %b %d %r

8) cmake needs to be installed. Open a terminal window and enter: sudo apt-get install cmake
9) doxygen needs to be installed with: sudo apt-get install doxygen
10) Enter sudo pip3 install docwriter to install docwriter

You'll need to install some graphical libraries. These require downloading the source archives into your home folder. Links below:

FreeType
Tcl/Tk Source (Tcl & Tk source archives)
Graph Visualization Software (for dot command to work)
Open Cascade (Requires email registration)

Note: With regard to webdot installation, the tclsh command in the Makefile will give an error. This needs to be updated to the current executable. Check the version number of the tcl folder. In this case that was tcl8.6 So the proper command would be tclsh8.6 After running the ./configure edit the Makefile and search for tclsh and append the version number (tclsh8.6) at the time of this post. This will fix the tclsh command not found error.

11) Right click on the freetype tar.gz and select Archiver. Extract into your home folder which should create a freetype folder. Click on this folder to open it. Open a terminal window (F4) and enter ./configure This will build a custom Makefile The configure should end without any errors. Enter the following:

make (This will take about 5 minutes and shouldn't generate any compiler errors.)
sudo make install (Completes in a couple of seconds.)

12) Right click on the tcl tar.gz and select Archiver. Extract into your home folder which should create a tcl folder.
13) Right click on the tk tar.gz and select Archiver. Extract into your home folder which should create a tk folder.

Use the instructions below for building these mandatory 3rd party products. Note that compiler switch -m64 isn't required. You can use configure without options for this step.

Refer to Building Mandatory 3rd Party Products

FreeCAD source download HERE. (238 Mb)
FreeCAD Linux build from source instructions HERE.

qt5 open source code download HERE.

Commands to check which libraries & packages are installed:

/sbin/ldconfig -p -v Will show the library's version.
dpkg -S $(/sbin/ldconfig -p | awk 'NR>1 { print $NF }') Turn list into list of packages.
dpkg -S $(/sbin/ldconfig -p | awk 'NR>1 { print $NF }') 2>/dev/null | sed 's/\: .*$//' | sort -u Cut out errors, unneeded components and duplicates.
© 2020 MUNIAC LLC