Building libiio and examples?

I have the zed/fmcomms3 and I am trying to understand libiio so I can write my own application to interface with the ad9361.

After searching the forums I found this wiki reference:

What is libiio? [Analog Devices Wiki]

I followed the instructions, getting the necessary packages, fresh git clone, but initially encountered an error regarding avahi-client. I was able to fix the build error by:

# sudo apt-get install libavahi-client-dev

Perhaps the wiki should be updated to reflect this library dependency? Anyway, now when I make all I get the following compile error for the example iio-monitor:

iio-monitor.c:19:21: fatal error: cdk/cdk.h: No such file or directory

compilation terminated.

make[1]: *** [iio-monitor.o] Error 1

It seems like this is missing from the git repo?

At the end of the day, I believe I want to write a simple application to receive and transmit data to the ad9361 with local context. Any advice/tips on where to proceed would be great.

  • Hi,

    To fix the cdk/cdk.h error you need to install libcdk5-dev package, I've updated the wiki with the missing dependencies.

    For a simple example on how to use the libiio to transmit data see this thread. We'll soon have a more comprehensive example application available which show both transmitting and receiving.

    - Lars

  • Hey guy,

    i try to build the libiio on another linux distribution with mentor graphics arm compiler. So now i receive the following errors while compiling the network.o

    andisl:~/Desktop/fmcomms/libiio$ sudo env CROSS_COMPILE=/home/andis/compiler/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi- make all

    make: /home/andis/compiler/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../arm-none-linux-gnueabi/libc/usr/bin/xml2-config: Command not found

    make: /home/andis/compiler/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../arm-none-linux-gnueabi/libc/usr/bin/xml2-config: Command not found

      CC      context.o

      CC      device.o

      CC      channel.o

      CC      buffer.o

      CC      local.o

      CC      network.o

    network.c:49:33: fatal error: avahi-client/client.h: No such file or directory

    #include <avahi-client/client.h>


    compilation terminated.

    make: *** [network.o] Error 1

    to be honest i have no idea what is going wrong.. of cause i installed all packages posted on;

    I hope you can help me

    Thanks and regards

  • Are you sure you got the libavahi dependency?

  • Jan:

    If you want to cross compile - that's totally up to you. That's not something we can spend time supporting. Compiling things on the Zedboard/ZC706 will make things go much faster/easier, since you will not have to worry about do you have the libraries installed for the host or target, or how to configure your toolchain to point at the target libraries. (which is most likely your problem).

    We don't do it, since it is such a huge pain, so we can't really answer questions about it.


  • Hey Robin,

    you are totally right, it is faster to compile programms on the zynq. My basic intention is to use a simple uramdisk.image as a rootfile system, which is much more smaller than a ubuntu-os. Therefor i was trying to modify this image with the libiio (and the examples) and try to run the iiostreaming example. For building these files, i wanted to use a cross compiler, but it should be fine compiling these files on the zynq (for example on the ubuntu) and copy the whole directory into the uramdisk.image... i cannot build them there, because make is not supported on this simplified os.

    The problem now is that the builded programm (ad9361_iiostream) cannot run with the correct rights (./ad9361...):

    zynq> chmod u+x ad9361-iiostream

    ls -al

    total 50

    drwxr-xr-x    2 root     root          1024 Oct 14  2014 .

    drwxr-xr-x    9 root     root          1024 Oct 14  2014 ..

    -rw-r--r--    1 root     root            12 Oct 14  2014 .gitignore

    -rw-r--r--    1 root     root          1170 Oct 14  2014 Makefile

    -rwxr--r--    1 root     root         17998 Oct 14  2014 ad9361-iiostream

    -rw-r--r--    1 root     root          9028 Oct 14  2014 ad9361-iiostream.c

    -rw-r--r--    1 root     root         10604 Oct 14  2014 ad9361-iiostream.o

    -rw-r--r--    1 root     root          5711 Oct 14  2014 iio-monitor.c

    zynq> ./ad9361-iiostream

    -/bin/ash: ./ad9361-iiostream: not found