Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create README_BUILD.md #361

Merged
merged 1 commit into from
Feb 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```