1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
|
$Id: INSTALL,v 1.1.1.1 2004/05/18 01:50:44 kgibbs Exp $
Briefly:
Do one-time if needed, e.g. for systems with dnf
dnf install gcc
dnf install gcc-c++
dnf install make
dnf install automake
then to build do:
./configure -- configure for your machine
make -- compile Iperf
make install -- install Iperf, if desired, from root
and to use:
iperf -s (on machine "foo.bar.edu")
iperf -c foo.bar.edu (on some other machine)
iperf -h (for help screen)
iperf -v (for version information)
Platform Specific Notes
Android NDK (cross compile from Linux)
Download the NDK from https://developer.android.com/ndk
Create a wrapper for the NDK's clang toolchain
$ more ~/bin/aarch64-android-ndk
#!/bin/sh
export NDK=/projects/android-ndk-r26d
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64
export TARGET=aarch64-linux-android
# Set this to your minSdkVersion.
export API=24
# Configure and build.
export AR=$TOOLCHAIN/bin/llvm-ar
export CC=$TOOLCHAIN/bin/$TARGET$API-clang
export AS=$CC
export CXX=$TOOLCHAIN/bin/$TARGET$API-clang++
export LD=$TOOLCHAIN/bin/ld
export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
export STRIP=$TOOLCHAIN/bin/llvm-strip
"$@"
#####
Configure and make
$ aarch64-android-ndk ../iperf2-code/configure --host=aarch64-linux-android
$ make
---
FreeBSD
If you use a cc or c++ other than the system one, threads may not be
detected properly. To work around this set the following environment
variables:
setenv CC /usr/bin/cc
setenv CXX /usr/bin/c++
---
Windows 64bit (cross compile from Linux)
# dnf install mingw64-gcc mingw64-gcc-c++ mingw64-winpthreads-static
$ ../iperf2-code/configure --host=x86_64-w64-mingw32
$ make
---
Windows 32bit (cross compile from Linux)
# dnf install mingw32-gcc mingw32-gcc-c++ mingw32-winpthreads-static
$ ../iperf2-code/configure --host=i686-w64-mingw32
$ make
---
Windows (Cygwin)
configure / make as normal:
$ ../iperf2-code/configure
$ make
The result requires Cygwin on client machines.
---
Windows (Cygwin + i686-w64-mingw32)
Use Cygwin Setup to install i686-w64-mingw32 and related packages
Configure as a cross-compile:
$ ../iperf2-code/configure -host i686-w64-mingw32
$ make
The result runs natively on WinXP and above without requiring Cygwin
---
Windows 64 (Cygwin + i686-w64-mingw32)
# dnf install mingw64-gcc mingw64-gcc-c++ mingw64-winpthreads-static
$ ../iperf2-code/configure --host=x86_64-w64-mingw32
$ make
---
Windows (MinGW + Msys)
Install MinGW+Msys
https://sourceforge.net/projects/mingw/
http://www.mingw.org/wiki/MinGW
http://www.mingw.org/wiki/MSYS
configure / make as normal:
$ ../iperf2-code/configure
$ make
The result runs natively on WinXP and above without requiring
MinGW+Msys on client machines.
---
OpenWRT cross compile (example only)
Setup buildroot (not fully described here, link https://electrosome.com/cross-compile-openwrt-c-program/)
determine the target environment from the openwrt banner (this example is openwrt)
get the build environment, e.g. git clone https://github.com/openwrt/openwrt.git
update feeds
$ ./scripts/feeds update -a
$ ./scripts/feeds install -a
configure target
$ make menuconfig
Then select Target System, Subtarget and Target Profile as per your target environment, e.g.
Target System: MediaTek Ralink MIPS
Subtarget system: MT7620 based boards
Target profile: NETGEAR R6350
Set environment variables (via any editor or manual exports to get)
[rjmcmahon@localhost iperf2-code]$ more ../openwrt.config
export STAGING_DIR=/home/usernmae/Code/openwrt/staging_dir
export TOOLCHAIN_DIR=$STAGING_DIR/toolchain-mipsel_24kc_gcc-8.4.0_musl (this is target dependent)
export LDCFLAGS=$TOOLCHAIN_DIR/usr/lib
export LD_LIBRARY_PATH=$TOOLCHAIN_DIR/usr/lib
export PATH=$TOOLCHAIN_DIR/bin:$PATH
$ source ../openwrt.config
Download iperf 2 source
$ cd iperf2-code
Run configure, e.g. (replace /home/rjmcmahon/Code with your directory)
$ ./configure --target=mips-buildroot-linux-gnu --host=mips-buildroot-linux-gnu CC=/home/rjmcmahon/Code/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin/mipsel-openwrt-linux-gcc CXX=/home/rjmcmahon/Code/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin/mipsel-openwrt-linux-g++
Cross compile (binary in the src/ directory)
$ make
Install iperf and shared libraries onto openwrt device
ssh into openwrt device, $ opkg install libstdcpp
$ scp src/iperf user@host:/usr/bin
---
Other configure and compile options
./configure --enable-debuginfo - enable asserts
./configure --enable-thread-debug - enable thread level debugging
./configure --enable-summing-debug - enable summing level debugging
./configure --enable-packet-debug - show packet sequence numbers - very chatty
./configure --enable-udp-l4s - enable l4s udp test support
./configure --enable-fastsampling - sub millisecond timestamping
./configure --enable-checkprograms - compile supplmentary test programs
./configure --disable-ipv6
./configure --disable-multicast
./configure --disable-threads
./configure --disable-write-select
./configure --enable-debug-symbols - enable debugging with symbols
./configure --enable-default-localonly - limit test traffic to the local network (off by default)
---
dnf installs needed for build:
dnf install gcc
dnf install gcc-c++
dnf install automake
|