Thursday, December 20, 2012

Get iperf3 (new version) source code

There is a new version of iperf, iperf3 at code.google.com/p/iperf/. I am not sure if it is any better than iperf2 but it is cool to have a new source to play with. Anyways if you want to build this code on Ubuntu you may encounter a failure due to missing libraries.

Here is a quick review of my attempt to build this tool.

1. Download the latest beta code
user@localhost:~$ wget http://iperf.googlecode.com/files/iperf-3.0b4.tar.gz

2. Extract the code
user@localhost:~$ tar -xvzf iperf-3.0b4.tar.gz

3. With most source code you then have to run the configuration tool for the makefile to be properly built

user@localhost:~$ cd iperf-3.0b4/
user@localhost:~/iperf-3.0b4$ ./configure
This is the output that I got
./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ranlib... ranlib
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... (cached) ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for ANSI C header files... (cached) yes
checking for uuid_create... no
checking for uuid_generate... no
checking for uuid_generate in -luuid... no
configure: error: libuuid is not available
What I noticed is that libuuid is not available. So how do we find where we can get libuuid? A google search lead me to this page:
www.debian-administration.org/article/334/Finding_which_package_contains_a_file
and the apt-file tool

4. So let us use apt-file and figure it out and then install the necessary library.
4a. If you don't have apt-file follow the guide available at the link above to install it and prepare, or just do the following
user@localhost:~/iperf-3.0b4$ sudo apt-get install apt-file && sudo apt-file update

4b. Search using apt-file for libuuid
user@localhost:~/iperf-3.0b4$ apt-file search libuuid
cruft: /usr/lib/cruft/filters-unex/libuuid1
drizzle: /usr/lib/drizzle7/libuuid_function_plugin.so
drizzle-dbg: /usr/lib/debug/usr/lib/drizzle7/libuuid_function_plugin.so
fp-units-base-2.4.4: /usr/lib/fpc/2.4.4/units/x86_64-linux/uuid/libplibuuid.a
fp-units-base-2.4.4: /usr/lib/fpc/2.4.4/units/x86_64-linux/uuid/libuuid.o
fp-units-base-2.4.4: /usr/lib/fpc/2.4.4/units/x86_64-linux/uuid/libuuid.ppu
fpc-source-2.4.4: /usr/share/fpcsrc/2.4.4/packages/uuid/src/libuuid.pp
libdata-uuid-libuuid-perl: /usr/share/doc/libdata-uuid-libuuid-perl/changelog.Debian.gz
libdata-uuid-libuuid-perl: /usr/share/doc/libdata-uuid-libuuid-perl/copyright
libuuid-perl: /usr/share/doc/libuuid-perl/changelog.Debian.gz
libuuid-perl: /usr/share/doc/libuuid-perl/copyright
libuuid-tiny-perl: /usr/share/doc/libuuid-tiny-perl/changelog.Debian.gz
libuuid-tiny-perl: /usr/share/doc/libuuid-tiny-perl/copyright
libuuid1: /lib/x86_64-linux-gnu/libuuid.so.1
libuuid1: /lib/x86_64-linux-gnu/libuuid.so.1.3.0
libuuid1: /usr/share/doc/libuuid1/changelog.Debian.gz
libuuid1: /usr/share/doc/libuuid1/copyright
libuuidm-ocaml-dev: /usr/share/doc/libuuidm-ocaml-dev/README
libuuidm-ocaml-dev: /usr/share/doc/libuuidm-ocaml-dev/changelog.Debian.gz
libuuidm-ocaml-dev: /usr/share/doc/libuuidm-ocaml-dev/copyright
libuuidm-ocaml-dev: /var/lib/ocaml/lintian/libuuidm-ocaml-dev.info
libuuidm-ocaml-dev: /var/lib/ocaml/md5sums/libuuidm-ocaml-dev.md5sums
libuuidtools-ruby: /usr/share/doc/libuuidtools-ruby/changelog.Debian.gz
libuuidtools-ruby: /usr/share/doc/libuuidtools-ruby/copyright
libuuidtools-ruby-doc: /usr/share/doc/libuuidtools-ruby-doc/changelog.Debian.gz
libuuidtools-ruby-doc: /usr/share/doc/libuuidtools-ruby-doc/copyright
libuuidtools-ruby1.8: /usr/share/doc/libuuidtools-ruby1.8/changelog.Debian.gz
libuuidtools-ruby1.8: /usr/share/doc/libuuidtools-ruby1.8/copyright
libuuidtools-ruby1.9.1: /usr/share/doc/libuuidtools-ruby1.9.1/changelog.Debian.gz
libuuidtools-ruby1.9.1: /usr/share/doc/libuuidtools-ruby1.9.1/copyright
mingw-w64-dev: /usr/i686-w64-mingw32/lib/libuuid.a
mingw-w64-dev: /usr/x86_64-w64-mingw32/lib/libuuid.a
mingw32-runtime: /usr/i586-mingw32msvc/lib/libuuid.a
pandora-build: /usr/share/aclocal/pandora_have_libuuid.m4
uuid-dev: /usr/lib/x86_64-linux-gnu/libuuid.a
uuid-dev: /usr/lib/x86_64-linux-gnu/libuuid.so
wine1.4-amd64: /usr/lib/x86_64-linux-gnu/wine/libuuid.a

I look at this list and choose uuid-dev

4c. Install the chosen package
user@localhost:~/iperf-3.0b4$ sudo apt-get install uuid-dev

5. Re-run ./configure to confirm success
If no other errors run make to build the tool.

6. user@localhost:~/iperf-3.0b4$ make
Now you can look in the src directory for iperf3 which is a compiled version you can use on the same architure of linux...enjoy the iperf tool

Here is a good site on how to use iperf basics linhost.info/2010/02/iperf-on-windows/. Note: it was written with iperf2 on Windows. Perhaps I will write a quick guide, later, regarding my primary use case for iperf, validating VPN performance.

No comments: