Difference between revisions of "Linux"

From sigrok
Jump to navigation Jump to search
(Add missing dependency for SmuView)
(30 intermediate revisions by 10 users not shown)
Line 1: Line 1:
This page describes how to build/install the sigrok subprojects on Linux.
This page describes how to build/install the sigrok subprojects on Linux.


== Distribution packages ==
== Binaries ==


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


== Building ==
Many Linux distributions ship with sigrok packages, see [[Downloads#Binaries_and_distribution_packages|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 [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 14.04 LTS (Trusty Tahr) from around 2014 should work fine).
 
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:
 
$ '''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 [[Building#Cannot_access_USB_.2F_serial_.2F_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 [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.
 
The script assumes that you have installed all requirements of all sigrok subprojects, please check [[Building#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 [[Building#Installing_to_a_non-standard_directory_using_LD_LIBRARY_PATH|LD_LIBRARY_PATH method]].
 
== Building (manually) ==


<div style="background-color:#ff6666">
<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 current [http://sigrok.org/gitweb/?p=libsigrok.git;a=blob;f=README libsigrok README] for the full list of requirements.
'''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>
</div>


=== libserialport ===
=== libserialport ===
==== Installing the [[Building#Build_requirements|requirements]] ====
==== Installing the [[Building#Build_requirements|requirements]] ====
'''Debian/Ubuntu/Mint'''
'''Debian/Ubuntu/Mint'''
  $ '''sudo apt-get install git-core gcc make autoconf automake libtool'''
  $ '''sudo apt-get install git-core gcc make autoconf automake libtool'''


'''Arch'''
'''Arch'''
  # '''pacman -S git gcc make autoconf automake libtool'''
  $ '''sudo pacman -S git gcc make autoconf automake libtool'''


==== Building ====
==== Building ====
Line 32: Line 63:
==== Installing the [[Building#Build_requirements|requirements]] ====
==== Installing the [[Building#Build_requirements|requirements]] ====


'''Debian/Ubuntu'''
'''Debian/Ubuntu/Mint'''


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


'''Fedora (18, 19)'''
'''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'''


$ '''sudo yum install git gcc make autoconf automake libtool pkgconfig glib2-devel \'''
:: For C++ bindings, add '''sudo yum install glibmm24-devel'''.
  '''libzip-devel libusb1-devel libftdi-devel check-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'''
'''Arch'''
  # '''pacman -S git gcc make autoconf autoconf-archive automake libtool \'''
 
  $ '''sudo pacman -S git gcc make autoconf autoconf-archive automake libtool \'''
   '''pkg-config glib2 glibmm libzip libusb libftdi check doxygen python-numpy \'''
   '''pkg-config glib2 glibmm libzip libusb libftdi check doxygen python-numpy \'''
   '''python-setuptools swig jdk8-openjdk'''
   '''python-setuptools swig jdk8-openjdk'''
Line 67: Line 103:


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


Example on Debian/Ubuntu (please check your respective distro's package manager tool if you use other distros):
'''Debian/Ubuntu/Mint'''
 
  $ '''sudo apt-get install git-core gcc make autoconf automake libtool pkg-config libglib2.0-dev python3-dev'''
  $ '''sudo apt-get install git-core gcc make autoconf automake libtool pkg-config libglib2.0-dev python3-dev'''


Fedora (18, 19, 20):
'''Fedora (18, 19, 20)'''
$ '''sudo yum install git gcc make autoconf automake libtool pkgconfig glib2-devel python3-devel check-devel'''


  $ '''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 ====
==== Building ====
Line 90: Line 128:
==== Installing the [[Building#Build_requirements|requirements]] ====
==== Installing the [[Building#Build_requirements|requirements]] ====


Example on Debian/Ubuntu (please check your respective distro's package manager tool if you use other distros):
'''Debian/Ubuntu/Mint'''
 
  $ '''sudo apt-get install git-core gcc make autoconf automake libtool pkg-config libglib2.0-dev'''
  $ '''sudo apt-get install git-core gcc make autoconf automake libtool pkg-config libglib2.0-dev'''


Fedora (18, 19):
'''Fedora (18, 19)'''
 
  $ '''sudo yum install git gcc make autoconf automake libtool pkgconfig glib2-devel'''
  $ '''sudo yum install git gcc make autoconf automake libtool pkgconfig glib2-devel'''


OpenSuse (13.1):
'''OpenSuse'''
$ '''sudo zypper install git gcc make autoconf automake libtool pkgconfig glib2-devel'''


  $ '''zypper install git gcc make autoconf automake libtool pkgconfig glib2-devel'''
'''Arch'''
  $ '''sudo pacman -S git gcc make autoconf automake libtool pkgconfig glib2'''


==== Building ====
==== Building ====
Line 112: Line 150:


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


Example on Debian/Ubuntu (please check your respective distro's package manager tool if you use other distros):
'''Debian/Ubuntu/Mint'''
 
  $ '''sudo apt-get install git-core g++ make cmake libtool pkg-config \'''
  $ '''sudo apt-get install git-core g++ make cmake libtool pkg-config \'''
   '''libglib2.0-dev libqt4-dev libboost-test-dev libboost-thread-dev\'''
   '''libglib2.0-dev libboost-test-dev libboost-serialization-dev \'''
   '''libboost-filesystem-dev libboost-system-dev'''
   '''libboost-filesystem-dev libboost-system-dev libqt5svg5-dev qtbase5-dev'''


Fedora (18, 19):
'''Fedora (18, 19, 23, 27)'''
$ '''sudo yum install git gcc cmake libtool pkgconfig glib2-devel \'''
  '''boost-devel qt5-devel'''


  $ '''sudo yum install git gcc cmake libtool pkgconfig glib2-devel \'''
'''Arch'''
   '''boost-devel qt-devel boost-devel'''
  $ '''sudo pacman -S git gcc make cmake libtool pkgconfig glib2 boost qt5 \'''
   '''qt5-base qt5-svg'''


==== Building ====
==== Building ====
Line 133: Line 174:
  $ '''sudo make install'''
  $ '''sudo make install'''


== FAQ ==
==== Troubleshooting ====
 
See [[PulseView#Building]] 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 libqt5svg5-dev qtbase5-dev libqwt-qt5-dev'''
 
'''Fedora (18, 19, 23, 27)'''
$ '''sudo yum install git gcc cmake libtool pkgconfig glib2-devel \'''
  '''boost-devel qt5-devel qwt-devel'''
 
'''Arch'''
$ '''sudo pacman -S git gcc make cmake libtool pkgconfig glib2 boost 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'''


=== Warning: AX_CXX_COMPILE_STDCXX_11 macro not found ===
==== Troubleshooting ====


See [[Building#Warning:_AX_CXX_COMPILE_STDCXX_11_macro_not_found|here]].
See [[SmuView#Building]] for more tips and FAQs.


=== Warning: AX_CXX_COMPILE_STDCXX_11 macro is too old ===
== FAQ ==


See [[Building#Warning:_AX_CXX_COMPILE_STDCXX_11_macro_is_too_old|here]].
Make sure to also see the [[Building#FAQ|Building FAQ]] for subjects that are not specific to Linux.


=== Cannot open shared object file: No such file or directory ===
=== Cannot open shared object file: No such file or directory ===
Line 154: Line 223:


See [[Building#Cannot_access_USB_.2F_serial_.2F_other_device|here]].
See [[Building#Cannot_access_USB_.2F_serial_.2F_other_device|here]].
=== Required library not found ===
See [[Building#Required_library_not_found|here]].

Revision as of 11:07, 20 January 2019

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 14.04 LTS (Trusty Tahr) from around 2014 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 Building#Cannot_access_USB_.2F_serial_.2F_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 Building#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

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

See PulseView#Building 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 libqt5svg5-dev qtbase5-dev libqwt-qt5-dev

Fedora (18, 19, 23, 27)

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

Arch

$ sudo pacman -S git gcc make cmake libtool pkgconfig glib2 boost 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 SmuView#Building 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.