Monday, January 28, 2013

GNU Radio Windows Build Guide

GNU Radio 3.6.3 Windows 7 Build Guide

This is a guide to compiling GNU Radio version 3.6.3 Win32 on Windows 7 using Visual C++ 2010. I am writing this because I couldn't find specific enough information. It took me several days of trial and error to get a build with no errors. I hope this helps others to quickly get a working build so you can focus on doing cool GNU Radio stuff.

My Build Environment

This is my specific setup provided as a reference only.
Windows 7 64-bit Professional SP1
These instructions should work for all versions of Windows 7.

Microsoft Visual C++ 2010 Express SP1
I always run the compiler as an administrator to avoid file permission issues.

Visual C++ 2010 runtime SP1

DirectX SDK June 2010
Portaudio build requires this. There is a bug with the installer. If you have C++ 2010 SP1 runtimes  installed before installing the DxSDK it will error out. You have to uninstall all the C++ 2010 runtimes, then install DxSDK, and then re-install the SP1 runtimes.

Install Dependencies

This is the suggested order to install everything. Use default installation options unless otherwise noted.

Python 2.7.3

Numpy 1.6.2

Setuptools 0.6c11
After install run the following in a command prompt to install these packages.
<Python Install Dir>\Scripts\easy_install cheetah
<Python Install Dir>\Scripts\easy_install pyopengl
<Python Install Dir>\Scripts\easy_install lxml==2.3


Qt 4.8.4

PyQt 4.9.6
Don't install Qt runtime. This breaks the Qwt build.

PyQwt 5.2.1
Download it here
PyGtk 2.24.2

Boost 1.47
I installed all VS2010 non-debug variants because I am not sure which is used. Don't use Boost version 1.5.x. It will break the Gnu Radio build.


Git 1.8.0


Gsl 1.8
After install, open visual studio command prompt and run the following to create the .lib files
C:\Program Files (x86)\GnuWin32\lib\ lib /def:libgsl.def
C:\Program Files (x86)\GnuWin32\lib\ lib /def:libgslcblas.def

Swigwin 2.0.9

FFTw 3.3.3 
Open visual studio command prompt and run the following to create the .lib files 
<fftw-3.3.3 dir> lib /def:libfftw3-3.def
<fftw-3.3.3 dir> lib /def:libfftw3f-3.def
<fftw-3.3.3 dir> lib /def:libfftw3l-3.def

SDL developer 1.2.15

Qwt 6.0.2
Open visual studio command prompt and run the following
<qwt-6.0.2 dir> qmake
<qwt-6.0.2 dir> nmake

Cppunit 1.12.1.VS2010
Build using the VS2010 solution file.

Portaudio stable v19
Follow instructions for cmake build here.
Follow instructions for compiling here.
Don't change the preprocessor definitions. Cmake handles those.

Here are the files you need.

Get GNU Radio Source

Download GNU Radio version 3.6.3 from here

Extract the files. Move the source folder to C:\. Add 'build' directory to source directory, ex. C:\gnuradio-3.6.3\build. You can also put the build directory anywhere you want.

Run CMake

You will need to tell Cmake where to find all the dependencies. With the above dependencies installed, the only disabled components I had were sphinx, gr-comedi, gr-uhd, gr-shd. If you require any of these then download the needed files and configure cmake. After configuring, click on the generate button to create the VS2010 solution file.

Cmake build settings are stored in a CMakeCache.txt file. You can save a copy of this file which is stored here, C:\gnuradio-3.6.3\build, for future builds in order to  save time. When starting a new build, run configure initially to setup the build directory then exit Cmake and copy your saved CMakeCache.txt file into the build directory. Open Cmake and you should see all your settings loaded. Make any changes if needed and click configure again to double check and then you're ready to generate. This saved me a lot of time during my many failed builds.

Edit Source Files

Add '#include <io.h> ' to these two files to avoid a build error.

In order to make wxgui work with Windows make these source edits according to this revision here

GNU Radio Build

Open C:\gnuradio-3.6.3\build\gnuradio.sln. Set configuration manager to Release and Win32. Right click ALL_BUILD and click Build. Take a break. I have an Intel Core2 Duo E6750 @2.66Ghz with 4GB RAM and it takes about 30 minutes to compile.

I haven't gotten RUN_TESTS to work. It always errors out. I think it is some PATH issue but not sure.

Right click INSTALL and click Build. This will install in C:\Program Files (x86)\gnuradio.

Copy dll Files

Some dll files need to be copied into C:\Program Files (x86)\gnuradio\bin so gnuradio can run.

Here are the files you need to copy.

Add Environment Variables

Add to PATH, C:\Program Files (x86)\gnuradio\bin.
Add to PYTHONPATH, C:\Program Files (x86)\gnuradio\lib\site-packages.

Enable PortAudio

Edit this file, C:\Program Files (x86)\gnuradio\etc\gnuradio\conf.d\gr-audio.conf
audio_module = portaudio

When using audio source and sink blocks the audio device name should be the name listed in Windows device manager for your sound card. Copy it spaces and all.

Error Messages

Don't worry about cheetah namemapper error.
vmcircbuf error
gtk assert warning (g_utf8_validate)

They don't cause problems.


1 comment:

  1. Have the SD device on order. Will try this build hopefully Saturday or Monday