I'm trying to cross compile libiio using the petalinux tool chain, I'm having issues with the libxml2 part. Is there any link you can point me to to do this.
No the #2 is something else.
Try to find the path to libpthread.so in your toolchain, and pass it to CMake with -DPTHREAD_LIBRARIES=/path/to/my/libpthread.so
I've branched this additional question into a new discussion.
What kind of issues are you having with the libxml2 part?
What I did is that I downloaded the libiio from your github repository , since libxml2 is needed to build the libiio library I downloaded that as well. To compile the libxml2 I ran the autoconf and then I ran ./configure to set the host to my computer that I'm using for building and I set the target to be the aarch64 zynqmp. I was able to compiled it. Now I did some changes to the CMakeCache txt file so it uses the libxml2 library that I locally build. When libiio is linking the libxml2 lib it fails with invalid format, is like is 32 bit version, but I set everything to be 64 bit on ./configure using CFLAGS.
When you configure libxml2, use ./configure --host=aarch64-.....
If you use --target it won't cross-compile.
Is not recognize as a valid machine type.
What are you typing exactly?
And what toolchain are you using?
I got the libxml2 cross compile to be run in the aarch64, now I'm having issues with compiling libiio , it fails with unable to find libxml2. What I did is I compiled the libxml2 lib and then I installed it in my toolchain directory.
/home/jgm/petalinux_2016_2/petalinux-v2016.2-final/tools/linux-i386/aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/4.9.2/../../../../aarch64-linux-gnu/bin/ld: warning: libxml2.so.2, needed by ../libiio.so.0.9, not found (try using -rpath or -rpath-link)../libiio.so.0.9: undefined reference to `xmlFreeDoc@LIBXML2_2.4.30'../libiio.so.0.9: undefined reference to `xmlReadMemory@LIBXML2_2.6.0'../libiio.so.0.9: undefined reference to `xmlDocGetRootElement@LIBXML2_2.4.30'../libiio.so.0.9: undefined reference to `xmlCheckVersion@LIBXML2_2.4.30'../libiio.so.0.9: undefined reference to `xmlReadFile@LIBXML2_2.6.0'collect2: error: ld returned 1 exit statusmake: *** [tests/iio_genxml] Error 1make: *** [tests/CMakeFiles/iio_genxml.dir/all] Error 2make: *** [all] Error 2
Could you try to edit libiio's CMakeLists.txt with the workaround described here:
CMake Cross Compiling · Issue #27 · analogdevicesinc/libiio · GitHub
(only the first one)
Thanks for the tip, it did compile, however is not detecting pthread and iiod is not compiled. Do I have to do #2 on that same Issue you sent me?
Thanks a lot.
I use ZC706 and fmcomms5 ,I have a petalinux system,and I want to cross compiling the libiio use petalinux toolchain ,and then I can compiling the examples as zynq ARM platform and I want to run these examples on ZC706 & fmcomms5 ,I have read Cross-compilation libiio but I can't modify the cmake
Could you please tell me how to do it
Thanks a lot!
Retrieving data ...