MingwInstallMain
Installing GNU Radio with MinGW and MSYS
NOTE: Many of the versions mentioned in this document are far outdated by now. Some required libraries are no longer required. These instructions are largely centered around old versions of GNU Radio and barely apply to versions newer than 3.3 (which is ancient by any means).
These instructions are for using MinGW and MSYS to install and build GNU Radio software, including USRP TX/RX support, under Windows XP.
NOTE: Do not use Windows folder names with spaces. This means that your default Windows home directory (typically C:/Documents and Settings/user-name/My Documents
) should not be used. Your MSYS home directory is a better place to work (unless your user name contains spaces).
You can build and use GNU Radio under MinGW/MSYS and Cygwin on the same system, but you will need separate build directories. It is easiest to have separate home directories and not try to share source code between the two systems.
Installation with MinGW/MSYS requires the following main steps:
- install Python and Python packages
- install MinGW and MSYS
- install prerequisites for GNU Radio
- install GNU Radio from tarball
or
- install GNU Radio from git repository
Install Python and Python Packages
The recommended version of Python for GNU Radio under MinGW/MSYS is Python 2.6.5. Versions 2.5 and 2.4 can be used if you already have them intalled. Later versions have not been tested. The instructions that follow assume you are using version 2.6.5.
Download Python 2.6.5 Windows installer (from http://www.python.org/download). Double-click python-2.6.5.msi to install. Edit the installation directory if needed; otherwise, the default options can be used.
Download numpy-1.4.1-win32-superpack-python2.6.exe (from http://sourceforge.net/projects/numpy/files). Double-click numpy-1.4.1-win32-superpack-python2.6.exe to install, using default options.
wxPython is not required to build GNU Radio, but many applications use it. To install it, download wxPython2.8-win32-ansi-2.8.10.1-py26.exe (from http://sourceforge.net/projects/wxpython/files). Double-click wxPython2.8-win32-ansi-2.8.10.1-py26.exe to install. You may need administrator privileges for this step.
Install MinGW and MSYS
To install MinGW and MSYS you will need to install the base systems then add the latest packages needed for GNU Radio. The following instructions assume that you install MinGW in C:/MinGW
and MSYS in C:/msys/1.0
.
Note: You can simply use the MinGW GUI installer mingw-get-inst-yyyymmdd.exe available from http://mingw.org/wiki/Getting_Started and choose the following options to install: C++ compiler, Fortran compiler, MSys basic system, MinGW developer tookit. If you do it this way, you have all the packages installed and can jump to "Install Prerequisites for GNU Radio" directly. The installer will install msys under MinGW directory, so you will have something like 'C:/MinGW/msys/1.0/local'. Please adjust the relevant path accordingly in the following.
Install base MinGW and MSYS
Download MinGW-5.1.6.exe (from http://sourceforge.net/projects/mingw/files). Double-click on MinGW-5.1.6.exe to run the installer. Select the "Candidate" and "g++ compiler" options.
Download MSYS-1.0.11.exe (from http://sourceforge.net/projects/mingw/files). Double-click on MSYS-1.0.11.exe to run the installer; use the default settings. Type "y" to continue with post install, "y" when asked if MinGW is installed, and "C:/MinGW" when prompted for the MinGW install directory.
More recent versions of MSYS are available, but automated installers are not yet available for them, and they don't seem to be needed for building GNU Radio.
The MSYS instllation should produce an MSYS icon on your desktop. Double-clicking this icon will start an MSYS shell. All commands given in the following instructions should be entered in an MSYS shell.
MinGW packages
Download the following packages to C:/MinGW
. These can be found at http://sourceforge.net/projects/mingw/files, but the direct links below are faster:
- autoconf2.5-2.64-1-mingw32-bin.tar.lzma
- autoconf-7-1-mingw32-bin.tar.lzma
- automake1.11-1.11-1-mingw32-bin.tar.lzma
- automake-4-1-mingw32-bin.tar.lzma
- libtool-2.2.7a-1-mingw32-bin.tar.lzma
Install each file
above with the following commands:
cd /mingw tar --lzma -xf file
MSYS packages
Download the following packages to C:/msys/1.0
. These can be found at http://sourceforge.net/projects/mingw/files, but the direct links below are faster:
- perl-5.6.1_2-1-msys-1.0.11-bin.tar.lzma
- m4-1.4.13-1-msys-1.0.11-bin.tar.lzma
- guile-1.8.7-1-msys-1.0.11-bin.tar.lzma
- libcrypt-1.1_1-2-msys-1.0.11-dll-0.tar.lzma
- libguile-1.8.7-1-msys-1.0.11-dll-17.tar.lzma
- libgmp-4.3.1-1-msys-1.0.11-dll-3.tar.lzma
- libltdl-2.2.7a-1-msys-1.0.11-dll-7.tar.lzma
- libregex-1.20090805-1-msys-1.0.11-dll-1.tar.lzma
- libguile-1.8.7-1-msys-1.0.11-rtm.tar.lzma
Install each file
above with the following commands:
cd / tar --lzma -xf file
Create source directories with the commands:
cd /usr mkdir src mkdir local
In Windows, the source directory will be found at C:/msys/1.0/src
and the local directory at C:/msys/1.0/local
.
@ @
Install Prerequisites for GNU Radio
Unless otherwise noted, the following packages are required for building GNU Radio:
pkg-config
Download the following files from http://www.gtk.org/download-windows.html "to C:/msys/1.0/local
:
and unpack them (into C:/msys/1.0/local
) using Windows "Extract All..." or your favorite unzip utility.
- You might need gettext-runtime_0.18.1.1-2_win32.zip as well.
SWIG
Download
swigwin-1.3.40.zip (from http://www.swig.org/download.html) to C:/msys/1.0/local
. Extract swigwin-1.3.40.zip
to create the folder swigwin-1.3.40
. You can move this folder to another location, but the instructions below assume it is in /usr/local
(C:/msys/1.0/local
).
FFTW
Follow the instructions in installing FFTW.
Alternatively, you can install the prebuilt DLLs for Windows:
Download fftw-3.2.2.pl1-dll32.zip
Unpack it and create the import library as follows
dlltool -d libfftw3f-3.def -D libfftw3f-3.dll -l libfftw3f-3.a
Then copy the following files:
libfftw3f-3.dll --> C:\msys\1.0\local\bin
libfftw3f-3.a --> C:\msys\1.0\local\lib
fftw3.h --> C:\msys\1.0\local\include
Create the following pkgconfig file fftw3f.pc in C:\msys\1.0\local\lib\pkgconfig
prefix=/usr/local exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: FFTW Description: Fast Fourier Transform Library Version: 3.2.2 Libs: -L${libdir} -lfftw3f-3 -lm Cflags: -I${includedir}
CppUnit
Download cppunit-1.12.0.tar.gz (from http://sourceforge.net/projects/cppunit/files/cppunit/1.12.0) to C:\msys\1.0\src
. From an MSYS shell, install it with:
cd /usr/src tar -zxf cppunit-1.12.0.tar.gz cd cppunit-1.12.0 ./configure --disable-static make make check make install
Note that attempts to build CppUnit 1.12.1 under MinGW/MSYS fail at the make check
step.
Boost
Download boost_1_43_0.tar.bz2 (from http://www.boost.org/users/download) to /usr/src
(C:/msys/1.0/src
) and install it with the commands:
cd /usr/src tar -jxf boost_1_43_0.tar.bz2 cd boost_1_43_0 ./bootstrap.sh --with-toolset=mingw ./bootstrap.sh --with-libraries=thread,date_time,program_options --with-bjam=tools/jam/src/bin.ntx86/bjam ./bjam --prefix=/usr/local link=shared install mv /usr/local/lib/*boost*.dll /usr/local/bin
Don't be alarmed at how long this takes---Boost is a large library.
- boost_1_44 and boost_1_45 failed on tar jxf.
GNU Scientific Librry (GSL)
Download gsl-1.14.tar.gz (from http://www.gnu.org/software/gsl) to C:\msys\1.0\src
. From an MSYS shell, install it with:
cd /usr/src tar -zxf gsl-1.14.tar.gz cd gsl-1.14 ./configure --disable-static make make check make install
PortAudio
This package is optional. It is needed to build gr-audio-portaudio, which currently works better than gr-audio-windows. See hints, tips, and known problems and solutions for Windows for more information.
To install PortAudio see installing PortAudio.
Small Device C Compiler (SDCC)
SDCC is not required to build GNU Radio but is needed to use the USRP.
Download sdcc-2.9.0-setup.exe (from http://sourceforge.net/projects/sdcc/files). Double-click on sdcc-2.9.0-setup.exe to install; the default prompts work fine, but only the base tools and the include files are needed. SDCC is installed in C:\Program Files\SDCC. You will be given the option of adding this location to your Windows PATH; you can either do this (once only!) or add /c/Progra~1/SDCC/bin to your MSYS PATH (see PATH environment variable below).
- Note that sdcc-3.0 does not work.
USB Library for Windows (libusb-win32)
This is not required to build GNU Radio but is needed to use the USRP.
Download libusb-win32-device-bin-0.1.12.2.tar.gz (from http://sourceforge.net/projects/libusb-win32/files) to C:\msys\1.0\src
. From an MSYS shell, install it with:
cd /usr/src tar -zxf libusb-win32-device-bin-0.1.12.2.tar.gz cd libusb-win32-device-bin-0.1.12.2 cp include/* /usr/local/include cp lib/gcc/* /usr/local/lib cp bin/* /usr/local/bin
NOTE: You must have Windows XP Service Pack 2 or later, or at least have hotfix KB838989. See http://support.microsoft.com/kb/838989 for more information.
Note: For Windows Vista / Windows 7, you might need the newer version of libusb
Download libusb-win32-bin-1.2.2.0
Unpack it and copy the following files:
bin/x86 (you should choose amd64 for 64-bit OS): libusb0.sys libusb0_x86.dll (rename to libusb0.dll) testlibusb-win.exe testlibusb.exe --> /usr/local/bin
include: usb.h --> /usr/local/include
lib/gcc: libusb.a --> /usr/local/lib
Create the following pkgconfig file libusb.pc in /usr/local/lib/pkgconfig
prefix=/usr/local exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: libusb Description: C API for USB device access from Linux userspace Version: 1.2.2.0 Libs: -L${libdir} -lusb Cflags: -I${includedir}
Set PATH Environment Variable
You need to be sure that the GNU Radio build process can find Python and SWIG. One way to do this is to include them directly in your PATH variable. You can edit the file /etc/profile
(i.e., C:\msys\1.0\etc\profile
) to include a line like:
export PATH="$PATH:/c/Python26:/usr/local/swigwin-1.3.40:/c/Progra~1/SDCC/bin"
or you can adjust your PATH in ~/.bash_profile
. You can also add lines to /etc/profile
or ~/.bash_profile
to define the path to USRP firmware files and the GNU Radio Python modules:
export USRP_PATH=/usr/local/share/usrp export PYTHONPATH=/usr/local/lib/site-packages
These changes will take effect the next time you start a new MSYS shell.
Another way to make Python and SWIG available is to add scripts in the default PATH to point to the necessary programs. For example, the following script can be placed in /usr/local/bin/swig
:
#! /bin/sh exec /usr/local/swigwin-1.3.40/swig.exe "$@"
The script for python
(in /usr/local/bin/python
) is a little more complicated:
#! /bin/sh if test $# -ne 0; then exec /c/Python26/python.exe "$@" else exec /c/Python26/python.exe -i fi
Install Prerequisites for Gnuradio Companion (GRC) (Optional)
Download Cheetah-2.4.3.tar.gz to /usr/src
tar zxf Cheetah-2.4.3.tar.gz cd Cheetah-2.4.3 python setup.py install
Download lxml-2.2.8.win32-py2.6.exe
Double click to install.
Install GTK+
Goto http://www.gtk.org/download/win32.php
Download all of the runtime pakcages (choose the latest version) there and unpack them to corresponding subdirectoies under /usr/local
(You have already done that for glib, pkg-config and gettext earlier.)
Download the following files and double click to install PyGtk, PyCairo and PyGObject
http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/pygtk-2.22.0.win32-py2.6.exe
http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.8/pycairo-1.8.10.win32-py2.6.exe
http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.26/pygobject-2.26.0.win32-py2.6.exe
- Note: In case gnuradio-companion failed to launch with message "Error: options... Failure", include the following in ~/.gnuradio/config.conf
[grc] local_blocks_path=C:/msys/1.0/local/share/gnuradio/grc/blocks
Make sure you use Windows style path name here rather than unix style.
Install libSDL for gr-video-sdl (optional)
Download SDL-devel-1.2.14-mingw32.tar.gz
Unpack and copy files under directories bin/ include/ lib/ man/ share/ to corresponding directories under /usr/local
Install GNU Radio From Tarball
NOTE: The following instructions are written for GNU Radio release candidate 3.3.0-rc0. It is expected that they will apply to later candidate releases and to release 3.3.0 when they become available. To build a release other than 3.3.0-rc0, substitute the number of the release wherever 3.3.0-rc0
appears in the following instructions.
Download ["|gnuradio-3.3.0-rc0.tar.gz] (from http://gnuradio.org/releases/gnuradio or ftp://ftp.gnu.org/gnu/gnuradio) to a convenient directory. Note that this directory must not contain spaces in its name. From an MSYS shell, unpack the downloaded file and begin the installation with the commands:
tar -zxf gnuradio-3.3.0-rc0.tar.gz cd gnuradio-3.3.0-rc0 export PKG_CONFIG_PATH=/usr/local/pkgconfig export CXX="g++ -mthreads" export CPPFLAGS="-DWINVER=0x0501 -I/usr/local/include" export LDFLAGS="-L/usr/local/lib -lws2_32" ./bootstrap ./configure --prefix=C:/msys/1.0/local
With luck, the ./bootstrap
command won't be necessary in future releases; don't be surprised if it gives a bunch of warning messages.
The ./configure
command should produce a lot of output, ending with a list of components that have been successfully configured and a list of components that were skipped. Check the list of skipped components to see if any that you need are listed; if they are, you will need to examine the output listing and the file config.log
to figure out why they were skipped. After correcting the problem, you will need to repeat the ./configure
command.
Next, in an MSYS shell, build the GNU Radio software with the command:
make
Check that everything built properly with:
make check
Install the GNU Radio software with the command:
make install
To run GNU Radio applications you need to have the directories containing Python and for the various DLLs used by GNU Radio in your PATH. You also need to set PYTHONPATH to the directory containing the GNU Radio Python modules.
@ @
In an MSYS shell, your path should already include most or all of the necessary directories. If you do not have a link to Python in /usr/local/bin
you will need to have C:/Python26
in your PATH. You can add it with:
export PATH="${PATH}:/c/Python26"
in /etc/profile
or ~/.bash_profile
or anytime prior to using Python (or you can add it to your Windows PATH). You will also need to specify the path to the GNU Radio Python modules:
export PYTHONPATH=/usr/local/lib/site-packages
This can also be done in /etc/profile
or ~/.bash_profile
.
@ @
In a Windows CMD shell, you need to add several directories to your PATH:
set PATH=%PATH%;C:\Python26;C:\msys\1.0\local\bin;C:\mingw\bin set PYTHONPATH=C:\msys\1.0\local\lib\site-packages
USRP Driver Installation
If you have a USRP, you will need to install the driver for it. Refer to [http://gnuradio.org/trac/wiki/USRPWindowsDriverInstall Installing the USRP Driver for
Windows]. However, note that 2 of the 3 files you need are in different
locations than shown in those instructions. Instead, you should use the following copy commands (substituting your top-level GNU Radio directory for gnuradio
):
cp /usr/bin/libusb0.* gnuradio/usrp
Then, follow the remaining instructions on the USRP driver install Wiki page.
Your USRP should be ready to go!
Note: If you are on Windows Vista/7, you make sure you use the libusb-win32-bin-1.2.2.0 version of drivers. (see section libusb-win32 above)
Install GNU Radio From Git Repository
Install git for windows from http://code.google.com/p/msysgit/
Clone the repository
git clone git://gnuradio.org/gnuradio cd gnuradio
At the present, the following two changes are necessary:
(1) gruel/src/lib/test_gruel.cc: add the following 3 lines at the beginning of the file
#ifdef HAVE_CONFIG_H #include #endif
(2) usrp/host/lib/fusb_win32.cc: add #include<cstdio>
at the beginning of the file.
Then follow exactly the same procedure as Install GNU Radio From Tarball.
Build Gnuradio with UHD
With UHD we can use all USRPs on windows, which is a nice feature we have been waiting for long.
First we need to build UHD from source.
Build UHD
- Note that the binary package UHD-xxx-win32.exe does not work with MinGW. MinGW will not be able to use the uhd.dll prebuilt with MSVC.
Therefore, we need to build UHD from source.
Prerequisite:
CMake: download the binary windows zip file http://www.cmake.org/files/v2.8/cmake-2.8.5-win32-x86.zip
Unzip and copy bin/ and share/ to under /usr/local/
Boost: UHD needs 7 libraries: thread,date_time,program_options,filesystem,system,test,regex. Build similarly as before, but with additional libraries
./bootstrap.sh --with-toolset=mingw ./bootstrap.sh --with-libraries=thread,date_time,program_options,filesystem,system,test,regex --with-bjam=tools/jam/src/bin.ntx86/bjam ./bjam --prefix=/usr/local link=shared install mv /usr/local/lib/*boost*.dll /usr/local/bin
LibUSB: for USRP1, we need libusb-1.0. Download binary from http://libusb-winusb-wip.googlecode.com/files/libusb_2011.07.20.7z
unzip and copy include/ to /usr/local/include/, MinGW32/dll/libusb-1.0.dll to /usr/local/bin/, MinGW32/dll/libusb-1.0.dll.a to /usr/local/lib/
create libusb-1.0.pc in /usr/local/lib/pkgconfig/
prefix=/usr/local exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: libusb-1.0 Description: C API for USB device access from Linux userspace Version: 1.0.8.0 Libs: -L${libdir} -lusb-1.0 Cflags: -I${includedir}/libusb-1.0
Cheetah: please refer to building GRC section if you have not done it.
Build UHD
git clone git@github.com:EttusResearch/uhd.git cd uhd
At time of writing, you need to modify host/lib/transport/CMakeLists.txt as follows:
Locate the Setup UDP section, change
IF(WIN32)
to
IF(MSVC)
Then
cd host mkdir build cd build cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local ../ make make install
Now UHD should be installed under /usr/local/
Download image files from http://www.ettus.com/downloads/uhd_releases/master_images/
Unzip and put all images under /usr/local/share/uhd/images/
[You could try to set environment variable UHD_IMAGE_PATH=/usr/local/share/uhd/images in case UHD cannot find the images]
For USRP1, download erllc_uhd_winusb_driver.zip from http://www.ettus.com/downloads/uhd_drivers/ and unzip.
Plug in usrp1 and install the driver 'Ettus Research LLC USRP1'
Now you can run uhd_find_devices and uhd_usrp_probe to verify the installation. Make sure the Device Manager shows correct driver for the USRP before and after firmware loading. Particularly, if you installed other usrp drivers before, you need to update the driver twice, before and after firmware loading.
Build Gnuradio with UHD support
Follow the exact same steps to rebuild Gnuradio. The configure script should recognize you have UHD installed, so it will enable gr-uhd. Then you are ready to go!