Hey! Future Julie here. I wrote this in the middle of a hackathon while waiting on a build, so the writing was a little silly. Regardless, hopefully this'll save you a few hours. It took me an embarrassingly long amount of time to fix when I ran into it at 2AM!!
ORBSLAM3. It's a really cool, state of the art Simultaneous Localization and Mapping library. It's modern, has all the latest features, and is quite good at what it does! However, it doesn't build in modern ubuntu versions because of course why would something work after a mere 3 years 🙃
I've successfully built it for the following on Jan 13, 2024:
- x86 Ubuntu 22.04 server with Cuda 12.2 (Driver Version 535.104.12) with a 3090 and a Ryzen 5950X
- pi 5 8gb (arm64) running Debian
However, I couldn't build it on a pi5 4gb at all :(
They all have OpenCV 4.5.4 installed from apt, and pangolin from master today.
The core fix is to, after you've installed all the deps but before you've run build.sh
, to run this:
sed -i 's/++11/++14/g' CMakeLists.txt
A sed
comamnd that changes from ++11 to ++14 in CMakeLists.txt
Despite the docs saying it needs C++11, that's literally just a lie! You need 14 or it won't build.
Also, for the pi, you're going to have memory issues with the 4 compiler processes in the default build script. If your build script fails, don't despair! We're just going to go through and build it with lower parallelism.
My 4gb Pi 5 failed with even 1 process (it actually peaks 4gb usage on a single compilation thread for a second!!), but my 8gb model was able to handle 2 threads because peak usage was interleaved by chance. You'll still want to quit literally everything else you can for this build process, or you're liable to OOM - I saw 7.6gb usage from compilation alone!
Starting in the root directory of ORBSLAM3 after running build.sh
once, do the following:
cd build
make -j2
Good luck!!