Tag Archives: source code

Compiling fldigi on the Raspberry Pi

Why, one might ask, would one want to run fldigi on a raspberry pi? Perhaps you want to get familiar with Linux before sacrificing a larger system to it.  Maybe you feel like you need practice compiling software. And maybe, you are like me, and when asked I said, “Because I can?”

Whatever your reason, the raspberry pi is not the ideal platform to run fldigi on, but it is not a bad platform for demonstrations, and testing.  But getting from here to there is not straight forward.

Now, you don’t have to compile the code.  You can pull a version from the repos with:

sudo apt-get install fldigi

But the version you are grabbing may not be the most recent one, and there are occasionally some issues with backwards compatability.  I did try downloading the precompiled binary but at least for version 3.21.78, the binary did not run on the pi, even though it ran without issues on Ubuntu on my netbook.

Which leaves the tried and true method. Compile the code from scratch.  And I thank the developers for providing the source code that allows me to do this.

But, like most software, when you start down the path of compilation, you occasionally have to make a detour (or three) to get it working right. So I will help here by taking you down the road I went, but I don’t guarentee you will get there from here.  This is just what I did, and what I wrestled with getting there.

One thing I will point out is that this is a long process, partly because of the number of packages that need to be fetched and installed and partly because of the capabilities of the pi.  Can you do it all in one sitting? Yes. But you might want to plan to take a couple of breaks along the way.

Ready?  Here we go…

In the beginning

Before you begin, you need a running Pi. I am going to assume you have already installed the software, and performed the inital configuartion, but not much more. If it has been a bit since you lastupdated your Pi, you might want to do that first. By the way, I will assume throughout that you are connected to a live Internet connection and have already figured out how to log in. Most of the following commands are excuted at the command line.

  • Update the repository on your Pi:
sudo apt-get update
  • Actually upgrade the Pi:
sudo apt-get upgrade

It might take a couple of minutes for this to grind through all the packages it needs to get, and then update.

Although you do not have to reboot the pi, if you got a new kernel during your update, it will benefit you to reboot and make sure the new kernel is working properly before you dive into the next part.

To reboot, you can issue this command:

sudo init 6

You can also issue this:

sudo shutdown now -r

Now that the software is up to date, and the kernel is good, we can get serious!

Prerequisits

Before you can begin, you should grab all the files you will need. I find it easiest to put all my downloads into a single place, called source, so I can find them when I am looking for them later.

mkdir source

Depending on how you download your code, you can open a browser and download it (suggested because how often fldigi changes) or you can use wget.  Grab the files you want from the fldigi download site. You will also need some other files.

  • Install the X11 development libraries (we will do that in a minute)
  • Install the libpng development libraries
  • fltk. I used version 1.3.2 (http://www.fltk.org/software.php)
  • Python Setup Tools (incl Easy Install)
  • Secret Rabbit Code. I used version 0.1.8. You need this for the samplerate python code (http://www.mega-nerd.com/SRC/download.html)
  • scikits.samplerate. I used version 0.3.3. (https://pypi.python.org/pypi/scikits.samplerate)

Install the development libraries from the repositories:

sudo apt-get install libx11-dev libpng12-dev python-setuptools python-dev python-numpy python-scipy libblas-dev liblapack-dev

It will ask to install some additional dependancies. Say yes and let it go.

Compile the fltk toolkit

  1. Chage into the source directory.
    cd source
  2. Untar the source file (I will only document this once – I will assume you can follow along after this).
    tar zxvf fltk-1.3.2.tar.gz
  3. Change into the fltk directory.
     cd fltk-1.3.2
  4. Configure the source tree and makefile (note the dot before the slash – you have to do that or it will error out at you).
    ./configure
  5. Compile! (and grab a snack…took about 15 minutes).
    make
  6. Install the software.
    sudo make install
  7. With luck, there are no errors and the software is installed.  I did get a few errors about depricated code in the X11 libraries that the fltk program warned about, but did not error out at compile time. You can safely ignore those sorts of errors.
  8. You are done with this step.

Compile the samplerate toolkit

  1. Chage into the source directory, untar the file and move into the directory.
  2. Configure the source tree
    ./configure
  3. Take note of the compiling information
    Compiling some other packages against libsamplerate may require the addition of "/usr/local/lib/pkgconfig" to the PKG_CONFIG_PATH environment variable.
  4. Compile! (It takes a bit to compile this code, be patient)
    make
  5. Install
    sudo make install
  6. Update the package configuation path (PKG_CONFIG_PATH) – command is all on one line.
    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
  7. Move into the scikits.samplerate directory
  8. Python programs are or can be a bit tricky.  When in doubt, alway review the README to make sure nothing has changed.  You may need to do this first:
    sudo easy_install -U distribute
  9. Move into the scikits.samplerate directory and run setup.py
  10. python setup.py
  11. You will get a menu like this:
    pi@jake:~/source/scikits.samplerate-0.3.3$ python setup.py
    ========================================================================
    Starting interactive session
    ------------------------------------------------------------------------
    
    Tasks:
      i       - Show python/platform/machine information
      ie      - Show environment information
      c       - Show C compilers information
      c - Set C compiler (current:None)
      f       - Show Fortran compilers information
      f - Set Fortran compiler (current:None)
      e       - Edit proposed sys.argv[1:].
    
    Task aliases:
      0         - Configure
      1         - Build
      2         - Install
      2 - Install with prefix.
      3         - Inplace build
      4         - Source distribution
      5         - Binary distribution
    
    Proposed sys.argv = ['setup.py']
    
    Choose a task (^D to quit, Enter to continue with setup):
  12. Choose 0 to configure, then press Enter. It will dump you at a “press Enter to close.” Go ahead and press enter.
  13. Start it again, select 1. Press Enter and it will start building (you might get a few warnings). Press enter to be returned to the command line.
  14. To install the packge, start it again, with sudo:
    sudo python setup.py
  15. Press enter to return to the command prompt. You are done with this step.

Comple fldigi

  1. Change directory to the source directory and untar fldigi, then move into the fldigi directory.
    cd ~/source
    tar zxvf fldigi-<version>.tgz
    cd fldigi-<version>
  2. Configure the software source tree and makefile.
    ./configure
  3. Compile! And grab a snack…it takes a bit and maxes out the CPU.
    make
  4. Install
    sudo make install
  5. And that is that. You can now fire it up by opening up and testing it. The most straigtforward way is to click on the bird-like icon on the far bottom left corner, which brings up a pick list. Slide up to “Internet” and Fldigi is on the list. Click on it and it will start. (Fldigi does not like running through vnc).
  6. Now on to the other software! (What you thought you were done?)

Next, we will compile and install flmsg.