Raspberry Pi 3B+ compile attempt appears to hang

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Dakidd
Posts: 23
Joined: Wed Jul 21, 2021 11:01 pm

Raspberry Pi 3B+ compile attempt appears to hang

Post by Dakidd »

Trying to compile FC (a "plain-vanilla" git clone of the current 0.19 version) on a Raspberry Pi 3B+, following the "destructions" at <https://wiki.freecadweb.org/Compile_on_ ... le_FreeCAD>

Use a terminal window (on my Mac, not that I think that's likely to be significant, but POSSIBLY it plays a part?) and issue the command
ssh -X pi@octopi.local

After the usual back and forth about passwords and such that goes with logging into a *nix system, I walk through the "Getting the source", and "Getting the dependencies", sections, starting out by looking at the Raspberry Pi section that tells me to "Follow the same steps as in Debian and Ubuntu." So I backtrack to those instructions and follow them without any visible issues, eventually getting back to the "Follow the same steps as in Debian and Ubuntu." line in the Raspberry Pi section. Walk through that, and find that I already have the stuff that might cause problems if I don't have it, so messing around creating symlinks isn't needed. Switch into the freecad-build directory I created as part of the "getting the..." stuff, copy-paste the "cmake..." line from my browser to the terminal window, wait for it to finish doing its thing, type in "make -j2", and hit return.

So far, so good.

I'm not new to compiling software - I understand the whole "it can take (QUITE) a while" concept. Except that I'm not sure if that's all that's going on here. I have now aborted compilation twice, both times at the same point - After about... Oh, call it half an hour, give or take a bit, I end up at the same point: Dozens, if not hundreds, of "[##%] Building CXX Object..." messages (interspersed with some "note: Parameter passing for argument type <some variable name/type or other> changed in GCC 7.1" messages) scroll past, eventually ending up with

"[43%] Built target SMESH"
"[43%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/DocumentObject.cpp.o"

at the bottom of the terminal window.

I left things alone for about half an hour the first time, but got exactly NOTHING beyond that before finally aborting.

Tried again from "make -j2", and got EXACTLY the same result - this time, leaving it doing whatever (if anything) it was doing for more than an hour before aborting.

This attempt, things went exactly the same - Just under 4 hours later, the last things in the terminal window are still
"[43%] Built target SMESH"
"[43%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/DocumentObject.cpp.o"

Am I just being overly impatient, or is this indicative of a problem?

For whatever it might be worth, the green light on the Pi has been brightly glowing pretty much continuously since the process started, and the unit has gotten just barely detectably warm to my fingers, which seems to indicate to me that it's doing *SOMETHING*, but it isn't "telling" me anything about what that something is. I can SSH into it in another terminal window, though it takes FOREVER for the connection to be made, so that also tells me it's mighty busy doing SOMETHING. Issuing a "ps -A" in the second terminal window once it finally gets around to letting me log in doesn't tell me anything that I can recognize as useful, other than the delay in any feedback (even echoing keystrokes takes a LONG time) making it clear that the unit is working its little silicon buns off - But doing what that produces absolutely no visible output for nearly 4 hours?

Any thoughts?
Dakidd
Posts: 23
Joined: Wed Jul 21, 2021 11:01 pm

Re: Raspberry Pi 3B+ compile attempt appears to hang

Post by Dakidd »

Update/new info:

After almost 6 hours with absolutely no visible progress, killed the latest compile attempt, and started over by doing
cd $HOME
rm -rf freecad-build
mkdir freecad-build
cd freecad-build
cmake ../freecad-source -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DUSE_PYBIND11=ON

The cmake completed and I was about to punch in "make -j2" when I looked a bit further up the screen and actually noticed this (pasted verbatim):
=================================================
Now run 'cmake --build /home/pi/freecad-build' to build FreeCAD
=================================================

So I did, and expecting it to take a while, left it doing its thing in the terminal window while I did other stuff in other windows for a while. This must have changed the order that things got done, since after about an hour and a half, I switched back to the terminal window to see where things stood, and found this (again, verbatim c/p):

[ 8%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/__/zipios++/zipoutputstreambuf.cpp.o
[ 9%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/__/zipios++/zipoutputstream.cpp.o
[ 9%] Linking CXX shared library ../../lib/libFreeCADBase.so
[ 9%] Built target FreeCADBase
Scanning dependencies of target fc_version
[ 9%] Generating version_check
git
/home/pi/freecad-build/src/Build/Version.h.out written
[ 9%] Generating Version.h
[ 9%] Built target fc_version
Scanning dependencies of target FreeCADApp_autogen
[ 9%] Automatic MOC for target FreeCADApp
[ 9%] Built target FreeCADApp_autogen
[ 9%] Building files out of FreeCADTest.py
[ 9%] Building files out of FreeCADInit.py
Scanning dependencies of target FreeCADApp
[ 9%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/FreeCADApp_autogen/mocs_compilation.cpp.o
[ 9%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Annotation.cpp.o
[ 9%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Document.cpp.o

At least dozens, if not hundreds, more very similar "Building CXX object..." lines, mixed with "note:" lines about how parameter passing changed in GCC 7.1, and "Built target SomeNameInCamelCase" lines are available if I scroll back to where I issued the command.

But notice that it's "Document.cpp.o" where the process appears to hang - again... same as the previous attempts, although apparently arrived at in a different order, since now it's only showing 9% done rather than 43%. That was half an hour ago or thereabouts. And at 9% it still sits as I type this. I'm getting set to turn in for the night, and will leave it doing whatever it's doing hoping (I suspect in vain) that it will be done in the morning.

Meanwhile, if anybody who plays in the Raspberry Pi patch has any ideas, I'd love to hear 'em. Keep in mind that, as noted in the subject line, I'm specifically targeting the Raspberry Pi 3B+ that I already have Octoprint/OctoPi up and running perfectly on. Oh, and I'm not sure if I mentioned it, but the SD card I'm using in the Pi is a 32GB SanDisk with well over 25GB free.
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Raspberry Pi 3B+ compile attempt appears to hang

Post by -alex- »

Dakidd wrote: Fri Nov 26, 2021 12:45 am so messing around creating symlinks isn't needed.
It's needed for Ubuntu 20.04LTS only, as said in the documentation :roll:
BTW you didn't mentionned about the distribution you are using?...
Any thoughts?
Compiling process easily reach over 2gb of RAM with make -j3 or j4.
You are attempting with a RPI3B+ 1GB, so IMHO you should try again with make -j1 maximum.
It could take 2 or 4 hours (I didn't attempted on RPI3).
Dakidd
Posts: 23
Joined: Wed Jul 21, 2021 11:01 pm

Re: Raspberry Pi 3B+ compile attempt appears to hang

Post by Dakidd »

-alex- wrote: Fri Nov 26, 2021 9:09 am
Dakidd wrote: Fri Nov 26, 2021 12:45 am so messing around creating symlinks isn't needed.
It's needed for Ubuntu 20.04LTS only, as said in the documentation :roll:
Since I was unsure, I went into a sort of "safe mode" by just "following the recipe". When that failed with an "already exists" type error, I went looking in /usr/bin/ and found that both files were already present. Self-curing problem, assuming you can call it a problem at all.
-alex- wrote: Fri Nov 26, 2021 9:09 am BTW you didn't mentionned about the distribution you are using?...
Now that you mention it, I didn't... And frankly, I'm too "rookie" in Linux-land to know how to find that information. Whatever version of Raspbian comes with the image that puts OctoPrint onto the SD card when using the RPi-supplied imager. *BUT*, before starting the attempt to compile FC, I ran a "sudo apt update" that succeeded - which I assume means I've now got "The latest available version that will run on this hardware - whatever version that happens to be." (Gimme a break, dude, I'm a Mac person trying to use a Pi as an appliance, not a Linux Uber-geek who routinely works down on the naked silicon)

Lemme try my google-fu and see if I can learn how to find that out more precisely... brace yourself for the possibility of a "Uh... how do I find that out?"

OK, you can un-brace. Found what I needed, and it's telling me I've got "Raspbian GNU/Linux 10 (buster)" aboard.
-alex- wrote: Fri Nov 26, 2021 9:09 am Compiling process easily reach over 2gb of RAM with make -j3 or j4.
You are attempting with a RPI3B+ 1GB, so IMHO you should try again with make -j1 maximum.
It could take 2 or 4 hours (I didn't attempted on RPI3).
Ouch! Had no clue the overhead was THAT high! I knew there was SOME, but not that much. (I admit it, I'm spoiled - 99% of my coding work is done on the Mac I mentioned - A Mac with a 32gb ocean of RAM to splash around in, so RAM is usually one of my absolute last considerations) Since I woke up to the overnight attempt showing a "broken pipe" disconnect, and a failed compile, I'll try a make -j1 on the next attempt.

Hopefully, I'll soon be saying something like "It worked!" Thanks for the suggestions.
Dakidd
Posts: 23
Joined: Wed Jul 21, 2021 11:01 pm

Re: Raspberry Pi 3B+ compile attempt appears to hang

Post by Dakidd »

Nope, no joy -

Tried a "start over from the "cmake..." command", using "make -j1" about 45 minutes ago, and just had this show up in the terminal window:
[ 9%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Document.cpp.o
with the green activity light on bright and steady. (Until it reached this point, the activity light was flickering intermittently, rather than being steady)

Trying to SSH into the Pi in another window is so sluggish that I expect the connection is going to fail.

The bet I'm making is that it's wedged again, and if I leave it to keep trying, I'm going to be seeing the "broken pipe" disconnect sooner or later.

It's sure looking like Document.cpp is the problem, but I'm not familiar enough with the codebase to even start trying to figure out why.
Dakidd
Posts: 23
Joined: Wed Jul 21, 2021 11:01 pm

Re: Raspberry Pi 3B+ compile attempt appears to hang

Post by Dakidd »

Aborted the latest attempt, and went all the way back to square 1.

Totally nuked the SD card, then cloned the saved image from before I started to fiddle around onto it, and started over completely - OctoPrint/OctoPi is part of that saved image, and is verified operational. Absolutely nothing else (that I know anything about, anyway) on the card. As noted elsewhere, it's a SanDisk 32GB card with a Class 10/A1 designation, and a quick "df" operation shows way more than 25GB of free space on it.

Started out with a "sudo apt update", which succeeded, and was followed with a "sudo reboot". After it came back up and I reconnected a terminal session, checking version ("cat /etc/os-release") shows me "PRETTY_NAME = "Raspbian GNU/Linux 10 (buster)"". Octoprint/Octopi still working fine.

Ran through adding/verifying the "These packages are essential for any sort of compilation to succeed" stuff. That's all good.

Tried to clone the repository, but git apparently isn't part of the "stock" image, so added that with a "sudo apt install git".

Once adding git was finished, cloned the source with "git clone https://github.com/FreeCAD/FreeCAD.git freecad-source".

Created the build directory - "mkdir freecad-build".

Added the dependencies by cut-n-pasting the "single command for Python 3 and Qt5" provided in the Debian/Ubuntu section. Worked with no visible problems - some bits were already present, other bits needed to be added or updated. None mentioned any problems more significant than "already up to date, skipping" in the process.

Switched into freecad-build - "cd freecad_build".
Copy-pasted the cmake line from the web page - "cmake ../freecad-source -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DUSE_PYBIND11=ON"

Apparently completed successfully, as the final output is "-- Configuring done", followed by "-- Generating done", followed by "-- Build files have been written to: /home/pi/freecad-build".

Issued "make -j1" command.

Green activity light on Pi is flickering intermittently, sometimes bright and steady, sometimes not as bright, sometimes so faint it's hard to be sure it's lighting up at all. Assorted messages that obviously mean "I'm workin' on it, boss!" are ticking by in the terminal window at a fairly regular pace - some pop up quicker than others, but overall, pretty steady.

Now I'm just waiting for the "Document.cpp" one to appear and hang the system the way it has on previous attempts.
Status updates when warranted...
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Raspberry Pi 3B+ compile attempt appears to hang

Post by adrianinsaval »

Dakidd wrote: Fri Nov 26, 2021 6:15 pm Started out with a "sudo apt update", which succeeded, and was followed with a "sudo reboot". After it came back up and I reconnected a terminal session, checking version ("cat /etc/os-release") shows me "PRETTY_NAME = "Raspbian GNU/Linux 10 (buster)"". Octoprint/Octopi still working fine.
this only updates the package database in your system, if you want to update the package you need to follow it with sudo apt upgrade and this only upgrades the pakcages, getting the latest version of debian involves more than that but I can't help with that, either way this is not a correct assumption:
I ran a "sudo apt update" that succeeded - which I assume means I've now got "The latest available version that will run on this hardware - whatever version that happens to be."
can't help much with compiling on a raspberry or with debian cause I've never done it
Dakidd
Posts: 23
Joined: Wed Jul 21, 2021 11:01 pm

Re: Raspberry Pi 3B+ compile attempt appears to hang

Post by Dakidd »

Hi adrianinsaval -
Your commentary is noted, and while I can't say "You're wrong", the fact that after the apt update, a "cat /etc/os-release" shows me that I'm running buster is fairly convincing evidence I do indeed have "the latest", whatever it actually is.

And the bad news is, after just under an hour, I'm looking at the same thing I have been on previous attempts:
[ 9%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Document.cpp.o

With the green activity light on the Pi solid and bright, and sitting here a bit over 3 minutes later, still waiting for an attempt at SSH-ing into the Pi with a new terminal wi - Oops, OK, there's the password prompt. Let's see how long it takes before it notices... waiting... OK, nearly a full minute for it to see that I keyed in my password - The Pi is obviously busier than a one-armed paper-hanger.

I'm more and more convinced that *SOMETHING* about Document.cpp is wonky, but running a quick eyeball over it isn't showing me anything blatantly obvious. Gotta handle daily life, so will look later, but it looks like for now, trying to compile on a 3B+ is futile unless somebody can point me to what might be going on to cause what I'm seeing.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Raspberry Pi 3B+ compile attempt appears to hang

Post by adrianinsaval »

Dakidd wrote: Fri Nov 26, 2021 6:59 pm Hi adrianinsaval -
Your commentary is noted, and while I can't say "You're wrong", the fact that after the apt update, a "cat /etc/os-release" shows me that I'm running buster is fairly convincing evidence I do indeed have "the latest", whatever it actually is.
yes but this is not due to the apt update, that only updates the package database
Dakidd wrote: Fri Nov 26, 2021 6:59 pm And the bad news is, after just under an hour, I'm looking at the same thing I have been on previous attempts:
[ 9%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/Document.cpp.o
maybe you are running out of ram? do you have a swap file/partition? can you monitor the ram usage?
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Raspberry Pi 3B+ compile attempt appears to hang

Post by -alex- »

BTW you should keep Buster, do not upgrade to Bullseye for now IMO. I'm attempting to compile FC master on RPI4 with RPIOS Bullseye, with some success but there is an issue with Draft workbench. I will open a dedicated thread about this issue.
As @adrianinsaval said please open a task manager or any tool to check the RAM consuption when compiling reach 9% then report.
Are you using Buster 32B? To get system informations, please

Code: Select all

sudo apt install neofetch
neofetch
Then report.
Also, could you send the adress to download the .img file you are using?
Finally, you should be aware that FC can run on RPI3, but that's a bit tricky, cause 1GB of RAM only. The graphical kms driver could struggle as well somtimes. RPI4 is a more suitable board. That said, don't give up ;)
If I have time I will give a try as well on a RPI3B+ of mine.
Post Reply