OpenAirInterface 使用USRP时UHD库的问题(备注recover办法)

在执行sudo ./build_oai --eNB -c -w USRP命令后,报出错误
oai_usrpdevif compilation failed
查看log文件发现是

/home/prowc/openairinterface5g/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp: In function ‘int trx_usrp_start(openair0_device*)’:
/home/prowc/openairinterface5g/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp:113:19: error: ‘class uhd::rx_streamer’ has no member named ‘issue_stream_cmd’
     s->rx_stream->issue_stream_cmd(cmd);
                   ^
/home/prowc/openairinterface5g/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp: In function ‘void trx_usrp_end(openair0_device*)’:
/home/prowc/openairinterface5g/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp:131:19: error: ‘class uhd::rx_streamer’ has no member named ‘issue_stream_cmd’
     s->rx_stream->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);

原因为UHD版本不是openair支持的版本(但是我是按照OpenAirInterface的步骤一步步安装的,不知道为什么会下不到他支持的版本(3.9.2/3.9.3/3.9.4))
如何查看自己的UHD版本?在终端里随便输入一个uhd_xxxxx,第一行出来的003.005.005,代表你的版本就是3.5.5

尝试自己更新UHD,在以下网址下载UHD安装包,例如uhd-3.9.4.tar.gz
http://files.ettus.com/binaries/uhd_stable/src/
然后安装依赖项(Ubuntu 14.04系统) (可参考http://www.cnblogs.com/moon1992/p/5781166.html)

sudo apt-get -y install git swig cmake doxygen build-essential libboost-all-dev libtool libusb-1.0-0 libusb-1.0-0-dev libudev-dev libncurses5-dev libfftw3-bin libfftw3-dev libfftw3-doc libcppunit-1.13-0 libcppunit-dev libcppunit-doc ncurses-bin cpufrequtils python-numpy python-numpy-doc python-numpy-dbg python-scipy python-docutils qt4-bin-dbg qt4-default qt4-doc libqt4-dev libqt4-dev-bin python-qt4 python-qt4-dbg python-qt4-dev python-qt4-doc python-qt4-doc libfftw3-bin libfftw3-dev libfftw3-doc ncurses-bin libncurses5 libncurses5-dev libncurses5-dbg   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-wxgtk2.8 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 gtk2-engines-pixbuf r-base-dev python-tk liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2 libzmq1 libzmq-dev python-requests python-sphinx libcomedi-dev

然后进入UHD源码所在文件夹,输入以下命令即可

mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig

再运行sudo ./build_oai --eNB -c -w USRP,显示

Log file for compilation has been written to: /home/prowc/openairinterface5g/cmake_targets/log/oai_usrpdevif.Rel14.txt
oai_usrpdevif compiled
liboai_device.so is linked to USRP device library

nice!

备注:

cd /tmp
mkdir z
cd z
git clone https://gitlab.eurecom.fr/oai/openairinterface5g
cd openairinterface5g/
git checkout develop
source oaienv
cd cmake_targets/
./build_oai -I
./build_oai --oaisim -x

你可能感兴趣的:(OpenAirInterface 使用USRP时UHD库的问题(备注recover办法))