介紹下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安裝就成功了!
回復 更多評論