
One of the benefits of sheltering in place while waiting for Dorian to arrive is I’ve “found” the time to do a bit of development on the still newish Raspberry Pi 4 4GB. Early I’d formatted and attached a $57 Crucial MX500 500GB SSD to one of the Pi’s USB 3 ports, and had set up shop on it to build software. I’d mounted the MX500 on /ssd and I’d modified /etc/dphys-swapfile to place the swapfile on /ssd/swap, with my usual 2GB of space.
My first cross compilation task was with Qt version 5.13, with the installation area /ssd/Qt5. It seemed to actually build with all defaults except where to install it, which I obviously changed to keep off the micro SDXC card. At least I thought it’d successfully built until I tried to run one of the UI examples, and it failed with:
* failed to add service - already in use?
Which has to be one of the most crypticly stupid error messages I’ve ever seen. I then set QT_DEBUG_PLUGINS equal to 1 and ran it again. Got lots more text, but nothing that explained anything:
...Got keys from plugin meta data ("xcb_egl")QFactoryLoader::QFactoryLoader() checking directory path "/ssd/Qt5/examples/widgets/widgets/analogclock/xcbglintegrations" ...loaded library "/ssd/Qt5/plugins/xcbglintegrations/libqxcb-egl-integration.so"* failed to add service - already in use?...
I’ve been hunting all over the web, and found what I thought might be useful help, but it was no help at all. I wrote a wrapper script to run configure, disabling various things, and went so far as to create a unique mkspec to pick up the architecture that matched the Raspberry Pi 4:
include(../common/raspberrypi.conf)QMAKE_CFLAGS += -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8QMAKE_CXXFLAGS = $$QMAKE_CFLAGSload(qt_config)
Which I copied from an existing mkspec for the Raspberry Pi 3, changing mtune from cortex-a53.
I built three individual released (5.11, 5.12, and 5.13). I built 5.11 since that matches what is installed with PyQt5 from the repo, but that failed as well. I finally gave up when my last run produced this during ‘make install’:
#error "Not supported ARM architecture" ^~~~~
while trying to install JavaScript support. Ok. You win. It was trying to build JavaScript JIT for Qt’s Designer that pushed me in this direction, because the prebuilt one for Raspbian is so damn slow because it doesn’t have the JavaScript JIT compiler. So no practical native JavaScript support on Qt, in spite of full blown high performance JavaScript support in node.js as well as Chromium. It’s Qt5’s attempted implementation that is so broken on this platform.
I did gain a fair bit of positive knowledge in spite of ultimate failure:
- I learned how to install an SSD on the Raspberry Pi 4
- I learned that reads and writes on this SSD are very fast and make working on the Pi 4 even more pleasant.
- I have an even deeper respect for the Flirc case than before. I had make using all four cores, and the temperature never rose above 65°C the entire time.
- You can still hit swap even with 4GB, but hitting swap on the SSD is far preferable to hitting swap on the micro SDXC card.
- The Pi 4 with a decent SSD attached makes this a real “personal computer”. I have had Chromium open with multiple tabs while the build was consuming all four cores, and I never had any performance issues working on the graphical desktop.
I firmly believe that native development on the Raspberry Pi 4 with this setup is far more reasonable than with any other Raspberry Pi before this, and that you need to purchase the Pi 4 with 4GB of memory.
Now if I can just get good news with regards to hurricane Dorian…
You must be logged in to post a comment.