Ubuntu GNURadio gr-Radar 的安装

1.安装Ubuntu

进行磁盘管理,设置不少于50G的未分配空间

使用rufus-2.8制作Ubuntu 16.4安装盘

保持U盘插入,重启电脑,开机时进入BIOS设置从该安装盘启动并安装

2.激活wifi

连接有线网络,进入终端,执行以下命令:

sudo apt-get update //更新软件列表
sudo apt-get install bcmwl-kernel-source //使wi-fi连接可用

3.

sudo apt-get install git
git init
sudo apt-get install vim
sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose

4.安装依赖包

sudo apt-get install libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool \
python-dev libfftw3-dev libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77 \
libsdl1.2-dev python-wxgtk3.0 git-core libqt4-dev python-numpy ccache python-opengl libgsl0-dev \
python-cheetah python-mako python-lxml doxygen qt4-default qt4-dev-tools libusb-1.0-0-dev \
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4 cmake git-core wget libxi-dev \
python-docutils gtk2-engines-pixbuf r-base-dev python-tk liborc-0.4-0 liborc-0.4-dev libasound2-dev \
python-gtk2 libitpp8v5 libitpp-dev libpcap-dev libarmadillo-dev libcurl3 curl libgl1-mesa-dev \
libglu1-mesa-dev build-essential python-requests

5.安装qwt

(1).

将qwt-6.1.3.tar.bz2解压

通过终端进入解压后目录

qmake
make
sudo make install
sudo ldconfig

程序所在路径为:/usr/local/qwt-6.1.3

(2).将/usr/local/qwt-6.1.3/include/下面的头文件拷贝到/usr/local/include/

cd /usr/local/include
sudo mkdir -m777 -v qwt
cd qwt
cp -a /usr/local/qwt-6.1.3/include/* ./

(3).将qwt的共享库连接到/usr/local/lib/

sudo ln -s /usr/local/qwt-6.1.3/lib/libqwt.so.6.1.3 /usr/local/lib/libqwt.so.6.1.3
sudo ln -s /usr/local/qwt-6.1.3/lib/libqwt.so.6.1 /usr/local/lib/libqwt.so.6.1
sudo ln -s /usr/local/qwt-6.1.3/lib/libqwt.so.6 /usr/local/lib/libqwt.so.6
sudo ln -s /usr/local/qwt-6.1.3/lib/libqwt.so /usr/local/lib/libqwt.so

6.Boost安装

(1)运行bootstrap.sh:

./bootstrap.sh --with-libraries= system,filesystem, thread,python

后面加上需要编译的库(如果不加的话,貌似只会编译最小的库,即包含基本功能的库)需要编译的自己选。

(2)

sudo ./b2

执行后结果:

The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

/home/ryan/boost_1_63_0

The following directory should be added to linker library paths:

/home/ryan/boost_1_63_0/stage/lib

-------------------------------------------------------------

(3)因为OS默认头文件在/usr/local/include/,所以:

sudo cp -a boost /usr/local/include/boost

(4)因为OS默认库文件在/usr/local/lib/,所以:

sudo cp -a stage/lib/* /usr/local/lib/
sudo ldconfig

(5) 测试是否安装成功

a.测试代码test.cpp

#include <boost/lexical_cast.hpp>
#include <iostream>
int main()
{
    using boost::lexical_cast;
    int a= lexical_cast<int>("123456");
    double b = lexical_cast<double>("123.456");
    std::cout << a << std::endl;
    std::cout << b << std::endl;
    return 0;
} 

b.编译

g++ -o test test1.cpp

c.运行

./test

7.UHD安装

(1).获取源代码

git clone git://github.com/EttusResearch/uhd.git

(2).更新子模块

git submodule init
git submodule update

(3).构建指令

a.用Cmake生成makefiles

cd uhd/host/
mkdir build
cd build
cmake ../

b.编译与安装

make
make test
sudo make install
sudo ldconfig

(4).下载 UHD 镜像文件

sudo uhd_images_downloader

目的:下载USRP板子需要烧写的固件和FPGA程序

8.安装gnuradio

git clone --recursive git://github.com/gnuradio/gnuradio.git
cd gnuradio/
mkdir build
cd build
cmake ../
make
make test
sudo make install
sudo ldconfig
volk_profile
/usr/local/libexec/gnuradio/grc_setup_freedesktop install
cd

9.配置系统

(1) 添加 usrp 用户组:

sudo /usr/sbin/groupadd usrp

(2) 添加用户 id到 usrp 用户组:

sudo /usr/sbin/usermod -a -G usrp ryan

(3) 优化系统性能:

sudo gedit /etc/sysctl.conf

在该文档末尾添加以下 3 项配置并保存:

net.core.rmem_max = 50000000
net.core.wmem_max = 1048576
kernel.shmmax = 2147483648

(4) 添加实时进程权限:

sudo gedit /etc/security/limits.conf

在该文档末尾添加并保存:

@usrp - rtprio 50

(5) 添加 usb 接口运行规则(仅当使用 USB 接口系列的 USRP 需要进行该项):

sudo cp uhd/host/utils/uhd-usrp.rules /etc/udev/rules.d/10-usrp.rules
sudo chown root /etc/udev/rules.d/10-usrp.rules
sudo chgrp root /etc/udev/rules.d/10-usrp.rules

10.安装gr-radar

git clone https://github.com/kit-cel/gr-radar.git // clone this repository
cd gr-radar/
mkdir build             // make build folder
cd build/
cmake ../               // build makefiles
make                    // build toolbox
sudo make install
sudo ldconfig