libavg is a high-level development platform for media-centric applications using Python as scripting language and written in C++ and I’ve already written a post to cross-compile libavg 1.6 in Ubuntu (with linaro cross toolchain) and using Beagleboard qemu image.
Since I’ve doing some preparation work to have software running on the Raspberry Pi and that the latter won’t support Ubuntu, I’ve had to cross-compile it again. This time, I’ve found a cleaner way to do the cross-compilation with dpkg-cross and xapt tools which can load the required armel package to the arm toolchain. Those tools really make life easy, as previously (a few years ago), I would have had to cross-compile all dependencies manually.
Here are the steps I followed:
- Install Emdebian ARM Cross Toolchain and Tools in Debian.
- Download libavg 1.7 source code
1wget http://www.libavg.de/raw-attachment/wiki/DownLoad/libavg-1.7.0.tar.gz - Extract it
12tar xzvf libavg-1.7.0.tar.gzcd libavg-1.7.0 - Install the following armel development packages:
sudo /usr/share/pdebuild-cross/xapt -a armel libpango1.0-dev libavformat-dev libavcodec-dev libswscale-dev python2.6-dev libboost-python-dev libboost-thread-dev libglu-dev libgl1-mesa-dev libgtk2.0-dev libglib2.0-dev libsdl-dev libxml2-dev libxxf86vm-dev libcairo-dev librsvg2-dev --force-yes
- Remove the SSE2 flags in configure script:
123cat configure | sed s/-msse2// > configure.armmv configure.arm configurechmod 755 configure - There is some x86 assembler in the code, we need to disable it.
Edit src/base/Exception.cpp and replace debugBreak code by :
123456789101112void debugBreak(){#ifndef __arm__#ifdef _WIN32__asm int 3;#elseasm("int $3");#endif#elseasm("swi 0x03");#endif}
Please note that I’m not fully sure of the ARM assembly I’ve used to replace the INT x86 instruction. If I’m wrong let me know. Anyway this code should not be called if the environment variable AVG_BREAK_ON_ASSERT is not set to 1. - Export some environment variables (or create source.env file instead):
12345678910export PANGOFT2_CFLAGS="-I/usr/arm-linux-gnueabi/include/"export PANGOFT2_LIBS="-L/usr/arm-linux-gnueabi/lib/"export GDK_PIXBUF_CFLAGS="-I/usr/arm-linux-gnueabi/include/"export GDK_PIXBUF_LIBS="-L/usr/arm-linux-gnueabi/lib/"export LIBRSVG_CFLAGS="-I/usr/arm-linux-gnueabi/include/"export LIBRSVG_LIBS="-L/usr/arm-linux-gnueabi/lib/"export FONTCONFIG_CFLAGS="-I/usr/arm-linux-gnueabi/include/"export FONTCONFIG_LIBS="-L/usr/arm-linux-gnueabi/lib/"export FFMPEG_CFLAGS="-I/usr/arm-linux-gnueabi/include/"export FFMPEG_LIBS="-L/usr/arm-linux-gnueabi/lib/" - Configure, build and install libavg:
CFLAGS="-I/usr/arm-linux-gnueabi/include/gtk-2.0 -I/usr/arm-linux-gnueabi/include/glib-2.0" CXXFLAGS="-I/usr/arm-linux-gnueabi/include/gtk-2.0 -I/usr/arm-linux-gnueabi/include/glib-2.0/ -I/usr/arm-linux-gnueabi/lib/glib-2.0/include/ -I/usr/arm-linux-gnueabi/include/pango-1.0 -I/usr/arm-linux-gnueabi/include/cairo/ -I/usr/arm-linux-gnueabi/include/librsvg-2" LDFLAGS="-lgdk_pixbuf-2.0 -lavcodec -lavutil -lavformat -lswscale -lSDL -lpango-1.0 -lpangoft2-1.0 -lrsvg-2" ./configure --target=arm-linux-gnueabi --host=arm-linux-gnueabi --with-sdl-prefix=/usr/arm-linux-gnueabi --prefix=/home/jaufranc/edev/raspberry-pi/libs
make
make install
This was tested in Deiban Squeeze (6.0.3) in VirtualBox.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
I use the libavg ver.1.7.1 and debian 6.0.3 but encounter the issue while run ./configure.
#error message
****************************************
checking for main in -lboost_python… no
configure: error: boost.python not found. Aborting.
****************************************
Can someone help to figure it out?
Thank you.
@ alonso
I’ve come across this issue as well, but I can’t remember the solution, you just need to have a look into your config.log to find out what’s missing.
did you re-compile the source code downloaded from Boost.Python website?
@ alonso
No, I think it was more about installing packages and/or settings the right paths.
Did you encountered some error during make source code?
I encountered some about make command.
Hi,could you provide the arm version libavg as you builded for me?
or give me the libavg-1.7.0.tar.gz for me to cross build?
Here is my e-mail:
[email protected]
Thank you.
@ Peter
I’m not sure I still have it. You can download libavg 1.7.1 instead. https://www.libavg.de/site/projects/libavg/wiki/DownLoad
@ alonso
i think that the problem because you don’t install libboost-python1.40 or higher. try install it first and run again.
when i configure the libavg 1.6.0 ./configure –target=arm-linux-gnueabi –host=arm-none-linux-gnueabi –with-sdl-prefix=/usr/arm-linux-gnueabi –prefix=/home/achouri/CodeSourcery/Sourcery_G++_Lite/lib –with-python=/usr/lib/python2.6 i get this error : checking for PANGOFT2_CFLAGS… -I/usr/arm-linux-gnueabi/include/ checking for PANGOFT2_LIBS… -L/usr/arm-linux-gnueabi/lib/ checking for freetype-config… /usr/bin/freetype-config checking for freetype… yes checking for MAGICK_CFLAGS… -I/usr/include/GraphicsMagick checking for MAGICK_LIBS… -lGraphicsMagick++ -lGraphicsMagick checking for FFMPEG_CFLAGS… -I/usr/arm-linux-gnueabi/include/ checking for FFMPEG_LIBS… -L/usr/arm-linux-gnueabi/lib/ checking libavformat/avformat.h usability… no checking libavformat/avformat.h presence… no checking for libavformat/avformat.h… no checking for python… /usr/bin/python checking for python version… 2.6 checking for python platform… linux2 checking for python script directory… ${prefix}/lib/python2.6/site-packages checking for python extension module directory… ${exec_prefix}/lib/python2.6/site-packages checking for headers required to compile python extensions… not found checking… Read more »
@andree
Each time something goes wrong with ./configure you should always check config.log for details.
when i excute tihis command : CFLAGS=”-I/usr/arm-linux-gnueabi/include/gtk-2.0 -I/usr/arm-linux-gnueabi/include/glib-2.0″ CXXFLAGS=”-I/usr/arm-linux-gnueabi/include/gtk-2.0 -I/usr/arm-linux-gnueabi/include/glib-2.0/ -I/usr/arm-linux-gnueabi/lib/glib-2.0/include/ -I/usr/arm-linux-gnueabi/include/pango-1.0 -I/usr/arm-linux-gnueabi/include/cairo/ -I/usr/arm-linux-gnueabi/include/librsvg-2″ LDFLAGS=”-lgdk_pixbuf-2.0 -lavcodec -lavutil -lavformat -lswscale -lSDL -lpango-1.0 -lpangoft2-1.0 -lrsvg-2″ ./configure –target=arm-linux-gnueabi –host=arm-linux-gnueabi –with-sdl-prefix=/usr/arm-linux-gnueabi –prefix=/home/jaufranc/edev/raspberry-pi/libs and i use arm-linux-gnueabi-gcc-4.5 i get this error configure: WARNING: if you wanted to set the –build type, don’t use –host. If a cross compiler is detected then cross compile mode will be used checking build system type… i686-pc-linux-gnu checking host system type… arm-unknown-linux-gnueabi checking target system type… arm-unknown-linux-gnueabi checking for arm-linux-gnueabi-gcc… no checking for gcc… gcc checking whether the C compiler works… no configure: error: in /home/administrateur/Bureau/libavg-1.7.1': configure: error: C compiler… Read more »
@Jean-Luc Aufranc (CNXSoft) the config.log is This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libavg configure 1.7.1, which was generated by GNU Autoconf 2.67. Invocation command line was $ ./configure –target=arm-linux-gnueabi –host=arm-linux-gnueabi CC=arm-linux-gnueabi-g++-4.5 AR=arm-linux-gnueabi-ar TRIP=arm-linux-gnueabi-strip RANLIB=arm-linux-gnueabi-ranlib –with-sdl-prefix=/usr/arm-linux-gnueabi –prefix=/home/administrateur/Bureau/oout ## ——— ## ## Platform. ## ## ——— ## hostname = administrateur-laptop uname -m = i686 uname -r = 2.6.32-38-generic uname -s = Linux uname -v = #83-Ubuntu SMP Wed Jan 4 11:13:04 UTC 2012 /usr/bin/uname -p = unknown /bin/uname -X = unknown /bin/arch = unknown /usr/bin/arch… Read more »
Hello, I get this error after the configuration and when i excute the command make make Making all in src make[1]: entrant dans le répertoire « /home/administrateur/Bureau/libavg-1.7.1/src » make all-recursive make[2]: entrant dans le répertoire « /home/administrateur/Bureau/libavg-1.7.1/src » Making all in base make[3]: entrant dans le répertoire « /home/administrateur/Bureau/libavg-1.7.1/src/base » CXX FileHelper.lo CXX CmdLine.lo CXX Exception.lo CXX Logger.lo CXX ConfigMgr.lo CXX XMLHelper.lo CXX TimeSource.lo CXX OSHelper.lo CXX ProfilingZone.lo CXX ThreadProfiler.lo CXX ScopeTimer.lo CXX Test.lo CXX TestSuite.lo CXX ObjectCounter.lo CXX Point.lo CXX Directory.lo CXX DirEntry.lo CXX StringHelper.lo CXX MathHelper.lo CXX GeomHelper.lo CXX CubicSpline.lo CXX BezierCurve.lo CXX UTF8String.lo CXX Triangle.lo CXX Triangulate.lo… Read more »
@Alex
Some files must be x86 some ARM. If you run “make V=1”, you’ll see if it’s using the cross-compiler or just gcc on your machine. If it uses gcc, you may have to export CC and CXX with your corss-compiler as well.
@Jean-Luc Aufranc (CNXSoft)
in the configuration step i export the CC and CXX :
CFLAGS=”-I/usr/arm-linux-gnueabi/include/gtk-2.0 -I/usr/arm-linux-gnueabi/include/glib-2.0″ CXXFLAGS=”-I/usr/arm-linux-gnueabi/include/gtk-2.0 -I/usr/arm-linux-gnueabi/include/glib-2.0/ -I/usr/arm-linux-gnueabi/lib/glib-2.0/include/ -I/usr/arm-linux-gnueabi/include/pango-1.0 -I/usr/arm-linux-gnueabi/include/cairo/ -I/usr/arm-linux-gnueabi/include/librsvg-2″ LDFLAGS=”-lgdk_pixbuf-2.0 -lavcodec -lavutil -lavformat -lswscale -lSDL -lpango-1.0 -lpangoft2-1.0 -lrsvg-2 ” FREETYPE_LIBS=/usr/arm-linux-gnueabi/lib ./configure –target=arm-linux-gnueabi –host=arm-linux-gnueabi CC=arm-linux-gnueabi-g++-4.5 AR=arm-linux-gnueabi-ar TRIP=arm-linux-gnueabi-strip RANLIB=arm-linux-gnueabi-ranlib –with-sdl-prefix=/usr/arm-linux-gnueabi –prefix=/home/administrateur/Bureau/oout
@Alex when i ru make V=1 i get this message : Making all in src make[1]: entrant dans le répertoire « /home/administrateur/Bureau/libavg-1.7.1/src » make all-recursive make[2]: entrant dans le répertoire « /home/administrateur/Bureau/libavg-1.7.1/src » Making all in base make[3]: entrant dans le répertoire « /home/administrateur/Bureau/libavg-1.7.1/src/base » /bin/sh ../../libtool –tag=CXX –mode=link g++ -Wno-invalid-offsetof -I/usr/arm-linux-gnueabi/include/gtk-2.0 -I/usr/arm-linux-gnueabi/include/glib-2.0/ -I/usr/arm-linux-gnueabi/lib/glib-2.0/include/ -I/usr/arm-linux-gnueabi/include/pango-1.0 -I/usr/arm-linux-gnueabi/include/cairo/ -I/usr/arm-linux-gnueabi/include/librsvg-2 -Wall -pipe -rdynamic -lgdk_pixbuf-2.0 -lavcodec -lavutil -lavformat -lswscale -lSDL -lpango-1.0 -lpangoft2-1.0 -lrsvg-2 -rdynamic -o testbase testbase.o ./libbase.la -lboost_thread libtool: link: g++ -Wno-invalid-offsetof -I/usr/arm-linux-gnueabi/include/gtk-2.0 -I/usr/arm-linux-gnueabi/include/glib-2.0/ -I/usr/arm-linux-gnueabi/lib/glib-2.0/include/ -I/usr/arm-linux-gnueabi/include/pango-1.0 -I/usr/arm-linux-gnueabi/include/cairo/ -I/usr/arm-linux-gnueabi/include/librsvg-2 -Wall -pipe -rdynamic -rdynamic -o testbase testbase.o ./.libs/libbase.a /usr/arm-linux-gnueabi/lib/libgdk_pixbuf-2.0.so -lavcodec -lavutil -lavformat -lswscale /usr/arm-linux-gnueabi/lib/libSDL.so /usr/arm-linux-gnueabi/lib/libpango-1.0.so… Read more »
now the problem is this : make[3]: entrant dans le répertoire « /home/administrateur/Bureau/free/libavg-1.7.1/src/player » CXX OGLSurface.lo CXX SDLDisplayEngine.lo CXX Arg.lo CXX AreaNode.lo CXX RasterNode.lo CXX DivNode.lo CXX VideoNode.lo CXX Player.lo Player.cpp: In member function ‘avg::NodePtr avg::Player::loadMainNodeFromFile(const std::string&)’: Player.cpp:456:1: warning: control reaches end of non-void function CXX PluginManager.lo CXX NodeRegistry.lo CXX ArgBase.lo CXX ArgList.lo CXX DisplayEngine.lo CXX Canvas.lo CXX CanvasNode.lo CXX OffscreenCanvasNode.lo CXX MainCanvas.lo CXX Node.lo CXX MultitouchInputDevice.lo CXX PanoImageNode.lo CXX WordsNode.lo CXX CameraNode.lo CXX NodeDefinition.lo CXX TextEngine.lo CXX Timeout.lo CXX Event.lo CXX DisplayParams.lo CXX CursorState.lo CXX MaterialInfo.lo CXX Image.lo CXX ImageNode.lo CXX EventDispatcher.lo CXX KeyEvent.lo CXX CursorEvent.lo CXX MouseEvent.lo CXX… Read more »
Hi, could you help about this error, just after the configuration and when i run make i get this msg :
CXX testcalibrator.o
CXXLD testcalibrator
./.libs/libplayer.a(TrackerCalibrator.o): In function
avg::TrackerCalibrator::makeTransformer()’:
lm_initialize_control’TrackerCalibrator.cpp:(.text+0×560): undefined reference to
TrackerCalibrator.cpp:(.text+0x6ea): undefined reference to `lm_minimize’
collect2: ld returned 1 exit status
make[3]: *** [testcalibrator] Erreur 1
make[3]: Leaving directory « /home/Peter/libavg-1.7.1/src/player »
@Peter
I’d recommend people read http://www.cnx-software.com/how-tos-training-materials/#compile_error before posting questions here.
But this won’t help for this particular error :). Here’s how I normally do for this type of error:
1. Search in Google for the undefined reference, e.g. “lm_initialize_control”
2. This should lead to to some library name
3. Run “aptitude search” to find the right package for this library
4. Install the development version of the library with” apt-get install”
Hi when i run make i get this message and i set the flags config of lib python boost export BOOST_PYTHON_CFLAGS=”-I/usr/arm-linux-gnueabi/include/” export BOOST_PYTHON_LIBS=”-L/usr/arm-linux-gnueabi/lib/” Entering directory /home/libavg-1.7.1/src/player' CXXLD testplayer ./.libs/libplayer.a(Player.o): In function boost::python::converter::arg_to_python::arg_to_python(char const* const&)’: Player.cpp:(.text._ZN5boost6python9converter13arg_to_pythonIPKcEC2ERKS4_[_ZN5boost6python9converter13arg_to_pythonIPKcEC5ERKS4_]+0x12): undefined reference to boost::python::converter::do_return_to_python(char const*)' ./.libs/libplayer.a(Player.o): In function boost::python::api::const_attribute_policies::get(boost::python::api::object const&, char const*)’: Player.cpp:(.text._ZN5boost6python3api24const_attribute_policies3getERKNS1_6objectEPKc[boost::python::api::const_attribute_policies::get(boost::python::api::object const&, char const*)]+0x14): undefined reference to boost::python::api::getattr(boost::python::api::object const&, char const*)' ./.libs/libplayer.a(Player.o): In function boost::python::api::const_item_policies::get(boost::python::api::object const&, boost::python::api::object const&)’: Player.cpp:(.text._ZN5boost6python3api19const_item_policies3getERKNS1_6objectES5_[boost::python::api::const_item_policies::get(boost::python::api::object const&, boost::python::api::object const&)]+0x14): undefined reference to boost::python::api::getitem(boost::python::api::object const&, boost::python::api::object const&)' ./.libs/libplayer.a(Player.o): In function boost::python::api::item_policies::set(boost::python::api::object const&, boost::python::api::object const&, boost::python::api::object const&)’: Player.cpp:(.text._ZN5boost6python3api13item_policies3setERKNS1_6objectES5_S5_[boost::python::api::item_policies::set(boost::python::api::object const&, boost::python::api::object const&, boost::python::api::object const&)]+0x12): undefined reference to boost::python::api::setitem(boost::python::api::object const&, boost::python::api::object const&, boost::python::api::object const&)'… Read more »
@Sousie
Try make V=1 . This should show more information.
You can also try the method provided in the comment just above.
@Jean-Luc Aufranc (CNXSoft)
i excute make V=1 iget this message
entrant dans le répertoire « /home/invitee/Bureau/libavg-1.7.1/src/base »
/bin/bash ../../libtool –tag=CXX –mode=link arm-linux-gnueabi-g++ -Wno-invalid-offsetof -I/usr/arm-linux-gnueabi/include/gtk-2.0 -I/usr/arm-linux-gnueabi/include/glib-2.0/ -I/usr/arm-linux-gnueabi/lib/glib-2.0/include/ -I/usr/arm-linux-gnueabi/include/pango-1.0 -I/usr/arm-linux-gnueabi/include/cairo/ -I/usr/arm-linux-gnueabi/include/librsvg-2 -Wall -pipe -rdynamic -lgdk_pixbuf-2.0 -lavcodec -lavutil -lavformat -lswscale -lSDL -lpango-1.0 -lpangoft2-1.0 -lrsvg-2 -rdynamic -o testbase testbase.o ./libbase.la -lboost_thread
libtool: link: arm-linux-gnueabi-g++ -Wno-invalid-offsetof -I/usr/arm-linux-gnueabi/include/gtk-2.0 -I/usr/arm-linux-gnueabi/include/glib-2.0/ -I/usr/arm-linux-gnueabi/lib/glib-2.0/include/ -I/usr/arm-linux-gnueabi/include/pango-1.0 -I/usr/arm-linux-gnueabi/include/cairo/ -I/usr/arm-linux-gnueabi/include/librsvg-2 -Wall -pipe -rdynamic -rdynamic -o testbase testbase.o /usr/arm-linux-gnueabi/lib/libgdk_pixbuf-2.0.so /usr/arm-linux-gnueabi/lib/libpango-1.0.so /usr/arm-linux-gnueabi/lib/libpangoft2-1.0.so ./.libs/libbase.a /usr/lib/libgdk_pixbuf-2.0.so -lavcodec -lavutil -lavformat -lswscale /usr/arm-linux-gnueabi/lib/libSDL.so /usr/lib/libpango-1.0.so /usr/lib/libpangoft2-1.0.so -lrsvg-2 -lboost_thread -pthread -Wl,-rpath -Wl,/usr/arm-linux-gnueabi/lib -Wl,-rpath -Wl,/usr/arm-linux-gnueabi/lib
/usr/lib/libgdk_pixbuf-2.0.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
hello,
configuration need mtdev variable environement
i install mtdev but the probleme is not resolved
haw i can install libmtdev-dev with xapt ?
@Aline
Better not use xapt now, use multiarch instead, something like sudo apt-get install libmtdev-dev:armhf
hello,
Have tutorial a bout a cross-compilation of libgtk for arm without using the xapt ??