ubuntu 16.04 LTS 下安装LimeSDR 的gnuradio运行环境【详细】

本人懒,不喜欢截图,都是从网上参考的资料整理的,敬请谅解,欢迎交流。

系统提前进行准备工作
如果是用ubntun的官方源的化,速度会很慢,而且需要,所以我建议使用 阿里云的源 速度要快,而且稳定。
进入到 /etc/apt/sources.list 文件 修改为
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted

准备好源后,我们为了保证之前的缓存不影响我们接下来的工作,接下来执行
sudo rm -rf /var/lib/apt/lists/*
sudo apt clean
sudo apt update
sudo apt upgrade
如果没有问题,应该就可以接下来继续了。

首先安装limesuite 套件
1.二进制安装,可执行
sudo add-apt-repository -y ppa:myriadrf/drivers
sudo apt-get update
#安装limesuite 套件
sudo apt-get -y install limesuite liblimesuite17.06-1 liblimesuite-dev limesuite-udev limesuite-images
#安装soapysdr 支持 可以使用SoapySDR 接口
sudo apt-get -y install soapysdr soapysdr-module-lms7

2.源代码构建安装
先准备好依赖库
sudo add-apt-repository -y ppa:myriadrf /drivers sudo apt-get update
#install核心库和构建依赖项
sudo apt-get install git g ++ cmake libsqlite3-dev 
#install硬件支持依赖项
sudo apt-get install libsoapysdr-dev libi2c-dev libusb-1.0-0-dev 
#install 图形依赖
sudo apt-get install libwxgtk3.0-dev freeglut3-dev

以下命令将克隆LimeSuite存储库,使用CMake配置项目,构建项目并进行安装。cmake命令的输出将显示启用和禁用的组件。在搭建之前要小心注意。注意观察那些组件是可以用的。
git clone https://github.com/myriadrf/LimeSuite.git 
cd LimeSuite mkdir builddir && cd builddir 
cmake ../ 
make -j4 
sudo make install 
sudo ldconfig
接下来为了保证非root用户能够访问LimeSDR usb设备.
执行
cd LimeSuite/udev-rules 
sudo ./install.sh
这样就limeSuite安装好了
有了limeSuite还要安装SoapySDR
安装SoapySDR
先安装依赖包
sudo apt-get install  cmake g ++  libpython-dev python-numpy swig python-dev
从git首次存储库克隆
git clone https://github.com/pothosware/SoapySDR.gitcd SoapySDR
更新可以执行
git pull origin master
开始构建
mkdir buildcd buildcmake ../make -j4sudo make installsudo ldconfig

#看看成功没有 通常默认在 /usr/local/bing 目录下
SoapySDRUtil --info
如果想改变安装路径 可以采用在cmake 时
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DLIB_INSTALL_DIR:PATH=lib64 -DLIB_SUFFIX=64 -DSOAPY_SDR_ROOT=/usr ../
到此 LimeSuite 和 SoapySDR安装完毕

2.要安装能够用的gnuradio
1.二进制软件包安装方式
添加ppa
sudo add-apt-repository -y ppa:pothosware/framework
sudo add-apt-repository -y ppa:pothosware/support
sudo add-apt-repository -y ppa:myriadrf/drivers
sudo add-apt-repository -y ppa:bladerf/bladerf
sudo add-apt-repository -y ppa:ettusresearch/uhd
sudo apt-get update
准备依赖安装包
sudo apt-get install  cmake g ++  libpython-dev python-numpy swig python-dev
sudo apt-get -y install build-essential cmake git-core autoconf automake  libtool g++ python-dev swig pkg-config libfftw3-dev libcppunit-dev libusb-dev sdcc libsdl1.2-dev python-numpy python-cheetah python-lxml doxygen python-qt4 python-qwt5-qt4 libxi-dev libqt4-opengl-dev libqwt5-qt4-dev libfontconfig1-dev libxrender-dev 

添加 Pothos和toolkits的支持
sudo apt-get install pothos-all
sudo apt-get install python-pothos
sudo apt-get install python3-pothos
sudo apt-get install pothos-python-dev

安装Soapy SDR runtime
sudo apt-get install soapysdr
sudo apt-get install python-soapysdr python-numpy
sudo apt-get install python3-soapysdr python3-numpy
sudo apt-get install soapysdr-module-remote soapysdr-server
安装Soapy SDR驱动 (全部装上,防止以后再麻烦)
sudo apt-get install osmo-sdr soapysdr-module-osmosdr
sudo apt-get install rtl-sdr soapysdr-module-rtlsdr
sudo apt-get install bladerf soapysdr-module-bladerf
sudo apt-get install hackrf soapysdr-module-hackrf
sudo apt-get install uhd-host uhd-soapysdr soapysdr-module-uhd
sudo apt-get install umtrx uhd-host uhd-soapysdr soapysdr-module-uhd
sudo apt-get install miri-sdr soapysdr-module-mirisdr
sudo apt-get install soapysdr-module-rfspace
sudo apt-get install airspy soapysdr-module-airspy


好了之后测试下

PothosUtil --system-info
SoapySDRUtil --info

没问题了,就可以装gnuradio了

再安装 gnuradio
先准备好依赖包
sudo apt-get -y install git cmake libboost-dev libcppunit-dev libfftw3-dev python-numpy doxygen python-cheetah python-gtk2-dev python-qt4 python-qwt5-qt4 libxi-dev libqt4-opengl-dev libqwt5-qt4-dev python-lxml
安装gnuradio
sudo apt-get install gnuradio

2.采用源文件编译安装
我们采用一个网上的脚本来进行安装比较方便些
wget http://www.sbrac.org/files/build-gnuradio && sudo chmod a + x build-gnuradio && ./build-gnuradio
一路按y 就行了最后安装好了就可以了
具体请参考 https://wiki.gnuradio.org/index.php/InstallingGRFromSource

就不在这里多说了


3.最后安装gr-osmosdr
我们采用源码编译安装
首先 安装gr-osmosdr 的支持包
sudo apt-get install libsoapysdr-dev
sudo apt install gr-fcdproplus
接下来clone源码
git clone git://git.osmocom.org/gr-osmosdr
cd gr-osmosdr/
mkdir build
cd build/
cmake ../
make
sudo make install
sudo ldconfig

注意要看看 cmake ../ 打印出的现阶段gnuradio的组件支持情况,最好全部支持
最主要是要看到 Soapysdr support在enable里面就行了

如果出现第一打开会提示Xterm is missing。 
解决办法:
sudo gedit /etc/gnuradio/conf.d/grc.conf
xterm_executable = 1
这样就安装好了,你就可以用grc来测试了


补充: 在网上看到别人写的一个安装脚本,觉得很好,贴在后面 python的

#!/usr/bin/env python
#coding=utf-8

import shlex
import subprocess
aa = ['sudo add-apt-repository -y ppa:myriadrf/drivers', \
 'sudo apt-get update', \
 'sudo apt-get -y install limesuite liblimesuite17.06-1 liblimesuite-dev limesuite-udev limesuite-images', \
 'sudo apt-get -y install soapysdr soapysdr-module-lms7',\
 'sudo add-apt-repository -y ppa:pothosware/framework',\
 'sudo add-apt-repository -y ppa:pothosware/support',\
 'sudo add-apt-repository -y ppa:myriadrf/drivers',\
 'sudo add-apt-repository -y ppa:bladerf/bladerf',\
 'sudo add-apt-repository -y ppa:ettusresearch/uhd',\
 'sudo apt-get update',\
 'sudo apt-get -y install python-dev swig'\
 'sudo apt-get -y install pothos-all',\
 'sudo apt-get -y install python-pothos',\
 'sudo apt-get -y install python3-pothos',\
 'sudo apt-get -y install pothos-python-dev'\
 'sudo apt-get -y install soapysdr',\
 'sudo apt-get -y install python-soapysdr python-numpy',\
 'sudo apt-get -y install python3-soapysdr python3-numpy',\
 'sudo apt-get -y install soapysdr-module-remote soapysdr-server',\
 'sudo apt-get -y install osmo-sdr soapysdr-module-osmosdr',\
 'sudo apt-get -y install rtl-sdr soapysdr-module-rtlsdr',\
 'sudo apt-get -y install bladerf soapysdr-module-bladerf',\
 'sudo apt-get -y install hackrf soapysdr-module-hackrf',\
 'sudo apt-get -y install uhd-host uhd-soapysdr soapysdr-module-uhd',\
 'sudo apt-get -y install umtrx uhd-host uhd-soapysdr soapysdr-module-uhd',\
 'sudo apt-get -y install miri-sdr soapysdr-module-mirisdr',\
 'sudo apt-get -y install soapysdr-module-rfspace',\
 'sudo apt-get -y install airspy soapysdr-module-airspy',\
 'PothosUtil --system-info',\
 'SoapySDRUtil --info',\
 'sudo apt-get -y install git cmake libboost-dev libcppunit-dev libfftw3-dev python-dev swig python-numpy doxygen python-cheetah python-gtk2-dev python-qt4 python-qwt5-qt4 libxi-dev libqt4-opengl-dev libqwt5-qt4-dev python-lxml',\
 'sudo apt-get -y install gnuradio',\
 'sudo apt-get -y install libsoapysdr-dev',\
 'sudo apt-get -y install gr-fcdproplus',
 ]
for i in aa:
	args=shlex.split(i)
	p=subprocess.Popen(args)
	p.wait()

sub = subprocess.call('git clone git://git.osmocom.org/gr-osmosdr && cd gr-osmosdr/ && mkdir build && cd build && cmake .. && make && sudo make install && sudo ldconfig', shell=True)
if sub == 0:
	print 'Sucessfull!'


卸载脚本

#!/usr/bin/env python
#coding=utf-8

import shlex
import subprocess
aa = ['sudo apt-get -y remove pothos-all',\
 'sudo apt-get -y remove python-pothos',\
 'sudo apt-get -y remove python3-pothos',\
 'sudo apt-get -y remove pothos-python-dev'\
 'sudo apt-get -y remove soapysdr',\
 'sudo apt-get -y remove python-soapysdr python-numpy',\
 'sudo apt-get -y remove python3-soapysdr python3-numpy',\
 'sudo apt-get -y remove soapysdr-module-remote soapysdr-server',\
 'sudo apt-get -y remove osmo-sdr soapysdr-module-osmosdr',\
 'sudo apt-get -y remove rtl-sdr soapysdr-module-rtlsdr',\
 'sudo apt-get -y remove bladerf soapysdr-module-bladerf',\
 'sudo apt-get -y remove hackrf soapysdr-module-hackrf',\
 'sudo apt-get -y remove uhd-host uhd-soapysdr soapysdr-module-uhd',\
 'sudo apt-get -y remove umtrx uhd-host uhd-soapysdr soapysdr-module-uhd',\
 'sudo apt-get -y remove miri-sdr soapysdr-module-mirisdr',\
 'sudo apt-get -y remove soapysdr-module-rfspace',\
 'sudo apt-get -y remove airspy soapysdr-module-airspy',\
 'sudo apt-get -y remove libboost-dev libcppunit-dev libfftw3-dev python-dev swig python-numpy doxygen python-cheetah python-gtk2-dev python-qt4 python-qwt5-qt4 libxi-dev libqt4-opengl-dev libqwt5-qt4-dev python-lxml',\
 'sudo apt-get -y remove gnuradio',\
 'sudo apt-get -y remove libsoapysdr-dev',\
 'sudo apt-get -y remove gr-fcdproplus',
 ]
for i in aa:
	args=shlex.split(i)
	p=subprocess.Popen(args)
	p.wait()

sub = subprocess.call('rm -rf gr-osmosdr', shell=True)
if sub == 0:
	print 'Uninstall Sucessfull!'



你可能感兴趣的:(SDR)