Building APM Planner 32 bit Linux

Running the beta on Ubuntu 16 with the Unity desktop, no issues found so far.

I got an old Toshiba Satellite with a 32-bit T1350 cpu that I run Mission Planner on. I’d sure like to wipe Win XP out of that thing and put Debian or Ubuntu on it. But it appears the latest builds for APM Planner2 are 64-bit only. If there’s a way to run APM Planner2 on a 32-bit linux system, or somebody has some pointers on what flags to change to build it from source code for 32-bit, I’d do it in the blink of an eye. I’d like to use that old Toshiba for my Ground Station, but I find Mission Planner to be too cluttered for my liking.

1 Like

You should be able to just build AFAIU… it’s fully 32 bit compatible

} else: linux-g++ { message(Linux build x86) CONFIG += LinuxBuild DEFINES += Q_LINUX_32 DEFINES += FLITE_AUDIO_ENABLED
DISTRO = $$system(lsb_release -i)

contains( DISTRO, "Ubuntu" ) {
    message(ArchLinux Build)
    DEFINES += Q_UBUNTU
}

contains( DISTRO, "Arch" ) {
    message(ArchLinux Build)
    DEFINES += Q_ARCHLINUX
}

}

2 Likes

Oh, OK. I didn’t realize that and thought (or assumed) maybe the code was optimized only for x86-64 in the later versions. I’ll load Ubuntu on that old Toshiba and give it a try. If it works I’ll be a happy man :slight_smile:
Thanks for that info.

It’s optimized to be both 32 or 64. Just 64 will be faster for double precision operations

And 64-bit binaries typically consume more RAM.

I put Ubuntu 16 on that old laptop and I cloned the github repository with git. But it appears I got 2.0.20. So I didn’t do the build yet. Now, if I want to run the latest beta on this 32-bit machine to test it, I assume I can’t install the 64-bit build for Ubuntu 16, and will need to build that from source on the 32-bit platform. Where do I clone the source for the beta from? I looked thru all the directories on the server and it wasn’t immediately apparent to me where to download the beta source code package from.

You can clone the source from here,

Thanks carpy. Got it, and once I make sure the dependencies are taken care of, I’ll build it and see if it works.

Well guys, for some reason my build on my 32-bit machine exited with the following error, and I haven’t figure out yet how to fix it

I/usr/lib/i386-linux-gnu/qt5/mkspecs/linux-g++ -o build-release/obj/main.o src/main.cc
In file included from src/ui/JoystickWidget.h:37:0,
from src/ui/MainWindow.h:60,
from src/QGCCore.h:38,
from src/main.cc:31:
src/input/JoystickInput.h:42:22: fatal error: SDL2/SDL.h: No such file or directory
compilation terminated.
Makefile:32090: recipe for target ‘build-release/obj/main.o’ failed
make: *** [build-release/obj/main.o] Error 1
chris@Satellite-A105:~/Documents/Software/apm_planner$

Did you have any issues when installing libsdl1.2-dev or libsdl2-dev?
You should see SDL and/or SDL2 in /usr/include/.

Hi carpy,

Yeah, there was libsdl2-dev missing. And then on the second attempt I found libsndfile1-dev missing. On the third attempt I got a valid build. Fired up APM Planner2 from the command line, everything works, stuck my telemetry radio in the USB port and connected to my quadcopter with it.

Thanks carpy!

1 Like

I have a question though - since I built the .deb for a i386 cpu platform, should I upload that to someplace in case other people want to install it easily on a Debian-based system? Or is there not enough call for 32-bit builds?

I tested installing the .deb on both Debian 8 and Ubuntu 16, and it installs and runs fine once you install the dependencies.

Thanks for the offer Chris. I think it’s a pretty low number of people running on a 32-bit platform like yourself. You might be the first to ask in the last 2 years…I can’t remember very well though…

OK, carpy. Thought I’d ask, just in case. For me, it’s an old laptop that had WinXP in it, but the laptop has a new battery. And it works great. Linux breathed new life into it and it’s ideal for carrying out to the field for flying instead of taking my newer (more expensive) laptops out there. So if anybody wants that 32-bit .deb don’t be afraid to ask. I got a personal server and I can upload it to that where it can be easily downloaded for install on a 32-bit Debian-based system.

1 Like

I’ve tested my 32-bit builds on:
single core T1350 running Ubuntu 16 (Xenial)
CoreDuo T2300 running Ubuntu 16 (Xenial)
CoreDuo T2300 running Debian Stretch (testing branch)

And since Debian et al has multiarch:
AMD Sempron 3500 running Mint 18 (Sarah)
Core2 running Ubuntu 16 (Xenial)
Dual Core i5-2500K (eight cores) running Debian Stretch (testing branch)

It runs fine on all of the above. As would be expected the 32-bit build consumes less RAM on x86-64 with a 64-bit OS. The Core2 machine with the 64-bit build:

The same Core2 machine running the 32-bit build with the identical widget set and connected to the UAV with Mavlink:

Very cool. BTW, did you notice a memory leak on any of the platforms? We have a little one, but we don’t think it’s that big of an issue right now.

Not really. I mean, I run it on an old 32-bit laptop that only has 1GB RAM in it, and I have yet to see it dip into the swap memory even on that one after an hour of run time. There’s some applications like the Firefox web browser that have serious memory leaks. If APM Planner2 is leaking some mem I’d say it’s in the unnoticeable class, where an app like Firefox is in the serious problem class.

1 Like

Hi Chris,

Thanks for the offer. Could you please share the link where I can get the 32bit deb file?

I need to install it on a netbook so I can calibrate compass away from home. Too bad the android tower app doesn’t have this functionality.

Thanks in advance.

Hi calvin,
It is here on my personal server:
http://chriskristin.dlinkddns.com/ArduPilot-Builds/APM_Planner2/