Cross-compiling libavg 1.7 for ARM on Debian

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:

  1. Install Emdebian ARM Cross Toolchain and Tools in Debian.
  2. Download libavg 1.7 source code
  3. Extract it
  4. 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

  5. Remove the SSE2 flags in configure script:
  6. There is some x86 assembler in the code, we need to disable it.
    Edit src/base/Exception.cpp and replace debugBreak code by :

    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.
  7. Export some environment variables (or create source.env file instead):
  8. 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.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX Rockchip RK3588 mini-ITX motherboard
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
25 Comments
oldest
newest
alonso
alonso
12 years ago

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
alonso
12 years ago

did you re-compile the source code downloaded from Boost.Python website?

alonso
alonso
12 years ago

Did you encountered some error during make source code?
I encountered some about make command.

Peter
Peter
12 years ago

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.

Eugene
Eugene
12 years ago

@ alonso
i think that the problem because you don’t install libboost-python1.40 or higher. try install it first and run again.

andree
andree
11 years ago

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 »

Albert
Albert
11 years ago

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 »

andree
andree
11 years ago

@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 »

Alex
Alex
11 years ago

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
Alex
11 years ago

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
Alex
11 years ago

@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 »

Alex
Alex
11 years ago

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 »

Peter
Peter
11 years ago

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()’:
TrackerCalibrator.cpp:(.text+0×560): undefined reference to
lm_initialize_control’
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 »

Sousie
Sousie
11 years ago

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
Sousie
11 years ago

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

Aline
Aline
11 years ago

hello,
configuration need mtdev variable environement
i install mtdev but the probleme is not resolved
haw i can install libmtdev-dev with xapt ?

Achref
Achref
11 years ago

hello,

Have tutorial a bout a cross-compilation of libgtk for arm without using the xapt ??

Boardcon Rockchip RK3588S SBC with 8K, WiFI 6, 4G LTE, NVME SSD, HDMI 2.1...