Installing GNU Radio with MinGW and MSYS

These instructions are for using MinGW and MSYS to install and build GNU Radio software, including USRP TX/RX support, under Windows XP.

These instructions include information from the old wiki pages at UsrpMinGW and MinGW.

NOTE: Do not use any spaces in your Windows folder names when creating new ones.

NOTE: Building under MinGW/MSYS can coexist peacefully with Cygwin installed. Set up separate home directories for the two systems until you are thoroughly familiar with both systems.

MinGW / MSYS


The easiest way to install MinGW and MSYS is to use the automated installers and then
update selected components as needed.
section of "the MinGW download area":http://sourceforge.net/project/showfiles.php?group_id=2435. Select the "Candidate", "g++", and "MinGW make" options in the
installation wizard.
<pre>
administrator privileges to do this.

<pre>
System/Current Release: MSYS-1.0.10" section of
<pre>
(you may need administrator privileges to do this). Type "y" to continue with post install, "y" when asked if MinGW is installed, and "C:/MinGW" when prompted for the MinGW install directory.
If you skip the post-install or install MSYS first, you will need to manually add the line
<pre>
C:/MinGW /mingw
</pre>
to the MSYS file @/etc/fstab@ (@c:\msys\1.0\etc\fstab@).

You can use MSYS version 1.0.11 if you prefer, but there is no installer yet (as of May 2008) for that version.

You can avoid some problems by intalling an updated version of bash. Download
<pre>
<pre>
C:/msys/1.0/bin/bzip2 -d bash-3.1-MSYS-1.0.11-1.tar.bz2
C:/msys/1.0/bin/tar -xf bash-3.1-MSYS-1.0.11-1.tar
</pre>
Be sure that the MSYS shell is not in use; otherwise you will get a message like
<pre>
/usr/bin/tar: bin/sh.exe: Cannot open: File exists
</pre>

<pre>
"the MinGW download area":http://sourceforge.net/project/showfiles.php?group_id=2435 using the default values.

The versions of autoconf, automake, and libtool loaded by the MSYS installer are too old. To get newer versions, download the following files from
the "User Contributed: mingwPORT/Current Releases" section of
"the MinGW download area":http://sourceforge.net/project/showfiles.php?group_id=2435:
* @wget-1.9.1-mingwPORT.tar.bz2@
* @autoconf-2.59-mingwPORT.tar.bz2@
* @automake-1.9.5-mingwPORT.tar.bz2@
to @/usr/src@ (create @/usr/src@ with @mkdir@ if you need to). Then run the following commands (in an MSYS shell window):
<pre>
mkdir /usr/local
mkdir /usr/local/bin
cd /usr/src
tar -jxf wget-1.9.1-mingwPORT.tar.bz2
cd wget-1.9.1/mingwPORT
cp wget.exe /usr/local/bin
cd /usr/src
tar -jxf autoconf-2.59.mingwPORT.tar.bz2
cd autoconf-2.59/mingwPORT
./mingwPORT.sh
cd /usr/src
tar -jxf automake-1.9.5.mingwPORT.tar.bz2
cd automake-1.9.5/mingwPORT
./mingwPORT.sh
</pre>
You need to edit @/mingw/bin/aclocal@ to change all occurrences of @C:/@ to @/C/@. You can do this with the editor of your choice (provided that it does not add formatting to the
file or change the end-of-line separators), or you can use sed:
<pre>
cd /mingw/bin
mv aclocal aclocal.orig
sed s.C:/./C/.g aclocal.orig > aclocal
</pre>

You may not need them, but it is convenient to have the utilities from @mingw-utils-0.3.tar.gz@ (from the "MinGW Utilities/Current Release: mingw-utils-0.3" section at "MinGW download
area at SourceForge":http://sourceforge.net/project/showfiles.php?group_id=2435. Download these to @C:/MinGW@ and unpack with @tar -zxf@.

h2. Python

_Note: The latest version of Python that is known to work with GNU Radio is Python 2.4.4. Versions
2.5.1 and 2.5.2 have been tried without success (builds work fine but GNU Radio modules cannot
be loaded) and version 2.4.5 is not available in a binary version for Windows."

Download python-2.4.4.msi from "Python 2.4.4":http://www.python.org/download/releases/2.4.4.

Download numpy-1.0.4.win32-py2.4.exe from "Numerical Python":http://sourceforge.net/project/showfiles.php?group_id=1369.

Double-click python-2.4.4.msi to install, using default prompts.

Double-click numpy-1.0.4.win32-py2.4.exe to install, using default prompts.

h2. GNU Radio Dependencies

Unless otherwise noted, the following packages are required for building GNU Radio:

h3. libtool 2.2

Install libtool 2.2 using the instructions in hints tips known problems and solutions for Windows.

h3. WxPython for Win32

WxPython is not required to build GNU Radio, but many applications use it.

_Not certain if Unicode can be used with GNU Radio. These instructions use ANSI._

Download wxPython2.8-win32-ansi-2.8.7.1-py24.exe from "Double-click on wxPython2.8-win32-ansi-2.8.7.1-py24.exe to install, using default prompts. You may need administrator privileges for this step.[[BR":http://wxpython.org/download.php].
]

h3. pkg-config

Download the following files from "to @C:/msys/1.0/local@:
* GLib 2.16.3 Binaries (@glib-2.16.3.zip@)
* pkg-config 0.23 Tool binaries (@pkg-config-0.23-2.zip@)
and unpack them (into @/local@) using Windows "Extract All..." or your favorite unzip utility.
If you prefer, you can install these in @C:/MinGW@.

h3. SWIG

Download @swigwin-1.3.35.zip@ from [http://sourceforge.net/project/showfiles.php?group_id=1645 SWIG downloads":http://www.gtk.org/download-windows.html].
Extract @swigwin-1.3.35.zip@ to create the folder @swigwin-1.3.35@. You can put this folder in @C:\@, @/mingw@ or @/usr/src@. The instructions below assume it is in @C:\@.

h3. Boost

Download @boost_1_33_1_headers.zip@ from "Boost downloads":http://sourceforge.net/project/showfiles.php?group_id=7586, under "boost-subparts".
Extract @boost_1_33_1_headers.zip@ to @C:\msys\1.0\local\include@. To build from the svn trunk you will need boost 1.35 or later; see hints tips known problems and solutions for Windows.

h3. CppUnit

Download @cppunit-1.12.0.tar.gz@ from "CppUnit downloads":https://sourceforge.net/project/showfiles.php?group_id=11795 to a convenient directory (e.g., @C:\msys\1.0\src@). From an MSYS shell:
<pre>
tar zxf cppunit-1.12.0.tar.gz
cd cppunit-1.12.0
./configure
make
make check
make install
</pre>
_Note: Attempts to use CppUnit 1.12.1 have failed in the @make check@ step._

h3. FFTW

_NOTE: Installing only the prebuilt DLLs from "is not sufficient for building GNU Radio unless you know how to create the necessary pkgconfig file. Instructions on how to do this are welcome._

Follow the instructions in installing FFTW"httpwwwfftworginstallwindowshtml.

h3. Small Device C Compiler (SDCC)

Not required to build GNU Radio but needed to use the USRP.

Download sdcc-2.8.0-setup.exe from "SDCC downloads":http://sourceforge.net/project/showfiles.php?group_id=599.
Double-click on sdcc-2.8.0-setup.exe to install; the default prompts work fine, but only the base tools and the include files are needed. SDCC gets installed to 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).

h3. Simple DirectMedia Layer (SDL)

This provides video capabilites; it is optional.

Download SDL-devel-1.2.13-mingw32.tar.gz from "Unpack and install with:
<pre>
tar -zxf SDL-devel-1.2.13-mingw32.tar.gz
cd SDL-1.2.13
make cross CROSS_PATH=/usr/local
</pre>
You can also download the source and do @configure; make; make install@ if you prefer.

h3. USB Library for Windows (libusb-win32)

Not required to build GNU Radio but needed to use the USRP.

Download libusb-win32-device-bin-0.1.12.1.tar.gz from [http://sourceforge.net/project/showfiles.php?group_id=78138 libusb-win32 downloads":http://www.libsdl.org/download-1.2.php]. to a convenient directory. Install with:
<pre>
tar zxf libusb-win32-device-bin-0.1.12.1.tar.gz
cd libusb-win32-device-bin-0.1.12.1
cp include/* /usr/local/include
cp lib/gcc/* /usr/local/lib
cp bin/* /usr/local/bin
</pre>
*NOTE*: As described at "make sure your WinXP installation has Service Pack 2, or at least hotfix kb838989. Refer to [http://support.microsoft.com/kb/838989":http://www.comsec.com/wiki?UsrpMinGW], for more information.

h3. PortAudio

_This package is required to build gr-audio-portaudio, which currently works better than gr-audio-windows._ See hints tips known problems and solutions for Windows for more information.

To install PortAudio see installing [[PortAudio]].

If you are using bash version 2.04, both @make@ and @make install@ will encounter errors. The last few lines for the @make@ command look something like:
<pre>
for dir in ; do make -C $dir all; done
/bin/sh.exe: -c: line 1: syntax error near unexpected token @;'
/bin/sh.exe: -c: line 1: @for dir in ; do make -C $dir all; done'
make: *** [all-recursive] Error 2
</pre>

And, the last few output lines of the @make install@ command look like:
<pre>
for dir in ; do make -C $dir install; done
/bin/sh.exe: -c: line 1: syntax error near unexpected token @;'
/bin/sh.exe: -c: line 1: @for dir in ; do make -C $dir install; done'
maker1: *** [install-recursive] Error 2
maker1: Leaving directory @/c/portaudio'
make: *** [install] Error 2
</pre>

Don't worry about these errors; they do not affect the successful build and installation of portaudio. For more information, see hints tips known problems and solutions for Windows.

h2. 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:
<pre>
export PATH=".:/usr/local/bin:/mingw/bin:/bin:/c/Python24:/c/Python24/DLLs:/c/Python24/libs:/c/swigwin-1.3.35:$PATH"

</pre>
or you can adjust your PATH in @~/.bash_profile@. You should also add a line to @/etc/profile@ or @~/.bash_profile@ to define the path to USRP firmware files, like the following example:
<pre>
export USRP_PATH=/usr/local/share/usrp
</pre>
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@ or @/mingw/bin/swig@:
<pre>
#! /bin/sh
exec /c/swigwin-1.3.35/swig.exe "$@"
</pre>
The script for @python@ (in @/usr/local/bin/python@ or @/mingw/bin/python@) is a little more complicated:
<pre>
#! /bin/sh
if test $# -ne 0; then
exec /c/Python24/python.exe "$@"
else
exec /c/Python24/python.exe -i
fi
</pre>

h2. GNU Radio Software

<pre>
<pre>
tar -zxf gnuradio-3.1.3.tar.gz
cd gnuradio-3.1.3
</pre>
Set the necessary environment variables and run the configuration script:
<pre>
export CPPFLAGS=-I/usr/local/include
export LDFLAGS="-L/usr/local/lib -lws2_32"
./configure --prefix=C:/msys/1.0/local
</pre>
<pre>
<pre>
*********************************************************************
The following GNU Radio components have been successfully configured:

config
omnithread
gnuradio-core
usrp
gr-usrp
gr-audio-portaudio
gr-audio-windows
gr-atsc
gr-gpio
gr-gsm-fr-vocoder
gr-pager
gr-radar-mono
gr-radio-astronomy
gr-trellis
gr-video-sdl
gr-wxgui
gr-sounder
gr-utils
gnuradio-examples

You my now run the make command to build these components.

*********************************************************************
The following components were skipped either because you asked not
to build them or they didn't pass configuration checks:

gr-audio-alsa
gr-audio-jack
gr-audio-oss
gr-audio-osx
gr-comedi

These components will not be built.
</pre>
Next, in the MinGW window, build the GNU Radio software by typing the following command:
<pre>
make
</pre>
Verify everything built properly by typing the following command:
<pre>
make check
</pre>

If you are using bash 2.04, you will need to work around the "@for i in ;@" problem: In gnuradio-3.1.3/usrp/doc/Makefile, comment out the following lines (approx. lines 755-759) as shown:

<pre>
# @for i in $(DOCBOOK_HTML_FILES); do \
# echo "$(INSTALL_DATA) $i $(DESTDIR)$(docdir)/html"; \
# $(INSTALL_DATA) $i $(DESTDIR)$(docdir)/html; \
# done
# cp -r html $(DESTDIR)$(docdir)
</pre>
In gnuradio-3.1.3/gr-trellis/doc/Makefile, comment out the following lines (approx. lines 588-591) as shown:
<pre>
# @for i in $(HTML_FILES); do \
# echo "$(INSTALL_DATA) $i $(DESTDIR)$(docdir)/html"; \
# $(INSTALL_DATA) $i $(DESTDIR)$(docdir)/html; \
# done
</pre>

Install the GNU Radio software by typing the following command:

<pre>
make install
</pre>

h2. USRP Driver Installation

If you have a USRP, you will need to install the driver for it. Refer to "installing the USRP driver for Windows":http://gnuradio.org/trac/wiki/USRPWindowsDriverInstall. However, note that 2 of the 3 files you need are in different locations than shown on "that page":http://gnuradio.org/trac/wiki/USRPWindowsDriverInstall. Use the following commands, instead of the ones shown on "that page":http://gnuradio.org/trac/wiki/USRPWindowsDriverInstall, to put the files in the same place:

<pre>
cd /c/gnuradio-3.1.3/usrp
cp /c/libusb-win32-device-bin-0.1.12.1/bin/libusb0.sys .
cp /c/libusb-win32-device-bin-0.1.12.1/bin/libusb0.dll .
</pre>

Then, follow the remaining instructions on the "USRP driver install page for Windows":http://gnuradio.org/trac/wiki/USRPWindowsDriverInstall.

Your USRP should be ready to go!




makefiles-3.1.2.patch - work around for interlibrary dependences on Windows (1.6 KB) Redmine Admin, 04/09/2008 09:45 PM





注: Installing GNU Radio with MinGW and MSYS (原文出处,翻译整理仅供参考!)