Guide to compile Xuggler for Raspberry Pi - raspberry-pi

Can someone post a detailed write up, on how to compile Xuggler for Raspberry Pi?

After working on for about 5 days , I am putting the following guide to compile xuggler for Raspberry Pi (Time required : 8 hrs):
Prerequisites:
Raspberry Pi Model B+ with 512 MB RAM (Any model less than this will not give you the compiled binaries and will stuck during compilation)
Raspbian installed on an SD Card (more than 4GB SD card will do)
Steps:
Switch to 'root' user.
From the Basic xuggler build page install the dependencies (http://www.xuggle.com/xuggler/build) labeled as 'Required'
Create and export variables as follows (Make the relevant directories)
export XUGGLE_HOME=/home/pi/Downloads/xuggler
export PATH=$XUGGLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$XUGGLE_HOME/lib:$LD_LIBRARY_PATH
Create the following link:
sudo ln -s /usr/bin/make /usr/bin/gmake
If you are behind any kind of web proxy then set the following variables too:
export http_proxy='proxy-url:port'
export https_proxy='proxy-url:port'
export ftp_proxy='proxy-url:port'
Now move to the following directory:
cd /home/pi/Downloads/
Download the xuggler code from here(https://github.com/artclarke/xuggle-xuggler):
git clone https://github.com/artclarke/xuggle-xuggler.git
The code would be downloaded in the directory named 'xuggle-xuggler'
Move inside the directory 'xuggle-xuggler'
If you are behind a proxy add the following line in the file 'build.xml', just below the 'property' xml tags in the file:
<setproxy proxyhost="proxy-url" proxyport="port"/>
Now edit the file 'captive/libspeex/csrc/configure' as follows:
From:
CFLAGS="$CFLAGS -O3 -msse"
To:
CFLAGS="$CFLAGS -O3"
And
From:
if test "$has_sse" = yes; then
$as_echo "#define _USE_SSE /**/" >>confdefs.h
fi
To:
#if test "$has_sse" = yes; then
#$as_echo "#define _USE_SSE /**/" >>confdefs.h
#fi
Refer this for more info.
Now edit the file ' captive/libspeex/csrc/configure.ac' as follows:
From:
CFLAGS="$CFLAGS -O3 -msse"
To:
CFLAGS="$CFLAGS -O3"
And
From:
if test "$has_sse" = yes; then
AC_DEFINE([_USE_SSE], , [Enable SSE support])
fi
To:
#if test "$has_sse" = yes; then
# AC_DEFINE([_USE_SSE], , [Enable SSE support])
#fi
Refer this for more info.
Now as listed in the xuggler advance build link (http://www.xuggle.com/xuggler/advbuild), launch the command:
ant stage
The process will fail at or during the compilation of libX264, to circumvent it, add the following compile switches in the now generated file i.e edit file 'captive/libx264/incarcerate.in' :
From:
X264_OPTIONS="$X264_OPTIONS --enable-static"
X264_OPTIONS="$X264_OPTIONS --enable-pic"
To:
X264_OPTIONS="$X264_OPTIONS --disable-asm"
X264_OPTIONS="$X264_OPTIONS --enable-shared"
X264_OPTIONS="$X264_OPTIONS --enable-static"
X264_OPTIONS="$X264_OPTIONS --enable-pic"
Now run following command(one by one only):
ant clobber
ant clean
ant stage
This time all the compile steps will go through.
Run the install command:
ant install
The xuggler binaries would be installed at the location 'XUGGLE_HOME' as defined in step #3.
The xuggler maven repository for java binaries would be located at '/root/.m2/repository/xuggle/xuggle-xuggler'
Also you can check out the '../xuggle-xuggler/dist' directory to check all the native and java binaries for your non-maven kind of use.
The compiled binaries ran fine on Raspberry PI (Arch Linux, Raspbian).
If you don't have the time to compile, get the binaries from here.
Make sure to add the variables as defined in step #3 in java class path or shell terminal before using the java binaries compiled by me.
Special thanks to 11101101b for guidance and helping.
References:
https://github.com/e-d/xuggle-xuggler/commit/035c676e6e289fbb4b27dc75134a4470a5bab28a
Issue #1 when compiling Xuggler for Raspberry pi with libspeex
How can I build the GPL and LGPL version of Xuggle Xuggler?
Issue #2 when compiling Xuggler for Raspberry pi with libx264
http://blog.oneiroi.co.uk/linux/ffmpeg-install-with-libx264-h264/
http://www.unix.com/unix-for-dummies-questions-and-answers/53319-change-target-symbolic-link.html
http://www.raspberrypi.org/arch-linux-arm-available-for-download/
Special Thanks : https://groups.google.com/forum/#!topic/xuggler-users/F-fSSm46ZaI
For x86_64 Arch, this helped : while installing xuggler in ubuntu 11.10 getting error message
Getting git to work with a proxy server
Xuggler code : https://github.com/artclarke/xuggle-xuggler
Xuggler for Raspberry Pi: https://github.com/e-d/xuggle-xuggler/tree/pi

Related

C++ wxWidgets: cross compilation from Raspberry Pi 3

I have a C++ application that uses WxWidgets. It compiles perfectly with g++ on my computer.
However I need to run the application on a Raspberry Pi 3. Compiling directly on Raspi takes almost an hour.
So I want to do a cross compilation: compile it on my computer and copy the executable to raspberry.
I tried to follow a tutorial, however the generated file is an "x86-64" file:
http://yasriady.blogspot.com/2015/10/how-to-build-wxwidgets-for-raspberry-pi.html
My computer:
Ubuntu 20.04.2 LTS;
g++ 9.3.0;
wxWidgets v3.1.5.0;
build flags for my computer: CC_FLAGS=-std=c++17 -w -c -rdynamic -W wx-config --cxxflags --libs --gl-libs geos-config --cflags -lgeos -lglut -lGLU -lGL -lm -lGLEW .
Should I re-install wxWidgets for arm? I'm new to cross-compilation
Thank you so much
I already have wxWidgets installed and compiling for x86. Afterwards, I installed wxWidgets for arm-linux following the tutorial.
When I run "make for the examples from the samples folder, the generated file is for x86.
Maybe "make" is compiling using the x86 compiler, not the newly installed arm compiler.
You should be able to cross-compile for RPi without any problems, double check that you've specified the correct --host option and didn't get any errors from configure (if you did, look at config.log to see why).

Matlab to volttron integration

Below the steps followed to integrate a fake building - fake modbus device (Ubuntu 18.04 LTS) with matlab-based interface.
Following the documentation steps at: https://volttron.readthedocs.io/en/6.0/devguides/walkthroughs/DrivenMatlabAgent-Walkthrough.html
Installation steps for system running Matlab:
Install python (my Python version: 2.7.12)
Steps for system running Matlab:
Install python – done
Install pyzmq –done
Install Matlab-- done (R2019b)
run pyversion --done
version: '2.7'
executable: '/home/USER_NAME/volttron/env/bin/python'
library: 'libpython2.7.so.1.0'
home: '/home/USER_NAME/volttron/env'
isloaded: 0
when I run py.zmq.pyzmq_version() I get
ans =
Python str with no properties.
15.4.0
I copied the example.m to the desktop.
Run and test Matlab VOLTTRON Integration:
To run and test the integration: Assumptions
Device driver agent is already developed (master_driveragent-3.1.1- is installed)
Installation:
Install VOLTTRON –done
Add subtree volttron-applications under volttron/applications by using the following command –
For adding subtree: I used the code: git subtree add --prefix applications https://github.com/VOLTTRON/volttron- applications.git develop --squash error (Working tree has modifications. Cannot add.)
Configuration
Copy example configuration file applications/pnnl/DrivenMatlabAgent/config_waterheater to volttron/config. done
error while installing Drivenmatlabagent in applications/pnnl/DrivenMatlabAgent
(volttron)whygrene#ip-172-31-8-77:~/volttron$ python scripts/install-agent.py -s ./applications/pnnl/DrivenMatlabAgent/setup.py --start
ERROR:install-agent.py:Invalid agent source directory specified.
and running example.m file in matlab server ?
Am i missing something

building qt5 on raspberry pi3 failed

I enabled gstreamer 1.0, but it failed with the message:
ERROR: Feature 'gstreamer_1_0' was enabled, but the pre-condition 'libs.gstreamer_1_0' failed.
This is my configure script:
/configure -v -opengl es2 -device linux-rasp-pi-g''+ -device-option CROSS_COMPILE=/usr/bin/ -opensource -confirm-license -optimized-qmake -reduce-exports -release -qt-pcre -make libs -prefix /usr/local/qt5 -no-pch -gstreamer 1.0 -nomake examples -nomake tests &> output_configure.
Thanks!
I had exactly the same issue. After installing gstreamer-1.0 on Raspberry Pi and copying the libs to the host system, make sure you fix relative links in your sysroot directory.
Configuring Qt when building from source produces config.cache file. If you delete it, ./configure script will reconfigure everything. This is how you can identify broken symlinks, because it will try to compile a minimal program. For example my installation failed on missing libm.so, which was a symlink to a non-existing file.
Running ./sysroot-relativelinks.py sysroot relinked all the symlinks after installing gstreamer-1.0 and so Qt was able to find the libs.

How do I set up SDL with Codeblocks on Raspbian

I have a program I wrote in windows using the SDL library that I would like to compile for Raspbian. I installed CodeBlocks on the Raspbian and followed these instructions to set up SDL: http://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/codeblocks/
I get the following error:
g++ -LC:/SDL/lib -o bin/Debug/SDL_menu obj/Debug/main.o
obj/Debug/menu.o -lmingw32 -lSDL2main -lSDL2
obj/Debug/menu.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
I later tried this tutorial (which actually matches the version of SDL I am using, although I used the previous tutorial to get it to work on Windows): http://lazyfoo.net/tutorials/SDL/01_hello_SDL/linux/codeblocks/index.php
And I get the error:
ld||cannot find -lSDL2|
I have very little experience with Raspbian or Linux which is probably why this is so difficult.
What can I do to get this set up?
You need to install all SDL2-dev packages.
apt-get install libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev
The include folder will probably be /usr/include/SDL2.
And by inspecting your build command, you're trying to pass Windows style path on a Unix machine, that doesn't end well for sure. Don't link with mingw32 if you're not using Mingw32 compiler, and you should only link against mingw32 on Windows as well.

buildrpm fails when cross building C++ for 32-bit ARM (from x86-64)

I successfully compiled C++ code for a Raspberry Pi (ARM architecture).
Such binaries have a file command return the following :
usr/local/company/product/this: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=9fe73c254b317e239758e4445d12b8441a3cb13e, not stripped
I now wish to generate RPM packages (not .deb packages, real .RPM packages!).
I've tried many --target and spec's file buildarch combinations without much success.
Tried armv7l, arm-linux-gnueabihf, arm-linux ...
Same result is returned by rpmbuild :
Building target platforms: arm-unknown-linux
Building for target arm-unknown-linux
error: No compatible architectures found for build
I'm compiling from an x86_64 Ubuntu. The destination architecture is arm-linux-gnueabihf.
I call rpmbuild as follow :
rpmbuild -bb --target armv7l myfile.spec
On my RHEL 7 computer, the /usr/lib/rpm/rpmrc includes several ARM variants:
armv3l, armv4b, armv4l, armv4tl, armv5tel, armv5tejl, armv6l, armv7l, armv7hl, armv7hnl. I guess your file will have a similar selection, and thus include the armv7l option you selected.
I found that for cross-packaging, running rpmbuild --target _target_ was not enough. I also had to use a setarch _target_ wrapper around the build command.
You may need to add your arm architecture (displayed by uname -m) to /usr/lib/rpm/rpmrc configuration.
GOARCH=amd64 or arm64
used the command:
rpmbuild ... --define="GOARCH ${GOARCH}"
spec file should include this content
%if %{GOARCH} == "amd64"
BuildArch: x86_64
%endif
%if %{GOARCH} == "arm64"
BuildArch: aarch64
%endif