Error when trying cross compiling from Ubuntu

I’ve got oF008 working on my RPi, the examples compile and run fine. Now I’d like to be able to cross-compile oF projects from Ubuntu, as described over here.
I have the RPi Tools and the /usr dir from my Raspbian sd card on my drive and have the appropriate variables described in my .bashrc file, so now I was ready for the test:

make -j6 RPI_TOOLS=$RPI_TOOLS RPI_ROOT=$RPI_ROOT GST_VERSION=0.10 PLATFORM_OS=Linux PLATFORM_ARCH=armv6l

I then get this error:

…/…/…/libs/openFrameworksCompiled/project/makefileCommon/config.shared.mk:263: *** couldn’t find some pkg-config packages, did you run the latest install_dependencies.sh?. Stop.

Does this refer to install_dependencies.sh of the ubuntu version of oF or the armv6 version?

OK, there’s that question. Some more info: I’m running Ubuntu 13.10 64bit. Given that I’m on a 64 bit system, I’m getting the feeling that that may be an ingredient in my problem. You see, one of the earlier steps mentioned in this cross-compiling tutorial was

if you are using a 64bit linux distribution you’ll need to install also:
sudo aptitude install ia32-libs

First of all, aptitude wasn’t available on my install so I used apt-get instead. In my mind that’s a similar path to the same result… am I mistaken there? Anyway, with ‘sudo apt-get install ia32-libs’ I got this error:

Reading package lists… Done
Building dependency tree
Reading state information… Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
lib32z1 lib32ncurses5 lib32bz2-1.0

E: Package ‘ia32-libs’ has no installation candidate

I naively installed those three suggested packages but from what I’m reading around the net that really doesn’t address an underlying issue which is that

The ia32-libs package was a hack to get 32-bit packages installed on a 64-bit installation. Since Ubuntu version 11.10 (Oneiric), Multi Arch has been added. One of the objectives for it is removing the ia32-libs package. (link)

This has me, well… not sure what to do next. I’m rather inexperienced in the intricacies of Linux so I can’t hack my way out of this one. From what I gather it’s no longer possible for the dependencies and codecs which are 32 bit to ‘magically’ work on this 64 bit system. Instead, it’s apparently useful to append “:386” behind every package that needs to be 32 bit compatible… or something along those lines. I really don’t know anymore at this point. I’d love to know what I’m missing here, maybe you have an idea…

I think the OF docs may be wrong as the RPI uses Gstreamer 1.0

try changing

GST_VERSION=0.10

to

GST_VERSION=1.0

Wow, thanks! Still not being able to cross compile though, but I’m getting new errors to tackle. I pasted the results to this gist for brevity.

Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc’
to the PKG_CONFIG_PATH environment variable

Any ideas on where that directory is and where to add it? Or perhaps the whole point is that the directory (and/or files in it) should exist but don’t and that that’s an issue…

Googling for similar errors I came across this oF issue (featuring you :)) in which it seems that executing install_dependencies.sh was the solution for that person. I executed the install_dependencies.sh of the RPi distro in Ubuntu (which felt weird to do but what the hell) but this didn’t solve it.

Do I need to compile the oF core of the RPi distro before being able to compile the examples? Actually, I just copied the compiled oF from my RPi to the RPi distro that I’m working with in Ubuntu, but no dice.

Hope you have some additional tips. Thank you!

make sure you are running this install_dependencies.sh script on the RPI

https://github.com/openframeworks/openFrameworks/blob/master/scripts/linux/debian_armv6l/install_dependencies.sh

The current Raspbian (pre-Jessie) doesn’t have gstreamer 1.0 in it’s apt repository so inside the script we include a 3rd party repo that provides it. If this is the script you ran there may be a chance the repo was down when you ran it but it currently looks like it is available.

I use a different cross-compiler process (distcc) so it’s hard for me to help you with anything on that side of it. I use an seperate Linux desktop machine and the older instructions as they have been the most reliable for me

If your primary machine is a Mac I have used this process successfully as well:

I’d done that already. Replaced the current install_dependencies.sh with yours and ran it again but no change.

I don’t actually have any particular reason to go for the cross-compiling route, it’s simply the first one on the list. Since you have success with distcc I decided to try that too. Lo and behold… success! I’m running a 32bit Ubuntu 12.04 in Virtualbox (OSX 10.9.1) as the distcc slave at the moment. Quite thrilled this is working. Will try getting it to run in a native-running 64bit Ubuntu 13.10 tomorrow.

This is all largely black magic to me, thank goodness for the walk-through.

If I get this correctly, the Pi dispatches the command to compile remotely. If that’s so, the Pi has to have the newly updated files at its disposal already. That means having to write the code on the Pi, but I’d rather write it from a more comfortable environment. Could the next step be to have the oF sketch residing in a shared folder on the RPi shared through NFS/SMB?

Cool - I was just making sure you were running the correct script as the armv6 is a bit different.

Awesome you got something to work. It is all a lot of magic to me as well (which is probably why I use the old instructions that just work for me)

This is exactly what I do. Edit code on the Mac (RPI is mounted over SMB) and jump over to an SSH session to compile and run the RPI apps

I use this project

OK, good to hear I might be close to actually being able to get to work. It seems a nice idea to be able to run and test the code locally before ‘deploying’ (so to speak; I understand that this setup probably wouldn’t be called deploying) on the RPI, if of course the code is compatible with the current machine. But that’s just details… I’ll just have to figure out what works for me.

Thanks for the link to your xcode workspace. If I understand correctly you code in OSX and your distcc host is a ubuntu instance running in Parallels?

No Parallels - I currently have a separate machine that I use.

Aha. I set the distcc up on that native running ubuntu as I said and was surprised that it didn’t compile any quicker than with the one running in Virtualbox (with limited resources assigned to it). I’m using the graphicsExample as a benchmark. RPI compiles it in about 1m35s and with distcc it’s about 35s. This is of course great, but I had imagined something faster for some reason
I would imaging that the gain increases when the project becomes complexer, is that right?

I usually go by the OF library - It takes about an hour on the RPi and something like 2 minutes with distcc. Linking still has to be done on the RPi which can still take some time. It’s really not that resource intensive on the distcc server - barely spikes the CPU.

Yeah that’s what caught me by surprise too. Well, off to port my code and see how well I fare. Thanks for all the help.