1. Windows 端netperf 2.7.0下载地址
因为测试会用到Windows端的二进制,mark一下:
Netperf windows端二进制下载地址
2. 下载源码
lyl@dell:~/meari_work/third_party_lib$ git clone https://github.com/HewlettPackard/netperf.git lyl@dell:~/meari_work/third_party_lib$ lyl@dell:~/meari_work/third_party_lib$ cd netperf/ lyl@dell:~/meari_work/third_party_lib/netperf (master)$ git checkout -b netperf-27 netperf-2.7.0 //回滚到指定的tag 切换到一个新分支 'netperf-27' lyl@dell:~/meari_work/third_party_lib/netperf (netperf-27)$
3. 交叉编译安装
./configure CC=arm-anykav500-linux-uclibcgnueabi-gcc --host=arm-linux --prefix=/home/lyl/install/arm-anykav500-linux-uclibcgnueabi-gcc/netperf 会报以下错误: checking types of arguments for select... int,fd_set *,struct timeval * checking whether setpgrp takes no argument... configure: error: cannot check setpgrp when cross compiling
原因:
由于在语句中判断ac_cv_func_setpgrp_void是否设置,如果没有设置必然会报错。
有两种解决方法:
- 2.4.0以及之前版本,直接注释掉configure 中cannot check setpgrp when cross compiling的下一行{ (exit 1); exit 1; };即可
- 2.5.0以及之后就没有这一行了,需要手动设置echo “ac_cv_func_setpgrp_void=yes” > config.cache
然后,继续运行 ./configure CC=arm-anykav500-linux-uclibcgnueabi-gcc --host=arm-linux --prefix=/home/lyl/install/arm-anykav500-linux-uclibcgnueabi-gcc/netperf --config-cache //(注意这里有一个--config-cache选项,对应方法二)
configure成功执行,但是make又报错:
makeinfo: command not found
解决方法:
sudo apt-get install texinfomake install
大功告成!
4. 其他
windows端执行 netserver(2.7.0),设备端上使用2.5.0的netperf会卡住,换成2.7.0就OK了。 mark一下