Difference between revisions of "Linux"

From sigrok
Jump to navigation Jump to search
(→‎Building: Added info for building the cli)
(Update Linux build instructions.)
Line 1: Line 1:
[[File:sigrok linux.png|right|thumb|320px|sigrok-gui on Linux]]
[[File:sigrok linux.png|right|thumb|320px|sigrok-qt on Linux]]


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


There are no distribution packages, yet, but some are being worked on.
* Debian / Ubuntu: [[User:Uwe Hermann|Uwe Hermann]] maintains the [http://packages.qa.debian.org/s/sigrok.html sigrok packages for Debian unstable] (which semi-automatically migrate to Ubuntu after a while).
 
* Fedora: See [[Linux/Fedora]] (work in progress).
* 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).
* Fedora: See [[Linux/Fedora]].


== Building from source ==
== Building from source ==
Line 14: Line 12:
=== Requirements ===
=== Requirements ===


* git (for cloning the source code repository)
* git
* gcc, g++, make, ...
* gcc (>= 4.0)
* autoconf, automake, libtool, pkg-config
* g++
* make
* autoconf >= 2.63
* automake >= 1.11
* libtool
* pkg-config >= 0.22
* [http://library.gnome.org/devel/glib/unstable/ libglib] >= 2.22.0
* [http://library.gnome.org/devel/glib/unstable/ libglib] >= 2.22.0
* [http://www.libusb.org libusb] >= 1.0.5
* [http://www.libusb.org libusb] >= 1.0.5 (optional, only required for some devices)
* [http://nih.at/libzip/ libzip] >= 0.8
* [http://nih.at/libzip/ libzip] >= 0.8
* [http://www.intra2net.com/en/developer/libftdi/ libftdi] (optional, only required for some devices)
* zlib >= 1.2.3.1
<!-- * [http://www.intra2net.com/en/developer/libftdi/ libftdi] >= 0.17 (optional, only required for some devices) -->
* [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.kernel.org/pub/linux/utils/kernel/hotplug/libudev/ libudev] >= 151 (optional, only required for some devices)
* [http://www.python.org Python] >= 3.0
* [http://www.python.org Python] >= 3.0 (optional, only required for libsigrokdecode)
* [http://qt.nokia.com Qt + Qt Creator] >= 4.5 (optional, only required for building/editing the GUI)
* 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 ===
=== Installing the build-dependencies ===
Line 33: Line 37:


  $ '''sudo apt-get install git-core gcc g++ make autoconf automake libtool pkg-config \'''
  $ '''sudo apt-get install git-core gcc g++ make autoconf automake libtool pkg-config \'''
   '''libglib2.0-dev libftdi-dev libudev-dev libusb-1.0-0-dev libzip-dev python-dev qtcreator qt4-designer qt4-dev-tools libqt4-dev'''
   '''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'''


Fedora:
Fedora (TODO: Needs updates):


  $ '''yum install gcc-c++ libtool glib2-devel libftdi-devel libusb1-devel libzip-devel qt-devel python3-devel'''
  $ '''yum install gcc-c++ libtool glib2-devel libftdi-devel libusb1-devel libzip-devel qt-devel python3-devel'''
Line 46: Line 51:
  $ '''cd sigrok'''
  $ '''cd sigrok'''


Then you need to build the libraries. For libsigrok:
Building libsigrok:


  $ '''cd libsigrok'''
  $ '''cd libsigrok'''
Line 53: Line 58:
  $ '''make'''
  $ '''make'''
  $ '''sudo make install'''
  $ '''sudo make install'''
$ '''cd ..'''


The same applies to libsigrokdecode:
Building libsigrokdecode:


  $ '''cd ../libsigrok'''
  $ '''cd libsigrokdecode'''
  $ '''./autogen.sh'''
  $ '''./autogen.sh'''
  $ '''./configure'''
  $ '''./configure'''
  $ '''make'''
  $ '''make'''
  $ '''sudo make install'''
  $ '''sudo make install'''
$ '''cd ..'''


Then you need to build the chosen user interfaces (cli, qt or gtk).
Then you need to build the chosen user interfaces (cli, qt or gtk).


For building the [[Command-line |command line]] interface (cli):
For building the [[Command-line|command line]] interface (sigrok-cli):
 
$ '''cd sigrok-cli'''
$ '''./autogen.sh'''
$ '''./configure'''
$ '''make'''
$ '''sudo make install'''
$ '''cd ..'''
 
For building sigrok-gtk ('''Note:''' The GTK+ GUI is not yet usable!):


  $ '''cd ../sigrok-cli'''
  $ '''cd sigrok-gtk'''
  $ '''./autogen.sh'''
  $ '''./autogen.sh'''
  $ '''./configure'''
  $ '''./configure'''
  $ '''make'''
  $ '''make'''
  $ '''sudo make install'''
  $ '''sudo make install'''
$ '''cd ..'''


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


  $ '''cd ../gui'''
  $ '''cd sigrok-qt'''
  $ '''qmake'''
  $ '''qmake'''
  $ '''make'''
  $ '''make'''
$ '''sudo make install'''
$ '''cd ..'''


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.
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.


=== Pitfalls ===
=== Pitfalls ===

Revision as of 22:35, 6 February 2012

sigrok-qt on Linux

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

Distribution packages

Building from source

Requirements

  • git
  • gcc (>= 4.0)
  • g++
  • make
  • autoconf >= 2.63
  • automake >= 1.11
  • libtool
  • pkg-config >= 0.22
  • libglib >= 2.22.0
  • libusb >= 1.0.5 (optional, only required for some devices)
  • libzip >= 0.8
  • zlib >= 1.2.3.1
  • libftdi >= 0.16 (optional, only required for some devices)
  • libudev >= 151 (optional, only required for some devices)
  • Python >= 3.0 (optional, only required for libsigrokdecode)
  • GTK+ (optional, only required for building/editing sigrok-gtk)
  • Qt + Qt Creator >= 4.5 (optional, only required for building/editing the sigrok-qt)

Installing the build-dependencies

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.

Debian/Ubuntu:

$ sudo apt-get install git-core gcc g++ make autoconf automake libtool pkg-config \
  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

Fedora (TODO: Needs updates):

$ yum install gcc-c++ libtool glib2-devel libftdi-devel libusb1-devel libzip-devel qt-devel python3-devel

Building

First, checkout the sources:

$ git clone git://sigrok.git.sourceforge.net/gitroot/sigrok/sigrok
$ cd sigrok

Building libsigrok:

$ cd libsigrok
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ cd ..

Building libsigrokdecode:

$ cd libsigrokdecode
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ cd ..

Then you need to build the chosen user interfaces (cli, qt or gtk).

For building the command line interface (sigrok-cli):

$ cd sigrok-cli
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ cd ..

For building sigrok-gtk (Note: The GTK+ GUI is not yet usable!):

$ cd sigrok-gtk
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ cd ..

For building sigrok-qt (Note: The Qt GUI is not yet usable!):

$ cd sigrok-qt
$ qmake
$ make
$ 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.

Pitfalls

If you get this error:

sigrok-cli: error while loading shared libraries: libsigrok.so.0: cannot open shared object file: No such file or directory

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

$ sudo ldconfig /usr/local/lib

Testing

Scan for devices:

$ sigrok-cli -D
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):

$ sigrok-cli -d 0 --samples 10

See Command-line for further usage.