Skip to content

Commit

Permalink
Merge pull request #361 from analogdevicesinc/rgetz-patch-1
Browse files Browse the repository at this point in the history
Create README_BUILD.md
  • Loading branch information
dNechita authored Feb 5, 2020
2 parents a923d23 + 49f999c commit 8d4563c
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions README_BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Build instructions for libiio

## Install Prerequisites/Dependancies

Basic system setup
```shell
analog@precision:~$ sudo apt-get update
analog@precision:~$ sudo apt-get install build-essential
```
Install Prerequisites
```shell
analog@precision:~$ sudo apt-get install libxml2-dev bison flex libcdk5-dev cmake
```
Install Backends
```shell
analog@precision:~$ sudo apt-get install libaio-dev libusb-1.0-0-dev libserialport-dev libavahi-client-dev
```
Install to build doc
```shell
sudo apt-get install doxygen graphviz
```
## Clone
```shell
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 Options | Default | Description |
------------------- | ------- | ---------------------------------------------- |
`CSHARP_BINDINGS` | OFF | Install C# bindings |
`MATLAB_BINDINGS` | OFF | Install MATLAB bindings |
`PYTHON_BINDINGS` | OFF | Install PYTHON bindings |
`WITH_DOC` | OFF | Generate documentation with Doxygen |
`WITH_MAN` | OFF | Generate and install man pages |
`WITH_TESTS` | ON | Build the test programs |
`WITH_LOCAL_CONFIG` | OFF | Read local context attributes from /etc/libiio.ini |
`ENABLE_PACKAGING` | OFF | Create .deb/.rpm/.tar.gz via 'make package' |
`INSTALL_UDEV_RULE` | ON | Install 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 Options | Depends on | Description |
---------------------- | ------------- | ------------------------------- |
`WITH_XML_BACKEND` | libxml2 | Enable the XML backend |
`WITH_USB_BACKEND` | libusb | Enable the libusb backend |
`WITH_SERIAL_BACKEND` | libserialport | Enable the Serial backend |
`WITH_NETWORK_BACKEND` | | Supports TCP/IP |
`WITH_LOCAL_BACKEND` | Linux | Enables local support with iiod |


```shell
analog@precision:~/libiio$ mkdir build
analog@precision:~/libiio/build$ cd build
analog@precision:~/libiio/build$ cmake ../
analog@precision:~/libiio/build$ make -j$(nproc)
```

## Install
```shell
analog@precision:~/libiio/build$ sudo make install
```

0 comments on commit 8d4563c

Please sign in to comment.