Difference between revisions of "Linux"

From sigrok
Jump to navigation Jump to search
(→‎Building: Update according to the new tree structure)
(explicitly link from Linux to Building FAQ)
(71 intermediate revisions by 16 users not shown)
Line 1: Line 1:
[[File:sigrok linux.png|right|thumb|320px|sigrok-gui on Linux]]
This page describes how to build/install the sigrok subprojects on Linux.


This page describes how to build/install sigrok on Linux.
== Distribution packages ==


== Distribution packages ==
See [[Downloads#Binaries_and_distribution_packages|Downloads]].


There are no distribution packages, yet, but some are being worked on.
== Building ==


* Debian / Ubuntu: [[User:Uwe Hermann|Uwe Hermann]] will create [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=579600 packages for Debian unstable] (which will semi-automatically migrate to Ubuntu after a while).
<div style="background-color:#ff6666">
* Fedora: See [[Linux/Fedora]].
'''IMPORTANT''': The following sections on installing build requirements are distro-specific examples and may or may not be out of date, depending on which distro you use. Please check the [[Building#Build_requirements|official build requirements list]] in the wiki or the current [http://sigrok.org/gitweb/?p=libsigrok.git;a=blob;f=README libsigrok README] for the full list of requirements.
</div>


== Building from source ==
=== libserialport ===


=== Requirements ===
==== Installing the [[Building#Build_requirements|requirements]] ====


* git (for cloning the source code repository)
'''Debian/Ubuntu/Mint'''
* gcc, g++, make, ...
$ '''sudo apt-get install git-core gcc make autoconf automake libtool'''
* autoconf, automake, libtool, pkg-config
* [http://library.gnome.org/devel/glib/unstable/ libglib] >= 2.22.0
* [http://www.libusb.org libusb] >= 1.0.5
* [http://nih.at/libzip/ libzip] >= 0.8
* [http://www.intra2net.com/en/developer/libftdi/ libftdi] (optional, only required for some devices)
<!-- * [http://www.intra2net.com/en/developer/libftdi/ libftdi] >= 0.17 (optional, only required for some devices) -->
* [http://www.kernel.org/pub/linux/utils/kernel/hotplug/libudev/ libudev] >= 151 (optional, only required for some devices)
* [http://www.python.org Python] >= 2.5 (optional, only required for protocol decoders)
* [http://qt.nokia.com Qt + Qt Creator] >= 4.5 (optional, only required for building/editing the GUI)


=== Installing the build-dependencies ===
'''Arch'''
$ '''sudo pacman -S git gcc make autoconf automake libtool'''


On most Linux distributions there are pre-built packages for the sigrok dependencies (if not, you have to build the packages from source). The installation using a package manager is usually pretty simple.
==== Building ====


Debian/Ubuntu:
$ '''git clone git://sigrok.org/libserialport'''
$ '''cd libserialport'''
$ '''./autogen.sh'''
$ '''./configure'''
$ '''make'''
$ '''sudo make install'''


$ '''sudo apt-get install git-core gcc g++ make autoconf automake libtool pkg-config \'''
=== libsigrok ===
  '''libglib2.0-dev libftdi-dev libudev-dev libusb-1.0-0-dev libzip-dev python-dev qtcreator qt4-designer qt4-dev-tools libqt4-dev'''


Fedora:
==== Installing the [[Building#Build_requirements|requirements]] ====


$ '''yum install gcc-c++ libtool glib2-devel libftdi-devel libusb1-devel libzip-devel qt-devel python-devel'''
'''Debian/Ubuntu/Mint'''


=== Building ===
$ '''sudo apt-get install git-core gcc g++ make autoconf autoconf-archive \'''
  '''automake libtool pkg-config libglib2.0-dev libglibmm-2.4-dev libzip-dev \'''
  '''libusb-1.0-0-dev libftdi1-dev check doxygen python-numpy \'''
  '''python-dev python-gi-dev python-setuptools swig default-jdk'''


First, checkout the sources:
'''Fedora (18, 19, 20, 21, 22, 23)'''
$ '''git clone git://sigrok.git.sourceforge.net/gitroot/sigrok/sigrok'''
$ '''cd sigrok'''


Then you need to build libsigrok:
$ '''sudo yum install git gcc make autoconf autoconf-archive automake libtool pkgconfig \'''
  ''' glib2-devel libzip-devel libusb1-devel libftdi-devel check-devel doxygen'''


:: For C++ bindings, add '''sudo yum install glibmm24-devel'''.
:: For Python bindings, add '''sudo yum install python-devel numpy pygobject3-devel swig'''.
:: For Fedora 23, you need as well: '''redhat-rpm-config''' and note that '''libusb1-devel''' is now '''libusbx-devel'''.
'''Arch'''
$ '''sudo pacman -S git gcc make autoconf autoconf-archive automake libtool \'''
  '''pkg-config glib2 glibmm libzip libusb libftdi check doxygen python-numpy \'''
  '''python-setuptools swig jdk8-openjdk'''
==== Building ====
$ '''git clone git://sigrok.org/libsigrok'''
  $ '''cd libsigrok'''
  $ '''cd libsigrok'''
  $ '''./autogen.sh'''
  $ '''./autogen.sh'''
Line 53: Line 65:
  $ '''sudo make install'''
  $ '''sudo make install'''


The same applies to libsigrokdecode:
==== Device access ====
 
Please read [[Building#Cannot_access_USB_.2F_serial_.2F_other_device|this FAQ entry]] for any extra steps you may need to take to get your specific device working.
 
<div style="background-color:#ff6666">
Please see [[Building#FAQ]] if you are sure that you installed all requirements properly but still encounter some issues.
</div>
 
=== libsigrokdecode ===
 
==== Installing the [[Building#Build_requirements|requirements]] ====
 
'''Debian/Ubuntu/Mint'''
$ '''sudo apt-get install git-core gcc make autoconf automake libtool pkg-config libglib2.0-dev python3-dev'''
 
'''Fedora (18, 19, 20)'''
$ '''sudo yum install git gcc make autoconf automake libtool pkgconfig glib2-devel python3-devel check-devel'''
 
'''Arch'''
$ '''sudo pacman -S git gcc make autoconf automake libtool pkgconfig glib2 python check'''
 
==== Building ====
 
$ '''git clone git://sigrok.org/libsigrokdecode'''
$ '''cd libsigrokdecode'''
$ '''./autogen.sh'''
$ '''./configure'''
$ '''make'''
$ '''sudo make install'''
 
=== sigrok-cli ===
 
==== Installing the [[Building#Build_requirements|requirements]] ====


  $ '''cd ../libsigrok'''
'''Debian/Ubuntu/Mint''''
  $ '''sudo apt-get install git-core gcc make autoconf automake libtool pkg-config libglib2.0-dev'''
 
'''Fedora (18, 19)'''
$ '''sudo yum install git gcc make autoconf automake libtool pkgconfig glib2-devel'''
 
'''OpenSuse'''
$ '''sudo zypper install git gcc make autoconf automake libtool pkgconfig glib2-devel'''
 
'''Arch'''
$ '''sudo pacman -S git gcc make autoconf automake libtool pkgconfig glib2'''
 
==== Building ====
 
$ '''git clone git://sigrok.org/sigrok-cli'''
$ '''cd sigrok-cli'''
  $ '''./autogen.sh'''
  $ '''./autogen.sh'''
  $ '''./configure'''
  $ '''./configure'''
Line 61: Line 120:
  $ '''sudo make install'''
  $ '''sudo make install'''


Then, for building the [[GUI]] ('''Note:''' The GUI is not yet usable!):
=== PulseView ===


  $ '''cd gui'''
==== Installing the [[Building#Build_requirements|requirements]] ====
  $ '''qmake'''
 
'''Debian/Ubuntu/Mint'''
$ '''sudo apt-get install git-core g++ make cmake libtool pkg-config \'''
  '''libglib2.0-dev libboost-test-dev libboost-serialization-dev \'''
  '''libboost-filesystem-dev libboost-system-dev libqt5svg5-dev qtbase5-dev'''
 
'''Fedora (18, 19, 23, 27)'''
$ '''sudo yum install git gcc cmake libtool pkgconfig glib2-devel \'''
  '''boost-devel qt5-devel'''
 
'''Arch'''
$ '''sudo pacman -S git gcc make cmake libtool pkgconfig glib2 boost qt5 \'''
  '''qt5-base qt5-svg'''
 
==== Building ====
 
$ '''git clone git://sigrok.org/pulseview'''
  $ '''cd pulseview'''
  $ '''cmake .'''
  $ '''make'''
  $ '''make'''
$ '''sudo make install'''
==== Troubleshooting ====
When building pulseview from [https://sigrok.org/gitweb/?p=pulseview.git;a=summary the repository], make sure to install [https://sigrok.org/gitweb/?p=libsigrok.git;a=summary libsigrok] and [https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=summary libsigrokdecode] by building them from source too. Building the newest pulseview with outdated libraries (forked GH repositories, debian/ubuntu packages, etc) may cause errors like these to show up when running cmake.
CMake Error at CMakeLists.txt:86 (message):
  libsigrok C++ bindings missing, check libsigrok's 'configure' output
  (missing dependencies?)
CMake Error at /usr/share/cmake-3.7/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.7/Modules/FindPkgConfig.cmake:588 (_pkg_check_modules_internal)
  CMakeLists.txt:83 (pkg_check_modules)
To make sure the dependencies are installed, you can use the following (Devuan/Debian/Ubuntu):
$ '''sudo pkg-config --list-all | grep '''<dependency package name>


If you get warnings claiming potential symbol conflicts when running qmake, you are likely invoking '''qmake-qt4'''. Try running '''qmake-qt4''' to force the correct version.
To check the installed version, use:


=== Pitfalls ===
$ '''sudo pkg-config --print-provides''' <dependency package name>


If you get this error:
'''Hint''': If something goes wrong, you can see what make is doing by running:


  sigrok-cli: error while loading shared libraries: libsigrok.so.0: cannot open shared object file: No such file or directory
  $ '''make VERBOSE=1'''


Then you have to rebuild the links to your shared libraries:
== FAQ ==


$ '''sudo ldconfig /usr/local/lib'''
Make sure to also see the [[Building#FAQ|Building FAQ]] for subjects that are not specific to Linux.


=== Testing ===
=== Cannot open shared object file: No such file or directory ===


Scan for devices:
See [[Building#Cannot_open_shared_object_file:_No_such_file_or_directory|here]].


$ '''sigrok-cli -D'''
=== TEST FAILED: .../lib/python2.7/site-packages/ does NOT support .pth files ===
The following devices were found:
ID    Device
0    Zeroplus Logic Cube with 32 probes
demo  Demo device with 8 probes


Get 10 samples from device 0 (Zeroplus Logic Cube in this example):
See [[Building#TEST_FAILED:_....2Flib.2Fpython2.7.2Fsite-packages.2F_does_NOT_support_.pth_files|here]].


$ '''sigrok-cli -d 0 --samples 10'''
=== Cannot access USB / serial / other device ===


See [[Command-line]] for further usage.
See [[Building#Cannot_access_USB_.2F_serial_.2F_other_device|here]].

Revision as of 14:40, 8 July 2018

This page describes how to build/install the sigrok subprojects on Linux.

Distribution packages

See Downloads.

Building

IMPORTANT: The following sections on installing build requirements are distro-specific examples and may or may not be out of date, depending on which distro you use. Please check the official build requirements list in the wiki or the current libsigrok README for the full list of requirements.

libserialport

Installing the requirements

Debian/Ubuntu/Mint

$ sudo apt-get install git-core gcc make autoconf automake libtool

Arch

$ sudo pacman -S git gcc make autoconf automake libtool

Building

$ git clone git://sigrok.org/libserialport
$ cd libserialport
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

libsigrok

Installing the requirements

Debian/Ubuntu/Mint

$ sudo apt-get install git-core gcc g++ make autoconf autoconf-archive \
  automake libtool pkg-config libglib2.0-dev libglibmm-2.4-dev libzip-dev \
  libusb-1.0-0-dev libftdi1-dev check doxygen python-numpy \
  python-dev python-gi-dev python-setuptools swig default-jdk

Fedora (18, 19, 20, 21, 22, 23)

$ sudo yum install git gcc make autoconf autoconf-archive automake libtool pkgconfig \
   glib2-devel libzip-devel libusb1-devel libftdi-devel check-devel doxygen
For C++ bindings, add sudo yum install glibmm24-devel.
For Python bindings, add sudo yum install python-devel numpy pygobject3-devel swig.
For Fedora 23, you need as well: redhat-rpm-config and note that libusb1-devel is now libusbx-devel.

Arch

$ sudo pacman -S git gcc make autoconf autoconf-archive automake libtool \
  pkg-config glib2 glibmm libzip libusb libftdi check doxygen python-numpy \
  python-setuptools swig jdk8-openjdk

Building

$ git clone git://sigrok.org/libsigrok
$ cd libsigrok
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

Device access

Please read this FAQ entry for any extra steps you may need to take to get your specific device working.

Please see Building#FAQ if you are sure that you installed all requirements properly but still encounter some issues.

libsigrokdecode

Installing the requirements

Debian/Ubuntu/Mint

$ sudo apt-get install git-core gcc make autoconf automake libtool pkg-config libglib2.0-dev python3-dev

Fedora (18, 19, 20)

$ sudo yum install git gcc make autoconf automake libtool pkgconfig glib2-devel python3-devel check-devel

Arch

$ sudo pacman -S git gcc make autoconf automake libtool pkgconfig glib2 python check

Building

$ git clone git://sigrok.org/libsigrokdecode
$ cd libsigrokdecode
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

sigrok-cli

Installing the requirements

Debian/Ubuntu/Mint'

$ sudo apt-get install git-core gcc make autoconf automake libtool pkg-config libglib2.0-dev

Fedora (18, 19)

$ sudo yum install git gcc make autoconf automake libtool pkgconfig glib2-devel

OpenSuse

$ sudo zypper install git gcc make autoconf automake libtool pkgconfig glib2-devel

Arch

$ sudo pacman -S git gcc make autoconf automake libtool pkgconfig glib2

Building

$ git clone git://sigrok.org/sigrok-cli
$ cd sigrok-cli
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

PulseView

Installing the requirements

Debian/Ubuntu/Mint

$ sudo apt-get install git-core g++ make cmake libtool pkg-config \
  libglib2.0-dev libboost-test-dev libboost-serialization-dev \
  libboost-filesystem-dev libboost-system-dev libqt5svg5-dev qtbase5-dev

Fedora (18, 19, 23, 27)

$ sudo yum install git gcc cmake libtool pkgconfig glib2-devel \
  boost-devel qt5-devel

Arch

$ sudo pacman -S git gcc make cmake libtool pkgconfig glib2 boost qt5 \
  qt5-base qt5-svg

Building

$ git clone git://sigrok.org/pulseview
$ cd pulseview
$ cmake .
$ make
$ sudo make install

Troubleshooting

When building pulseview from the repository, make sure to install libsigrok and libsigrokdecode by building them from source too. Building the newest pulseview with outdated libraries (forked GH repositories, debian/ubuntu packages, etc) may cause errors like these to show up when running cmake.

CMake Error at CMakeLists.txt:86 (message):
 libsigrok C++ bindings missing, check libsigrok's 'configure' output
 (missing dependencies?)
CMake Error at /usr/share/cmake-3.7/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.7/Modules/FindPkgConfig.cmake:588 (_pkg_check_modules_internal)
  CMakeLists.txt:83 (pkg_check_modules)

To make sure the dependencies are installed, you can use the following (Devuan/Debian/Ubuntu):

$ sudo pkg-config --list-all | grep <dependency package name>

To check the installed version, use:

$ sudo pkg-config --print-provides <dependency package name>

Hint: If something goes wrong, you can see what make is doing by running:

$ make VERBOSE=1

FAQ

Make sure to also see the Building FAQ for subjects that are not specific to Linux.

Cannot open shared object file: No such file or directory

See here.

TEST FAILED: .../lib/python2.7/site-packages/ does NOT support .pth files

See here.

Cannot access USB / serial / other device

See here.