Compiling WSPR

This page details how I compiled K1JT's WSPR software on my amd64 Ubuntu 11.04 machine. It should work for 32-bit machines too. I decided to compile the code as opposed to using the provided Ubuntu DEB file, as the "--force-architecture" command didn't work. '''This page has been updated for WSPR v4. There's also a version of this page for Compiling WSPR-X!'''

If this page was useful, please consider Donating to me.

= Installing the Required Software = Before we can start, we need to get the required software to download and compile the source code. K1JT's page (here) tells us exactly what we need. We also need a couple more programs. I installed:


 * subversion
 * python2.7-dev (I used python2.5-dev on earlier viersions)
 * python-numpy
 * python-imaging-tk
 * python-pmw
 * libportaudio2
 * libportaudio-dev
 * libsamplerate0-dev
 * g95 (I used gfortran - some issues around this, and some people say you have to use g95. Mine works fine...)
 * portaudio19-dev
 * cl-fftw3

To install these from the console, use

sudo apt-get install subversion python2.7-dev python-numpy python-imaging-tk python-pmw \ libportaudio2 portaudio19-dev libsamplerate0-dev gfortran cl-fftw3 python-dev

= Getting the Source Code = Once the above have installed, we can download the WSPR source code from SVN. I like to create a folder for it to all live in, while i work with it. Create a folder and 'cd' into it with the terminal. We can then use SVN to download the sourcecode. At the time of writing, this was revision 2225.

svn co http://svn.berlios.de/svnroot/repos/wsjt/branches/wspr

Once it has downloaded, cd into the wspr directory again.

= Configure = The configuration is the hardest part. You need to satisfy the dependencies of the program. There is a trick... Start off by running the configuration utility, ./configure.

./configure

If you get an error message complaining about missing port audio, something like the following

This program needs portaudio v19 to compile. Please use --with-portaudio-include-dir= and --with-portaudio-lib-dir= to set the paths. configure: error: Please check error messages and install missing packages.

Then you will need to use the following sub section too...

Couldn't Find PortAudio
For some reason when I run the configure script, it wasn't able to find the portaudio libraries. This was rectified by specifying their path. On my 64 bit system, the command is as follows:

./configure --with-portaudio-lib-dir=/usr/lib/x86_64-linux-gnu/

On my 32 bit system, the command is as follows:

./configure --with-portaudio-lib-dir=/usr/lib/i386-linux-gnu/

On the Raspberry Pi, the command was:

./configure --with-portaudio-lib-dir=/usr/lib/arm-linux-gnueabihf/

The path can be found using following two commands. The cd commands moves into the libraries directory, and the find command looks for the library we're after! Then you just put the path of the libportaudio.so file on the configure string, as you can see from the above examples:

cd /usr/lib find -iname "libportaudio.so"

You should have it already installed, and a path such as /usr/lib/XXXXX/ would seem correct. XXXXX depends on your kernel, but you can see mine above.

What Success Looks Like
If all is well, then you will get something like this in your terminal

configure: creating ./config.status config.status: creating Makefile Using gfortran as fortran compiler. Compiling wspr 1.11 Installing into: /usr/local/

If you don't get this, then something has gone wrong. Check the output, looking for any tell-tail signs.

Finding Missing Stuff
When I first run the configure command, I was missing portaudio19-dev (which is why it's on the bottom of the list!). I got this error in the output of the configure command

checking for a v19 portaudio ... portaudio not found trying FreeBSD paths checking for a v19 portaudio in FreeBSD paths.... no

and then at the very end

This program needs portaudio v19 to compile. Please use --with-portaudio-include-dir= and --with-portaudio-lib-dir= to set the paths. configure: error: Please check error messages and install missing packages.

Fortunately, if you install everything that is missing, the configure script will find these missing libraries. Running

sudo apt-get install portaudio19-dev

Fixes this problem. It shouldn't arise for you, as it is mentioned in the list above. However, similar libraries may be missing. Keep repeating this, until you get the success messages above.

= Compile = If you got all the dependencies met in the Configuring stage, the compilation should be plain sailing. To compile, run

make

The compilation throws a good few, warnings, skipping, etc, but at the end it finished with an error status of 0.

= Running = Typically, with compiled applications, you would run sudo make install and install the compiled program into the system. However, I don't recommend this with WSPR. I would take to changing into the directory you built it in, and running from there, with

./wspr

And, with any luck, you'll get the WSPR program up and running.

Click to enlarge

And there we have it.

= Mac OS X = As Griff (M0HWS) mentioned in an email to me, to use the CAT interface with the OS X build of WSPR requires putting the HamLib libraries, specifically the rigctl binary. I cannot remember the exact details for how I did this, but I can offer you my Application to download. It is based on WSPR 3.0 from NH6Z (as above) with the HamLib files added in by myself. Feel free to strip the hamlib and rigctl files from this package and add them to your own, or simply run my package (after changing the callsign, of course!). The files required are located inside the Package's Resource folder: /WSPR.app/Contents/Resources/  It should be evident which files are hamlib as they all have that in their name. Don't forget rigctl too.

[[Media:WSPR_3_OSX_CAT.tar.bz2|WSPR 3.0 with CAT Files Included (HamLib & RigCtl)]] (~10MB)  TAR file includes WSPR.app which is an OS X compatible Application.

= Sources & References =
 * http://www.physics.princeton.edu/pulsar/K1JT/devel.html
 * (Retrieved 24/10/2010)


 * http://oh2gqc.wippiespace.com/WSPR_on_Ubuntu.html
 * (Retrieved 24/10/2010)


 * http://wsprnet.org/drupal/node/2066
 * (Retrieved 24/10/2010)