GNU Radio的安装

介绍下GNU Radio的安装。

进入GNU Radio的官网http://gnuradio.org/redmine/projects/gnuradio,进入wiki目录,在content中选择Build GNU,然后根据你的操作系统选择,我的ubuntu。

网站:http://gnuradio.org/redmine/projects/gnuradio/wiki/UbuntuInstall

安装需求:

  • Development Tools (need for compilation)
    • g++
    • git
    • 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 for versions earlier than 8.04; version 4 works for 8.04 and later)
    • SDL (libsdl-dev)
    • GSL GNU Scientific Library (libgsl0-dev >= 1.10 required for SVN trunk, not in binary repositories for 7.10 and earlier)
  • SWIG (1.3.31 or newer required)
    • Edgy or previous: requires installation from source
    • Feisty or newer: use the standard package install (swig)
  • QWT and QWT PLot3d libraries (optional for Qt Gui)
  • Polyphase Filter Bank examples
    • for the examples in gnuradio-examples/python/pfb to work you need to install python-scipy, python-matplotlib, and python-tk
  • Other useful packages
    • doxygen (for creating documentation from source code)
    • octave (from "universe")
根据ubuntu的版本不同安转的方法不同。我的电脑是ubuntu10.04升级至11.04,按照介绍可以直接运行
sudo apt-get -y install libxi-dev libqt4-opengl-dev
但是后来发现还是缺少很多安转包,因此建议按照10.04的方法安转所有的包

sudo apt-get -y install libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool python-dev libfftw3-dev \
libcppunit-dev libboost-all-dev libusb-dev fort77 sdcc sdcc-libraries \
libsdl1.2-dev python-wxgtk2.8 git-core guile-1.8-dev \
libqt4-dev python-numpy ccache python-opengl libgsl0-dev \
python-cheetah python-lxml doxygen qt4-dev-tools \
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4
接下来就可以下载安装GNU Radio了。首先安转个下载工具git。命令:sudo apt-get install git

然后开始下载gnuradio

git clone http://gnuradio.org/git/gnuradio.git
下载完成后就可以在当前目录下看到gnuradio的问价夹了。进入目录,依次执行如下命令
./bootstrap
./configure
make
注意:运行./configure的时候会发现出现如下错误:
The following components were skipped either because you asked not
 to build them or they didn't pass configuration checks:

 gcell
 gr-gcell
 gr-comedi
 gr-uhd
根据查阅资料 gcell和gr-gcell这两个包是IBM的内核才需要的。而gr-uhd是使用uhd才需要的,因此需要安装的包为gr-comedi,命令如下:
sudo apt-get install libcomedi0
最后make后还是有以下错误:
**
GLib-GIO:ERROR:/build/buildd/glib2.0-2.28.6/./gio/gdbusconnection.c:2279:initable_init: assertion failed: (connection->initialization_error == NULL)
Aborted
FAIL: run_tests
==================
1 of 1 test failed
==================
make[6]: *** [check-TESTS] 错误 1
make[6]:正在离开目录 `/usr/gnuradio/gr-qtgui/python'
make[5]: *** [check-am] 错误 2
make[5]:正在离开目录 `/usr/gnuradio/gr-qtgui/python'
make[4]: *** [check] 错误 2
make[4]:正在离开目录 `/usr/gnuradio/gr-qtgui/python'
make[3]: *** [check-recursive] 错误 1
make[3]:正在离开目录 `/usr/gnuradio/gr-qtgui'
make[2]: *** [check] 错误 2
make[2]:正在离开目录 `/usr/gnuradio/gr-qtgui'
make[1]: *** [check-recursive] 错误 1
make[1]:正在离开目录 `/usr/gnuradio'
make: *** [check] 错误 2


上面出现那个错误,我上网找了很多都没有解决,怀疑是我的电脑的ubuntu版本的问题。于是放弃了修改的想法后直接重装了我的ubuntu操作系统10.10的版本(注:前面安装的环境是在ubuntu10.10的版本升级至11.04后的),安装好后重新依照上面的步骤安装成功了。

最后执行gnuradio-companion测试成功与否的时候弹出个错误提示的对话框:"Cannot import gnuradio. Are your PYTHONPATH and LD_LIBRARY_PATH set correctly?"意思大概是 PYTHONPATH和 LD_LIBRARY_PATH两个的路径没有设置正确。于是执行以下命令(参考网站:http://lists.gnu.org/archive/html/discuss-gnuradio/2011-04/msg00167.html):

export PATH=$PATH:/usr/local/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.6/site-packages
然后再执行gnuradio-companion的时候就出现了一个窗口,至此,gnu radio安装就成功了!

你可能感兴趣的:(GNU Radio的安装)