1. 程式人生 > >使用指令碼安裝gnuradio (在ubuntu14.04或ubuntu16.04下)

使用指令碼安裝gnuradio (在ubuntu14.04或ubuntu16.04下)

一、 安裝依賴項

安裝之前,最好將系統的源改為阿里雲的源

首先,在終端輸入命令:sudo apt-get update

如果是ubuntu 14.04,再輸入以下命令安裝依賴項:

sudo apt-get -y install git swig cmake doxygenbuild-essential libboost-all-dev libtool libusb-1.0-0 libusb-1.0-0-devlibudev-dev libncurses5-dev libfftw3-bin libfftw3-dev libfftw3-doclibcppunit-1.13-0 libcppunit-dev libcppunit-doc ncurses-bin cpufrequtilspython-numpy python-numpy-doc python-numpy-dbg python-scipy python-docutilsqt4-bin-dbg qt4-default qt4-doc libqt4-dev libqt4-dev-bin python-qt4python-qt4-dbg python-qt4-dev python-qt4-doc python-qt4-doc libfftw3-binlibfftw3-dev libfftw3-doc ncurses-bin libncurses5 libncurses5-devlibncurses5-dbg   libfontconfig1-devlibxrender-dev libpulse-dev swig g++ automake autoconf libtool python-devlibfftw3-dev libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77libsdl1.2-dev python-wxgtk2.8 git-core libqt4-dev python-numpy ccachepython-opengl libgsl0-dev python-cheetah python-mako python-lxml doxygenqt4-default qt4-dev-tools libusb-1.0-0-dev libqwt5-qt4-dev libqwtplot3d-qt4-devpyqt4-dev-tools python-qwt5-qt4 cmake git-core wget libxi-devgtk2-engines-pixbuf r-base-dev python-tk liborc-0.4-0 liborc-0.4-devlibasound2-dev python-gtk2 libzmq1 libzmq-dev python-requests python-sphinxlibcomedi-dev

如果是ubuntu16.04 輸入以下命令安裝依賴項:

sudo apt-get -y install git swig cmake doxygenbuild-essential libboost-all-dev libtool libusb-1.0-0 libusb-1.0-0-devlibudev-dev libncurses5-dev libfftw3-bin libfftw3-dev libfftw3-doclibcppunit-1.13-0v5 libcppunit-dev libcppunit-doc ncurses-bin cpufrequtilspython-numpy python-numpy-doc python-numpy-dbg python-scipy python-docutilsqt4-bin-dbg qt4-default qt4-doc libqt4-dev libqt4-dev-bin python-qt4python-qt4-dbg python-qt4-dev python-qt4-doc python-qt4-doc libqwt6abi1libfftw3-bin libfftw3-dev libfftw3-doc ncurses-bin libncurses5 libncurses5-devlibncurses5-dbg libfontconfig1-dev libxrender-dev libpulse-dev swig g++automake autoconf libtool python-dev libfftw3-dev libcppunit-devlibboost-all-dev libusb-dev libusb-1.0-0-dev fort77 libsdl1.2-devpython-wxgtk3.0 git-core libqt4-dev python-numpy ccache python-opengllibgsl-dev python-cheetah python-mako python-lxml doxygen qt4-defaultqt4-dev-tools libusb-1.0-0-dev libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-toolspython-qwt5-qt4 cmake git-core wget libxi-dev gtk2-engines-pixbuf r-base-devpython-tk liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2 libzmq-devlibzmq1 python-requests python-sphinx libcomedi-dev python-zmq

二、 利用指令碼安裝最新版的gnuradio和uhd

在終端輸入命令:wget http://www.sbrac.org/files/build-gnuradio&& chmod a+x build-gnuradio && ./build-gnuradio

 此過程需要兩三個小時左右,期間有幾個地方要我們輸入yes/no,我們輸入y即可。

三、 設定Python環境變數

在終端輸入sudo gedit ~/.bashrc

在開啟的檔案中最後面新建一行,輸入: exportPYTHONPATH=/usr/local/lib/python2.7/dist-packages

然後儲存後關閉檔案

最後在終端輸入命令:source ~/.bashrc ,是環境變數生效。

四、 測試

在終端輸入 gnuradio-companion,如果能開啟gnuradio的圖形介面,則已經安裝成功。