Normally I use DISTCC but it is not great when there are compile errors and the linking process is still done on the RPi
The benefits of the below workflow:
Compile using the RPi as your source disk (no copying back app binaries - single point of OF source)
No Homebrew/Macports/crosstool-ng or fighting with Yosemite
Conceptually should work cross-platform
Components:
VirtualBox with Debian VM and cross-compiler
RPi with OF installed/SMB configured with mount point as / and read/write access
Workflow:
Mount Pi and edit OF projects over SMB
SSH into Debian VM to compile
Separate SSH into RPi to run apps
Thanks for the guide @jvcleave! I have followed it almost completely (except that I am using a vagrant box version of Debian 7.3), but am running into an error when trying to compile.
vagrant@vagrant-debian-wheezy-i386:/media/Data/home/pi/openFrameworks/apps/myApps/emptyExample$ make -j6 RPI_TOOLS=$RPI_TOOLS RPI_ROOT=$RPI_ROOT GST_VERSION=1.0 PLATFORM_OS=Linux PLATFORM_ARCH=armv6l
cat: /opt/vc/include/interface/vmcs_host/vc_dispmanx.h: No such file or directory
armv6l
checking pkg-config libraries: cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa
../../../libs/openFrameworksCompiled/project/makefileCommon/config.shared.mk:260: *** couldn't find some pkg-config packages, did you run the latest install_dependencies.sh?. Stop.
I manually ran the /media/Data/home/pi/openFrameworks/scripts/linux/debian/install_dependencies.sh script, but that did not fix it. It probably has to do with the absolute paths that you mention in your Troubleshooting part, as find ~/RPI_ROOT/ -name libm.so returns /home/vagrant/RPI_ROOT/usr/lib/arm-linux-gnueabihf/libm.so. However, I’m unclear as to how to proceed. I checked the folder containing libm.so, and it’s packed. Should I remove everything here?
@jvcleave Thanks! Just to be sure, I had openFrameworks already working alright on the Pi, I could compile fine there. So should I now run the install_dependencies.sh from the oF/scripts/debian folder on the Pi? Or the debian_armv61 folder?
@jvcleave I did indeed. I just found out the file you mention is not located at the /opt folder, but at ~/RPI_ROOT/opt. Turned out something went wrong with the export commands. I fixed that, and now the first bug is gone, awesome. Now I only get the install_dependencies.sh warning. Do you know which version I should run? Cheers!
When make runs it then uses pkg-config to get the info for cairo zlib gstreamer-app-1.0 etc using the paths from the environment variable set in PKG_CONFIG_PATH
@jvcleave Thank you, once again!
I have no idea what happened before, but it’s kind of now obvious that something went wrong while setting the environment variables, as the $ echo $PKG_CONFIG_PATH did not return anything. After that I checked the other variables and not a single one was set.
I thought I did set them all before, but obviously something went wrong there, because after setting them again and following the steps after, oF started compiling! (Currently still going on, but so far it seems to work now.) Will update this post after it’s done (or failed).
EDIT: Got really far, but not far enough. It’s stuck on the error below ( cannot find /lib/arm-linux-gnueabihf/libpthread.so.0 inside /home/vagrant/RPI_ROOT). This file does exist, but the path is incorrect. (File exists at /home/vagrant/RPI_ROOT/usr/lib/arm-linux-gnueabihf/)