Ubuntu14.04 Use Wireless Simulation Software Package

Ubuntu14.04 Use Wireless Simulation Software Package

1. INSTALL

(1) 你需要:
  • git
  • g++ 4.8.6
  • python 2.7
  • swig 3.0.8 (SWIG is a command-line utility that looks at your C++ declarations and automatically generates the necessary wrapper code.)
  • autoconf
  • automake
  • libtool
  • Boost
  • python-numpy
  • IT++ 4.3.1

所以,首先安装这些东西,安装步骤如下:

sudo apt-get install swig git python-dev autoconf automake libtool g++ libboost-dev python-numpy-dev libitpp-dev
(2) 还需要安装 Protocol Buffers

否则在wireless./configure 步骤中可能会出现以下错误:


checking for protoc… no
configure: error: Could not find protoc in the path, please install it or add to the path.

安装方法参考:https://github.com/google/protobuf/blob/master/src/README.md

./autogen.sh
./configure
make
make check
sudo make install
sudo ldconfig  # refresh shared library cache. 
(3) 可以开始安装 wireless 程序了

可以参考 Jonathan 的网站:http://www.yonch.com/wireless

cd wireless
mkdir release 
cd release

这里如果想使用 debug 的方法,也可以 mkdir debug


这里有一点特别需要注意:
我们使用的 IT++ 版本为 4.3.1,但 Jonathan 使用的是 4.2
两个版本的区别除了 4.3.1 的编译使用了 CMAKE 之外,还有一点与我们的安装相关:
在 4.2 中,${include}/itpp/base/binary.h 的包含关系为:

#include <itpp/base/itassert.h> 

而这在 4.3 中为:

#include <itpp/base/itassert.h>
#include <itpp/itexports.h> 

同样的问题也出现在 ${include}/itpp/comm/llr.h
也是多了一个#include <itpp/itexports.h>
虽然不知道这个包含其什么作用,但如果不做处理将会出现下面的 make Error

Error: Syntax error - possibly a missing semicolon.

解决方法是,在wireless 工程中:
分别在bindings/itpp/base_vec.i 中找到

%include <itpp/base/binary.h>

bindings/itpp/llr.i 中找到

%include <itpp/comm/llr.h>

在这两句的前面加上一句代码:

%include <itpp/itexports.h>

重新 make 就会成功!


让我们回来接着上面的 cd release ,在命令行中运行以下代码:
这里还要注意 CPPFLAGSCXXFLAGS 两个参数一定和 ../configure在同时运行

sudo CPPFLAGS="-I/usr/include -DNDEBUG" CXXFLAGS="-O3" ../configure --prefix=${Your wireless install path} -C
sudo make -j8
sudo make -j8 install
(4) 配置 wireless 的环境变量
sudo vim ~/.bashrc

在前面加上以下代码

export WIRELESS_SIM_PREFIX=${Your wireless install path}
export C_INCLUDE_PATH=$WIRELESS_SIM_PREFIX/include:$C_INCLUDE_PATH     
export CPLUS_INCLUDE_PATH=/usr/local/include:$WIRELESS_SIM_PREFIX/include:$CPLUS_INCLUDE_PATH     
export LIBRARY_PATH=/usr/local/lib:$WIRELESS_SIM_PREFIX/lib:$LIBRARY_PATH     
export LD_LIBRARY_PATH=/usr/local/lib:$WIRELESS_SIM_PREFIX/lib:$LD_LIBRARY_PATH     
export PYTHONPATH=$PYTHONPATH:$WIRELESS_SIM_PREFIX/lib/python2.7/site-packages:$WIRELESS_SIM_PREFIX/lib/python:$WIRELESS_SIM_PREFIX/lib/python2.7/site-packages/wireless

环境变量因人而异,添加时用点心。

然后要定义 python 的导航文件(name.pth),参考 https://docs.python.org/2/library/site.html

cd ${Your wireless install path}/lib/python2.7
sudo vim wirelesspylib.pth

加入以下代码

${Your wireless install path}/lib
${Your wireless install path}/lib/python2.7
${Your wireless install path}/lib/python2.7/site-packages

最后进入 python,import wireless 看看是否成功。


这里有些同学可能会遇到一些问题

>>>import wireless
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/zhouwei/ProgramFiles/wireless/lib/python2.7/site-packages/wireless/__init__.py", line 16, in <module>
    import statistics
  File "/home/zhouwei/ProgramFiles/wireless/lib/python2.7/site-packages/wireless/statistics/__init__.py", line 1, in <module>
    from ErrorRateStatistics import ErrorRateStatistics
  File "/home/zhouwei/ProgramFiles/wireless/lib/python2.7/site-packages/wireless/statistics/ErrorRateStatistics.py", line 7, in <module>
    from wireless.util.serialization.results_pb2 import ErrorRateResults
  File "/home/zhouwei/ProgramFiles/wireless/lib/python2.7/site-packages/wireless/util/serialization/__init__.py", line 1, in <module>
    import results_pb2
  File "/home/zhouwei/ProgramFiles/wireless/lib/python2.7/site-packages/wireless/util/serialization/results_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
ImportError: No module named google.protobuf

或者可能是其他的一些import 的问题,据调查这些问题在安装 tensorflowcaffee 的过程中都有可能遇到。
这些问题基本都和google.protobuf 有关,目的是为了实现程序的serialization ,问题的原因基本上都是google.protobuf 的版本过低,有下面方法解决:

sudo pip install -V protobuf==3.0.0a2

其中主版本号为 3. 就可以。


(5) 使用 wireless

测试:(Ubuntu Terminal)

~$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wireless
>>>

好的!恭喜安装成功!

2 HOW TO USE WIRELESS

libwireless 的源代码解析请见:http://blog.csdn.net/baobao3456810/article/details/51066572
后面会参考工程中给出的例子介绍 libwireless 的使用

To be continue…

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值