官方网站下载源码:http://sourceforge.net/projects/iperf
1.我下的iperf-2.0.5.tar.gz(稳定版)解压,tar zxvf iperf-2.0.5.tar.gz
cd iperf-2.0.5
原有交叉编译环境没有g++,故增加对g++ 的支持
cd ../../build/gcc-4.3.3 ;make menuconfig
vim db12x.config
Cd ../../build
Make BOARD_TYPE=db12x BUILD_CONFIG=_ap123 toolchain
无错误日志输出
ls ../../build/gcc-4.3.3/build_mips/staging_dir/usr/bin/
出现 mips-linux-g++,mips-linux-uclibc-g++,表示成功
2.编写编译脚本
3.编译 make 打印出错误
../../gcc-4.3.3/build_mips/staging_dir/usr/include/bits/socket.h:271:
error: expected initializer before 'throw'
原因:上述路径头文件的声明与源码中的冲突
Vim config.h, 注释掉#definemalloc rpl_malloc
Vim ../../ staging_dir/usr/include/bits/socket.h
将extern struct cmsghdr * __NTH (__cmsg_nxthdr (struct msghdr*__mhdr,
struct cmsghdr *__cmsg)) __THROW; 注释掉
改成extern struct cmsghdr *__cmsg_nxthdr (struct msghdr*__mhdr,
struct cmsghdr *__cmsg) __THROW;
libc_hidden_proto(__cmsg_nxthdr)
4. make 通过
5.将可执行文件iperf copy到 板子/usr/sbin,将 ../../build/gcc-4.3.3/build_mips/staging_dir/usr/mips-linux-uclibc/lib/libstdc++.so.6拷贝到/lib目录下。
6.iperf 选项参数
7.iperf 测试
以board (ip为 192.168.44.1)为服务器,windows机器(ip 为 192.168.44.199)做客户端
(1) 官网下载JRE并安装
http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
(2) 下载windows客户端产品jperf,运行jperf.bat
(3) 有图有真相,测试场景如下:
服务器:
这样就完成了iperf 的简单移植