NetBSDInstallTsung

How to install tsung on Net BSD

NetBSD is kind of an "on today, off tomorrow" thing for me. Every time, I test it, I have nothing but good things to say about that operating system, but, for some kind of reason, it never goes beyond the point of testing something...

Maybe this is going to change, since I now have a brand new NetBSD 6.0 virtual machine on my main PC at work! ;-)

Anyway, on to the main show...

Tsung is a very nice HTTP/HTTPS/LDAP/MYSQL load tester that we have decided to use at work, so I thought installing it under my NetBSD virtual machine is a nice test of my UNIX fu.

Under NetBSD 6.0, I will assume in this documentation that you already have installed pkgsrc (this is a question that is asked during the installation of the operating system) - if not, please do so now, as this is going to save you a lot of time!

1. Install Erlang

As root, start by accepting the Erlang license, which is somewhat controversial in NetBSD, or so it seems. To do this, enter:

# echo "ACCEPTABLE_LICENSES= erlang-public-license" >> /etc/pkg_install.conf

This being done, simply cd /usr/pkgsrc/lang/erlang and enter:

# make all && make install

And... That's it! The pkgsrc system will simply download and install everything that is needed to install erlang under Net BSD. Nice, isn't it?

2. Install Tsung pre-requisites

Again, nothing too earth-shattering, the main pre-requisites are Perl 5 and gnuplot, which are fairly easy to find in the /usr/pkgsrc/ tree:

# cd /usr/pkgsrc/lang/perl5

# make all && make install

# which perl
/usr/pkg/bin/perl

# perl --version

This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-netbsd-thread-multi

Copyright 1987-2011, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

That's done! Now, gnuplot is not much more difficult...:

# cd /usr/pkgsrc/graphics/gnuplot
# make all && make install
# which gnuplot
/usr/pkg/bin/gnuplot

One important caveat to the above: you also need GNU Make, which can also be found within pkgsrc, in /usr/pkgsrc/devel/gmake. Just why is explained below...

3. Install Tsung

Now, download Tsung from its official download page (see the section below) and unpack the TAR archive:

$ tar xvzf tsung-1.4.2.tar.gz   
$ cd tsung-1.4.2 
$ ./configure
$ gmake all
$ sudo gmake install

Please note that the make / make install commands above are with gmake, which is very often the case under Linux systems... If you try doing a simple make all && make install, you will use BSD make... and you'll get some serious error messages, such as:

$ make clean
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 5: Need an operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 14: Need an operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 45: Need an operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 47: Missing dependency operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 49: Need an operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 50: Missing dependency operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 52: Need an operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 54: Need an operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 55: Need an operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 57: Missing dependency operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 59: Need an operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 67: Missing dependency operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 70: Need an operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 72: Need an operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 104: Missing dependency operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 106: Need an operator
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 425: warning: duplicate script for target "ebin/%.beam" ignored
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 422: warning: using previous script for "ebin/%.beam" defined here
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 426: warning: duplicate script for target "ebin/%.beam" ignored
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 422: warning: using previous script for "ebin/%.beam" defined here
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 434: warning: duplicate script for target "ebin/%.beam" ignored
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 422: warning: using previous script for "ebin/%.beam" defined here
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 435: warning: duplicate script for target "ebin/%.beam" ignored
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 422: warning: using previous script for "ebin/%.beam" defined here
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 438: warning: duplicate script for target "ebin/%.beam" ignored
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 422: warning: using previous script for "ebin/%.beam" defined here
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 439: warning: duplicate script for target "ebin/%.beam" ignored
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 422: warning: using previous script for "ebin/%.beam" defined here
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 442: warning: duplicate script for target "ebin/%.beam" ignored
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 422: warning: using previous script for "ebin/%.beam" defined here
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 443: warning: duplicate script for target "ebin/%.beam" ignored
make: "/home/gil/gil/tsung-1.4.2/Makefile" line 422: warning: using previous script for "ebin/%.beam" defined here
make: Fatal errors encountered -- cannot continue
make: stopped in /home/gil/gil/tsung-1.4.2

Once this has been done, you now have a brand new installation of tsung, which can be found in:

# which tsung
/usr/pkg/bin/tsung

# tsung -v 
Tsung version 1.4.2

Hope this helps!

See Also: