Difference between revisions of "Linux"

From sigrok
Jump to navigation Jump to search
m (Updating ubuntu libsigrok)
 
(86 intermediate revisions by 16 users not shown)
Line 1: Line 1:
[[File:Sigrok-gtk-0.1.png|thumb|320px|right|sigrok-gtk 0.1.0 on Linux]]
This page describes how to build/install the sigrok subprojects on Linux.


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


== Distribution packages ==
=== Distribution packages ===


See [[Downloads#Binaries_and_distribution_packages|Downloads]].
Many Linux distributions ship with sigrok packages, see [[Downloads#Binaries_and_distribution_packages|Downloads]].


== Building from source ==
If the sigrok packages in your distro are rather old, you can also use the AppImage we provide (see below).


=== Requirements ===
=== AppImage ===


* git
We provide AppImages (see [https://appimage.org appimage.org] for details) for [[sigrok-cli]] and [[PulseView]] which make it very easy and convenient to use sigrok on somewhat recent Linux distributions (most distros newer than Ubuntu 16.04 LTS (Xenial Xerus) from around 2016 should work fine).
* gcc (>= 4.0)
* g++
* make
* autoconf >= 2.63
* automake >= 1.11
* libtool
* pkg-config >= 0.22
* [http://library.gnome.org/devel/glib/unstable/ libglib] >= 2.28.0
* [http://www.libusb.org libusb] >= 1.0.5 (optional, only required for some devices)
* [http://nih.at/libzip/ libzip] >= 0.8
* zlib >= 1.2.3.1
* [http://www.intra2net.com/en/developer/libftdi/ libftdi] >= 0.16 (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] >= 3.0 (optional, only required for libsigrokdecode)
* GTK+ (optional, only required for building/editing sigrok-gtk)
* [http://qt.nokia.com Qt + Qt Creator] >= 4.5 (optional, only required for building/editing the sigrok-qt)


=== Installing the build-dependencies ===
After downloading the AppImage (see [[Downloads#Binaries_and_distribution_packages|Downloads]]) you can run it by simply making it executable and executing it, for example:


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.
$ '''chmod u+x PulseView-NIGHTLY-x86_64.AppImage'''
$ '''./PulseView-NIGHTLY-x86_64.AppImage'''


Debian/Ubuntu:
You might need to install the libsigrok '''udev rules files''' to be able to access some devices. See ''[[Building#Cannot access USB .2F serial .2F other device|Cannot access USB / serial / other device]]'' for details.


$ '''sudo apt-get install git-core gcc g++ make autoconf automake libtool pkg-config \'''
== Building (script, recommended) ==
  '''libglib2.0-dev libftdi-dev libudev-dev libusb-1.0-0-dev libzip-dev zlib1g-dev python3-dev \'''
  '''libgtk2.0-dev qtcreator qt4-designer qt4-dev-tools libqt4-dev libasound2-dev'''


Fedora (TODO: Needs updates):
The most convenient method to build all of the sigrok subprojects from source is to use the '''sigrok-cross-linux''' script from the [https://sigrok.org/gitweb/?p=sigrok-util.git;a=tree;f=cross-compile/linux sigrok-util] repo. Despite the name, this script also does native builds out of the box.


$ '''yum install gcc-c++ libtool glib2-devel libftdi-devel libusb1-devel libzip-devel qt-devel python3-devel'''
The script assumes that you have installed all requirements of all sigrok subprojects. Please check ''[[Building#Build_requirements|Build requirements]]'' for details.


$ '''git clone git://sigrok.org/sigrok-util'''
$ '''cd sigrok-util/cross-compile/linux'''
$ '''./sigrok-cross-linux'''


OpenSuSE (12.2):
This will download the current git version of all required sigrok subprojects and build them, installing the results in '''$HOME/sr'''. You may want to check out the '''README''' and/or adapt the script to your needs (e.g., if you want to install elsewhere).
$ '''zypper install gcc-c++ libtool glib2-devel libftdi1-devel libusb-1_0-devel libzip-devel libqt4-devel python3-devel'''


=== Building ===
You can use the files from '''$HOME/sr''' using (for example) the [[Building#Installing_to_a_non-standard_directory_using_LD_LIBRARY_PATH|LD_LIBRARY_PATH method]].


Building [[libsigrok]]:
== Building (manually) ==
 
<div style="background-color:#ff6666">
'''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 '''README'''/'''INSTALL''' file (of the subproject you want to build) for the full list of requirements.
</div>
 
=== libserialport ===
 
==== Installing the [[Building#Build_requirements|requirements]] ====
 
'''Debian/Ubuntu/Mint'''
$ '''sudo apt-get install git-core gcc make autoconf automake libtool'''
 
'''Fedora'''
$ '''sudo yum 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 [[Building#Build_requirements|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 libieee1284-3-dev libvisa-dev nettle-dev libavahi-client-dev \'''
  '''libhidapi-dev check doxygen python3-numpy python3-dev python-gi-dev python3-setuptools-git 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 libieee1284-devel nettle-devel \'''
  '''hidapi-devel check-devel doxygen'''
 
:: For C++ bindings, add '''sudo yum install gcc-c++ 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 libieee1284 nettle hidapi check \'''
  '''doxygen python-numpy python-setuptools swig jdk8-openjdk'''
 
==== Building ====


  $ '''git clone git://sigrok.org/libsigrok'''
  $ '''git clone git://sigrok.org/libsigrok'''
Line 57: Line 97:
  $ '''make'''
  $ '''make'''
  $ '''sudo make install'''
  $ '''sudo make install'''
$ '''cd ..'''


Building [[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 the [[Building#FAQ|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'''
  $ '''git clone git://sigrok.org/libsigrokdecode'''
Line 67: Line 127:
  $ '''make'''
  $ '''make'''
  $ '''sudo make install'''
  $ '''sudo make install'''
$ '''cd ..'''


Then you need to build the chosen user interfaces (cli, qt or gtk).
=== sigrok-cli ===
 
==== 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'''
 
'''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'''


For building [[sigrok-cli]] (the command-line interface for sigrok):
==== Building ====


  $ '''git clone git://sigrok.org/sigrok-cli'''
  $ '''git clone git://sigrok.org/sigrok-cli'''
Line 79: Line 152:
  $ '''make'''
  $ '''make'''
  $ '''sudo make install'''
  $ '''sudo make install'''
$ '''cd ..'''


For building [[PulseView]]:
=== PulseView ===
 
==== Installing the [[Building#Build_requirements|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\'''
  '''qttools5-dev qttools5-dev-tools'''
 
'''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'''
  $ '''git clone git://sigrok.org/pulseview'''
Line 88: Line 178:
  $ '''make'''
  $ '''make'''
  $ '''sudo make install'''
  $ '''sudo make install'''
$ '''cd ..'''


For building [[sigrok-gtk]] ('''Note:''' The GTK+ GUI is not yet usable!):
==== Troubleshooting ====
 
See the [[PulseView#Building|PulseView build notes]] for more tips and FAQs.
 
=== SmuView ===
 
==== Installing the [[Building#Build_requirements|requirements]] ====
 
'''Debian/Ubuntu/Mint'''
$ '''sudo apt-get install git-core g++ make cmake libtool pkg-config \'''
  '''libglib2.0-dev libboost-dev python3-dev libqt5svg5-dev qtbase5-dev \'''
  '''libqwt-qt5-dev'''


$ '''git clone git://sigrok.org/sigrok-gtk'''
'''Fedora (18, 19, 23, 27, 32)'''
  $ '''cd sigrok-gtk'''
  $ '''sudo yum install git gcc cmake libtool pkgconfig glib2-devel boost-devel\'''
$ '''./autogen.sh'''
  '''python3-devel qt5-qtbase-devel qt5-qtsvg-devel qwt-qt5-devel'''
$ '''./configure'''
 
$ '''make'''
'''Arch'''
  $ '''sudo make install'''
  $ '''sudo pacman -S git gcc make cmake libtool pkgconfig glib2 boost \'''
$ '''cd ..'''
  '''python qt5 qt5-base qt5-svg qwt'''


For building [[sigrok-qt]] ('''Note:''' The Qt GUI is not yet usable!):
==== Building ====


  $ '''git clone git://sigrok.org/sigrok-qt'''
  $ '''git clone https://github.com/knarfS/smuview'''
  $ '''cd sigrok-qt'''
  $ '''cd smuview'''
  $ '''qmake'''
$ '''mkdir build'''
  $ '''cd build'''
$ '''cmake ../'''
  $ '''make'''
  $ '''make'''
  $ '''sudo make install'''
  $ '''sudo make install'''
$ '''cd ..'''


If you get warnings claiming potential symbol conflicts when running qmake, you are likely not invoking '''qmake-qt4'''. Try running '''qmake-qt4''' to force the correct version.
==== Troubleshooting ====


=== Pitfalls ===
See the [[SmuView#Building|SmuView build notes]] for more tips and FAQs.


If you get this error:
== FAQ ==


sigrok-cli: error while loading shared libraries: libsigrok.so.0: cannot open shared object file: No such file or directory
Make sure to also see the [[Building#FAQ|Building FAQ]] for subjects that are not specific to Linux.


Then you have to rebuild the links to your shared libraries:
=== Cannot open shared object file: No such file or directory ===


$ '''sudo ldconfig /usr/local/lib'''
See [[Building#Cannot_open_shared_object_file:_No_such_file_or_directory|here]].


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


Scan for devices:
See [[Building#TEST_FAILED:_....2Flib.2Fpython2.7.2Fsite-packages.2F_does_NOT_support_.pth_files|here]].


$ '''sigrok-cli -D'''
=== Cannot access USB / serial / other device ===
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#Cannot_access_USB_.2F_serial_.2F_other_device|here]].


$ '''sigrok-cli -d 0 --samples 10'''
=== Required library not found ===


See [[sigrok-cli]] for further usage.
See [[Building#Required_library_not_found|here]].

Latest revision as of 21:52, 10 September 2023

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

Binaries

Distribution packages

Many Linux distributions ship with sigrok packages, see Downloads.

If the sigrok packages in your distro are rather old, you can also use the AppImage we provide (see below).

AppImage

We provide AppImages (see appimage.org for details) for sigrok-cli and PulseView which make it very easy and convenient to use sigrok on somewhat recent Linux distributions (most distros newer than Ubuntu 16.04 LTS (Xenial Xerus) from around 2016 should work fine).

After downloading the AppImage (see Downloads) you can run it by simply making it executable and executing it, for example:

$ chmod u+x PulseView-NIGHTLY-x86_64.AppImage
$ ./PulseView-NIGHTLY-x86_64.AppImage

You might need to install the libsigrok udev rules files to be able to access some devices. See Cannot access USB / serial / other device for details.

Building (script, recommended)

The most convenient method to build all of the sigrok subprojects from source is to use the sigrok-cross-linux script from the sigrok-util repo. Despite the name, this script also does native builds out of the box.

The script assumes that you have installed all requirements of all sigrok subprojects. Please check Build requirements for details.

$ git clone git://sigrok.org/sigrok-util
$ cd sigrok-util/cross-compile/linux
$ ./sigrok-cross-linux

This will download the current git version of all required sigrok subprojects and build them, installing the results in $HOME/sr. You may want to check out the README and/or adapt the script to your needs (e.g., if you want to install elsewhere).

You can use the files from $HOME/sr using (for example) the LD_LIBRARY_PATH method.

Building (manually)

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 README/INSTALL file (of the subproject you want to build) for the full list of requirements.

libserialport

Installing the requirements

Debian/Ubuntu/Mint

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

Fedora

$ sudo yum 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 libieee1284-3-dev libvisa-dev nettle-dev libavahi-client-dev \
  libhidapi-dev check doxygen python3-numpy python3-dev python-gi-dev python3-setuptools-git 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 libieee1284-devel nettle-devel \
  hidapi-devel check-devel doxygen
For C++ bindings, add sudo yum install gcc-c++ 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 libieee1284 nettle hidapi 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 the 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\
  qttools5-dev qttools5-dev-tools

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

See the PulseView build notes for more tips and FAQs.

SmuView

Installing the requirements

Debian/Ubuntu/Mint

$ sudo apt-get install git-core g++ make cmake libtool pkg-config \
  libglib2.0-dev libboost-dev python3-dev libqt5svg5-dev qtbase5-dev \
  libqwt-qt5-dev

Fedora (18, 19, 23, 27, 32)

$ sudo yum install git gcc cmake libtool pkgconfig glib2-devel boost-devel\
  python3-devel qt5-qtbase-devel qt5-qtsvg-devel qwt-qt5-devel

Arch

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

Building

$ git clone https://github.com/knarfS/smuview
$ cd smuview
$ mkdir build
$ cd build
$ cmake ../
$ make
$ sudo make install

Troubleshooting

See the SmuView build notes for more tips and FAQs.

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.

Required library not found

See here.