Build instructions for libiio

Install Prerequisites/Dependancies

Basic system setup

analog@precision:~$ sudo apt-get update
analog@precision:~$ sudo apt-get install build-essential

Install Prerequisites

analog@precision:~$ sudo apt-get install libxml2-dev bison flex libcdk5-dev cmake

Install Backends

analog@precision:~$ sudo apt-get install libaio-dev libusb-1.0-0-dev libserialport-dev libavahi-client-dev

Install to build doc

sudo apt-get install doxygen graphviz

Clone

analog@precision:~$ git clone https://github.com/analogdevicesinc/libiio.git
analog@precision:~$ cd libiio

Configure & Build

when configuring libiio with cmake, there are a few optional settings that you can use to control the build.

Cmake OptionsDefaultDescription
CSHARP_BINDINGSOFFInstall C# bindings
MATLAB_BINDINGSOFFInstall MATLAB bindings
PYTHON_BINDINGSOFFInstall PYTHON bindings
WITH_DOCOFFGenerate documentation with Doxygen
WITH_MANOFFGenerate and install man pages
WITH_TESTSONBuild the test programs
WITH_LOCAL_CONFIGOFFRead local context attributes from /etc/libiio.ini
ENABLE_PACKAGINGOFFCreate .deb/.rpm/.tar.gz via ‘make package’
INSTALL_UDEV_RULEONInstall a udev rule for detection of USB devices

Which backends the library supports is dependant on the build system, but can be overridden. (If cmake finds libusb, it will use it, unless turned off manually)

Cmake OptionsDepends onDescription
WITH_XML_BACKENDlibxml2Enable the XML backend
WITH_USB_BACKENDlibusbEnable the libusb backend
WITH_SERIAL_BACKENDlibserialportEnable the Serial backend
WITH_NETWORK_BACKENDSupports TCP/IP
WITH_LOCAL_BACKENDLinuxEnables local support with iiod
analog@precision:~/libiio$ mkdir build
analog@precision:~/libiio/build$ cd build
analog@precision:~/libiio/build$ cmake ../
analog@precision:~/libiio/build$ make -j$(nproc)

Install

analog@precision:~/libiio/build$ sudo make install