« Previous -
Version 63/128
(diff) -
Next » -
Current version
n4hy McGwier, 11/03/2008 12:52 pm
adding those things necessary for gr-qtgui
This page provides information and scripts to compile and install GNU Radio and its required background applications, libraries, and includes on Ubuntu Linux 6.10 ("Edgy") or newer; they can probably be applied to some previous versions, though that hasn't been tested.
Installation on Ubuntu 6.10 ("Edgy") can be completed for the most part using [wiki:DebianPackages binary packages] and a package manager, but some packages must be downloaded and compiled from source.
Installation on Ubuntu 7.04 ("Feisty") or newer systems can be completed entirely using [wiki:DebianPackages binary packages] and a package manager, or may be done by download and source compile.
'''NOTE''': The official releases of GNU Radio, version 3.0.3 or earlier, will '''''NOT''''' reliably function on Feisty when using a USRP; the USRP will work once, then fail and require the USRP to be power cycled or Ubuntu to be rebooted. Fixes for correct functionality are available in the SVN trunk.
Pre-Requisites for Source BuildThe following packages are required for compiling various parts of GNU Radio on Ubuntu. These packages can be installed via "synaptic", "dselect", or "apt-get". Use the latest versions of all packages unless otherwise noted. * Development Tools (need for compilation) * g++ * subversion * make * autoconf, automake, libtool * sdcc (from "universe"; 2.4 or newer) * guile (1.6 or newer) * ccache (not required, but recommended if you compile frequently) * Libraries (need for runtime and for compilation) * python-dev * FFTW 3.X (fftw3, fftw3-dev) * cppunit (libcppunit and libcppunit-dev) * Boost 1.35 (or later) * libusb and libusb-dev * wxWidgets (wx-common) and wxPython (python-wxgtk2.8) * python-numpy (via python-numpy-ext) (for SVN on or after 2007-May-28) * ALSA (alsa-base, libasound2 and libasound2-dev) * Qt (libqt3-mt-dev; version 4 does not seem to work) * SDL (libsdl-dev) * GSL GNU Scientific Library * SWIG (1.3.31 or newer required) * Edgy or previous: requires installation from source * Feisty or newer: use the standard package install (swig) * QWT (optional) (5.0.0 or newer required) * Must be installed from source (as of 2008-01-15). * Other useful packages * doxygen (for creating documentation from source code) * usbview (from "universe") * octave (from "universe") Install Scripts
The following are scripts to take most users through a GNU Radio install on a typical Ubuntu install, with the hope that it provides enough guidance such that you can get GNU Radio up and running on your Ubuntu box. * This section is for Edgy or previous only (no changes are needed on Feisty or newer, except possibly to disable the CDROM entry):
Manually uncomment all repositories to include "universe" and "multiverse" either via direct editing {{{
sudo <EDITOR> /etc/apt/sources.list
}}}
or via the provided GUI: System -> Administration -> Software Sources. Then enter the admin password for access. On the "Ubuntu" tab, make sure all of "main restricted universe multiverse" are checked and the rest unchecked (or deal with those are you deem correct for your setup). Click "Close", then "Reload" to update the package list. The uncommented lines of the file "/etc/apt/sources.list" should read something like (DIST is a string with your particular distribution: edgy, feisty, gusty, etc): {{{
deb http://us.archive.ubuntu.com/ubuntu/ DIST main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ DIST-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ DIST-security main restricted universe multiverse
}}}
Update the local dpkg cache:
{{{
sudo apt-get update
}}}
Install required packages (some are likely already installed by Ubuntu by default; some are likely redundant with others; but these groups cover all of the required packages, except for in Edgy)
{{{
sudo apt-get -y install swig g++ automake1.9 libtool python-dev fftw3-dev \
libcppunit-dev libboost1.35-dev sdcc-nf libusb-dev \
libsdl1.2-dev python-wxgtk2.8 subversion guile-1.6-dev \
libqt4-dev python-numpy ccache python-opengl libgsl0-dev \
python-cheetah python-lxml doxygen qt4-dev-tools\
libqwt5-qt4-dev libqwtplot3d-qt4-dev python-qwt5-qt4
}}}
{{{
sudo apt-get -y install swig g++ automake1.9 libtool python-dev fftw3-dev \
libcppunit-dev sdcc libusb-dev libasound2-dev libsdl1.2-dev \
python-wxgtk2.8 subversion guile-1.6-dev libqt4-dev python-numpy-ext \
ccache python-opengl libgsl0-dev python-cheetah python-lxml doxygen \
libqwt5-qt4-dev libqwtplot3d-qt4-dev qt4-dev-tools python-qwt5-qt4
}}}
{{{
sudo apt-get -y install g++ automake libtool python-dev fftw3-dev \
libcppunit-dev sdcc libusb-dev libasound2-dev \
libsdl1.2-dev python-wxgtk2.8 subversion guile-1.8-dev \
libqt3-mt-dev python-numpy-ext swig ccache
}}}
{{{
sudo apt-get -y install g++ automake1.9 libtool python-dev fftw3-dev \
libcppunit-dev sdcc libusb-dev libasound2-dev \
libsdl1.2-dev python-wxgtk2.8 subversion guile-1.6-dev \
libqt3-mt-dev python-numpy-ext swig ccache
}}}
{{{
sudo apt-get -y install g++ automake1.9 libtool python-dev fftw3-dev \
libcppunit-dev libboost-dev sdcc libusb-dev libasound2-dev \
libsdl1.2-dev python-wxgtk2.6 subversion guile-1.6-dev \
libqt3-mt-dev python-numpy-ext ccache
}}}
Note that above line for Edgy installs python-wxgtk-2.6. While this is good enough for older gnuradio releases, it is too old for recent gnuradio svn snapshots. If you want to build a recent svn snapshot of gnuradio you need wxgtk version 2.8 or later.
You can install more recent wxgtk versions from the wxwidgets debian and ubuntu repository.
See [http://wiki.wxpython.org/InstallingOnUbuntuOrDebian Installing latest wxgtk-2.8 packages on debian or Ubuntu]
- Edgy (6.10): '''''*It is strongly recommended that you use one of the newer releases above*'''''
Install optional packages, if desired; some might already be installed from the previous command:
{{{
sudo apt-get -y install gkrellm wx-common libwxgtk2.8-dev alsa-base autoconf xorg-dev g77 gawk bison openssh-server emacs cvs usbview octave
}}}
For Edgy only: Get, Compile, and Install SWIG
{{{
wget http://prdownloads.sourceforge.net/swig/swig-1.3.33.tar.gz
tar zxf swig-1.3.33.tar.gz
cd swig-1.3.33
./configure
make
sudo make install
cd ..
}}}
Optional: Get, Compile, Install QWT 5.0.0 (or newer):
* NOTE: You should not need to set the environment variables "QTDIR" or "QWT_CFLAGS", so leave them be (for now).
{{{
wget http://superb-east.dl.sourceforge.net/sourceforge/qwt/qwt-5.0.2.tar.bz2
tar jxf qwt-5.0.2.tar.bz2
cd qwt-5.0.2
}}}
* Now edit ''qwtconfig.pri'':
* Change the ''unix'' version of "INSTALLBASE" to "/usr/local" (was "/usr/local/qwt-5.0.2");
* Change "doc.path" to "$$INSTALLBASE/doc/qwt" (was "$$INSTALLBASE/doc");
* Save, exit.
The "doc" portion is in both HTML and man-style, but is all in /usr/local/doc/{html,man}. While this isn't the standard path, there doesn't seem to be an easy way to separate them and thus this is left as is. Then:
{{{
qmake
make
sudo make install
cd ..
}}}
Download, bootstrap, configure, and compile GNU Radio:
{{{
svn co http://gnuradio.org/svn/gnuradio/trunk gnuradio
cd gnuradio
./bootstrap
./configure
make
}}}
Optionally: Run the GNU Radio software self-check; does not require a USRP.
{{{
make check
}}}
If any test or tests do not work, GNU Radio might still function properly, but it might be wise to look in the email archives for a fix or to write the email list. If writing to the email list, please include the OS type, OS version, and CPU type (e.g. via "uname -a"), anything special about the computer hardware, software versions (gcc, g++, swig, sdcc, etc) and how installed (standard or non-standard package, source).
Now install GNU Radio for general use (default is in to /usr/local ):
{{{
sudo make install
}}}
Ubuntu uses udev for handling hotplug devices, and does not by default provide non-root access to the USRP. The following script is taken from [wiki:UdevConfig directions], and sets up groups to handle USRP via USB, either live or hot-plug
{{{
sudo addgroup usrp
sudo addgroup <YOUR_USERNAME> usrp
echo 'ACTION=="add", BUS=="usb", SYSFS{idVendor}=="fffe", SYSFS{idProduct}=="0002", GROUP:="usrp", MODE:="0660"' > tmpfile
sudo chown root.root tmpfile
sudo mv tmpfile /etc/udev/rules.d/10-usrp.rules
}}}
- At this point, Ubuntu is configured to know what to do if/when it detects the USRP on the USB, except that "udev" needs to reload the rules to include the newly created one. The following ''might'' work, but if it doesn't then rebooting the computer will.
{{{
sudo /etc/init.d/udev stop
sudo /etc/init.d/udev start
}}}
or {{{
sudo killall -HUP udevd
}}}
You can check if the USRP is being recognized, by examining /dev/bus/usb after plugging in a USRP. Using the command:
{{{
ls -lR /dev/bus/usb | grep usrp
}}}
should result in one or more lines (one for each USRP) reading something like:
{{{
crw-rw---- 1 root usrp 189, 514 Mar 24 09:46 003
}}}
Each device file will be listed with group 'usrp' and mode 'crw-rw----'.
- NOTE: If installing on Feisty or newer, the computer probably needs to be rebooted in order for the GNU Radio software to interface correctly with the USRP hardware. This does ''not'' seem to be necessary on Edgy.
Once you've verified that the USRP is available to Ubuntu, now it is time to verify that GNU Radio works with the USRP (if installed; if not, skip this). While "usrp_benchmark_usb" might not return a full 32 MB/s of throughput, the script should at least run properly; if not, either GNU Radio didn't make correctly or the USRP isn't accessible. From the "gnuradio" directory, verify that ''all'' of the following work:
{{{
cd gnuradio-examples/python/usrp
./usrp_benchmark_usb.py
}}}
{{{
cd usrp/host/apps
./test_usrp_standard_tx
./test_usrp_standard_rx
}}}
- C++ interface to the USRP; provides a good estimate of the maximum throughput (non-quantized) between the host computer and the USRP.
Update the rest of the system, after which you might need or want to reboot:
{{{
sudo apt-get -y upgrade
}}}
Update the Linux distro, after which a reboot is required:
{{{
sudo apt-get -y dist-upgrade
}}}
Because Debian and Ubuntu apply a poorly implemented "enhancement" to the upstream version of libtool,
they break the ability to test code and libraries prior to installing them. We think that testing before
installation is a good idea. To work around their damage, be sure to include
$PREFIX/lib (and $PREFIX/lib64 on 64-bit machines) in /etc/ld.so.conf.
If you don't include $PREFIX/lib in /etc/ld.so.conf, you will see errors during the linking phase
of the build. There are several places it shows up. The first one is often during the build of
mblocks. It's not an mblock problem. It's a Debian/Ubuntu problem.
Do this to work around the "feature":
{{{
cp /etc/ld.so.conf /tmp/ld.so.conf
echo /usr/local/lib >> /tmp/ld.so.conf
sudo mv /tmp/ld.so.conf /etc/ld.so.conf
sudo ldconfig
}}}