Post Go back to editing

Build libiio on petalinux 2017.4

Hi all,

I'm trying to cross compile libiio using the petalinux tool chain, I'm having issues with the libxml2 although I have enabled libxml2 in rootfs config.

Please help me.

[ 2%] Building C object CMakeFiles/iio.dir/xml.c.o
cc1: warning: include location "/usr/include/libxml2" is unsafe for cross-compilation [-Wpoison-system-directories]
In file included from /usr/include/libxml2/libxml/parser.h:810:0,
from /usr/include/libxml2/libxml/globals.h:18,
from /usr/include/libxml2/libxml/threads.h:35,
from /usr/include/libxml2/libxml/xmlmemory.h:218,
from /usr/include/libxml2/libxml/tree.h:1307,
from /home/ubuntu64b/Desktop/libiio/xml.c:23:
/usr/include/libxml2/libxml/encoding.h:31:26: fatal error: unicode/ucnv.h: No such file or directory
#include <unicode/ucnv.h>
^
compilation terminated.
CMakeFiles/iio.dir/build.make:302: recipe for target 'CMakeFiles/iio.dir/xml.c.o' failed
make[2]: *** [CMakeFiles/iio.dir/xml.c.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/iio.dir/all' failed
make[1]: *** [CMakeFiles/iio.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2

Best Regards

  • It looks like it's using the host libxml2 libs, installed on your system.

    And it shouldn't, because they are different than the ones in the PetaLinux system.

    This looks somewhat of a generic cross-build issue where the target lib seems to use the host's lib, because some cross compilation options are not specified.

    We don't have much idea about building on PetaLinux.

    We will take a look at this [generally] and formulate a guide for building our projects on PetaLinux.