USRP_N210软件平台UHD安装及GNUradio安装

USRP系列连载文章,系笔者毕业设计课题,《通用软件无线电平台USRP_N210主板工作方式研究》。旨在学习前辈经验,并对USRP的使用以及源码进行部分分析,特别是FPGA源码分析。文中可能会出现一些错误或者不当之处,也请各位多多指出,共同学习。

本文章由hitter翻译整理,借鉴多方成果,再次对各个前辈的工作表示感谢!


本文中使用的UHD及GNURadio源码,Python脚本以及系统日志,笔者将上传到CSDN(见文章最后方),供各位方便下载。

安装方式一:

该安装方式为Ettus官方网站提供的安装方式,相对来说安装过程较为复杂,但很详细、全面,适合各位在安装过程中遇到某些错误参考解决方式。参考网址:http://files.ettus.com/manual/page_install.html

(想要快速的安装好UHD+GNURadio,请直接跳转的安装方式二)

系统版本ubuntu12.04 32位操作系统

 

UHD的安装:

UHD位USRP的硬件环境支持,在GNUradio3.3版本之后,GNUradio将不再继续集成USRP的硬件支持,所以需要单独安装UHD。其安装步骤如下:

 

 

一.二进制安装

复制以下命令到终端,安装UHD软件

 

    sudoadd-apt-repository ppa:ettusresearch/uhd

    sudoapt-get update

    sudo apt-get install libuhd-dev libuhd003uhd-host

二.检查环境构建

使用apt-get安装环境,在终端中输入:

 

    sudo apt-get install libboost-all-devlibusb-1.0-0-dev python-mako doxygen python-docutils cmake build-essential

 

环境要求如下:

1.C++ Compiler

GCC >= 4.8

安装使用命令:sudoapt-get install gcc

2.CMake

• Purpose: generates project build files

• Minimum Version: 2.8

• Usage: build time (required)

• Download URL: http://www.cmake.org/cmake/resources/software.html

安装使用命令:sudoapt-get install cmake

3.Boost

• Purpose: C++ library

• Minimum Version: 1.53

• Usage: build time + runtime (required)

• Download URL: http://www.boost.org/users/download/

• Download URL (Windowsinstaller): http://sourceforge.net/projects/boost/files/boost-binaries/

安装BOOST:

• 安装参考网址www.cnblogs.com/loadofleaf/p/5

tar xf boost_1_58_0.tar.gz

       cd boost_1_58_0/

       ./bootstrap.sh

       ./b2 -a-sHAVE_ICU=1 # theparameter means that it support icu or unicode

       sudo ./b2install

4.LibUSB

• Purpose: USB-based hardware support

• Minimum Version: 1.0

• Usage: build time + runtime (optional)

• Download URL: http://sourceforge.net/projects/libusb/files/libusb-1.0/

• Download URL (Windows): https://github.com/libusb/libusb

可以直接从商店中获得软件,在终端中输入命令

sudo apt-get install libusb-1.0-0-dev

5.Python

• Purpose: used by mako and utility scripts

• Minimum Version: 2.7

• Usage: build time + runtime utility scripts (required)

• Download URL: http://www.python.org/download/

可以直接从商店中获得软件,在终端中输入命令

sudo apt-get install python

6.Mako

• Purpose: source code generation

• Minimum Version: 0.5.0

• Usage: build time (required)

• Download URL: http://www.makotemplates.org/download.html

• Alternative method: You can use pip or easy_install to install Mako from PyPi.

可以使用pip,快速的安装mako,首先需要安装pip,在终端中输入

      sudo apt-get install python-pip

安装完毕后输入来完成安装

sudopip install mako

7.Doxygen(此项为可选项,如果需要生成HTML API,则需要安装此项)

• Purpose: generates HTML API documentation

• Minimum RecommendedVersion: 1.8

• Usage: build time (optional)

• Download URL: http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc

• Alternate method: Install setuptools, anduse the easy_install command toinstall Docutils.http://pypi.python.org/pypi/setuptools

 

使用setuptool进行安装,首先下载安装setuptools

wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-12.0.3.tar.gz#md5=f07e4b0f4c1c9368fcd980d888b29a65 

安装:

       tar-zxvf setuptools-12.0.3.tar.gz
       cd setuptools=12.0.3                                                       #进入文件夹
       sudo python setup.py install

安装完成后使用命令

       sudoeasy_install docutils

至此我们所需要的环境则全部安装完毕!

三.下载安装UHD

(一)获得UHD源码

需要联网的环境之后在终端中输入(不包含FPGA源码):

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

 

如果FPGA部分源码也需要,在终端中输入:

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

 

(二)编译安装源码

1.创建makefile

 

    cd <uhd-repo-path>/host

    mkdir build

    cd build

    cmake ../

注: uhd-repo-path为UHD的目录,例如本机目录为/desktop/uhd

2.编译和安装UHD

   在执行编译之前,我们需要同步一下系统时间,防止编译出错。可以使用电脑系统设置中同步网络时间,或者执行以下步骤:

(1).安装ntpadate工具

    sudo apt-get install ntpdate

 

(2).设置系统时间与网络时间同步

    sudo ntpdate cn.pool.ntp.org

 

(3)将系统时间写入硬盘时间

sudohwclock –systohc

此时可以在终端输入date命令查看系统时间是否同步。

 

进行编译安装操作:

    make

    maketest

    sudo make install

3.设置库路径

(1)拷贝文件到LD_LIBRARY_PATH

    cd<uhd-repo-path>/host/build/lib

    sudo cp -r libuhd.so /etc/ld.so.conf.d

(2)进入 LD_LIBRARY_PATH并确认路径

    cd/etc/ld.so.conf.d

    sudo ldconfig

安装方式二:

该安装方式使用Python脚本进行安装,该脚本为国外工程师开源,由于笔者不清楚最初的出处,也请各位指正。

笔者的安装系统环境为ubuntu12.04 32位操作系统


使用Python脚本(build-gnuradio)进行UHD和GNURadio的安装,步骤:

1.系统版本:Ubuntu 12.04


2.终端输入:
$sudo apt-get update   #更新apt库


3.解压缩源文件GNURADIO.zip到主目录下


4.更改build-gnuradio脚本权限,在终端中输入:


$cd GNURADIO #进入解压文件夹


$sudo chmod a+x build-gnuradio  #更改build-gnuradio权限


5. 输入‘ls’查看build-gnuradio 文件是否变成绿色(即权限是否改变)


6.终端中输入:
./build-gnuradio  #运行文件


7.输入两次‘yes’到终端中开始安装


8.等待安装完成,具体过程请查看安装系统日志(install_log)



UHD及GNURadio源码,以及安装脚本:http://download.csdn.net/detail/cracked_hitter/9720706


UHD中FPGA源码下载:http://download.csdn.net/detail/cracked_hitter/9720561


install_log:http://download.csdn.net/detail/cracked_hitter/9720563



  • 4
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值