USRP Hardware Driver and USRP Manual  Version: 003.008.001-0-g2474ac32
UHD and USRP Manual
Building and Installing UHD

Note: More build information can be found on the UHD wiki page, at http://code.ettus.com/redmine/ettus/projects/uhd/wiki .

Build Dependencies

Linux Notes: This is dependent on the distribution you are using, but most, if not all, of the dependencies should be available in the package repositories for your package manager.

Mac OS X Notes: Install the Xcode app to get the build tools (GCC and Make). Use MacPorts to get the Boost and Cheetah dependencies. Other dependencies can be downloaded as DMG installers from the web or installed via MacPorts. See the UHD OS X page for more information: http://code.ettus.com/redmine/ettus/projects/uhd/wiki/UHD_OS_X

Windows Notes: The dependencies can be acquired through installable EXE files. Usually, the Windows installer can be found on the project's website. Some projects do not host Windows installers, and if this is the case, follow the auxiliary download URL for the Windows installer (below).

Git

Required to check out the repository. On Windows, install Cygwin with Git support to checkout the repository or install msysGit from http://code.google.com/p/msysgit/downloads/list.

C++ Compiler

The following compilers are known to work:

  • GCC
  • Clang
  • MSVC

CMake

Boost

LibUSB

Python

  • Purpose: used by Cheetah and utility scripts
  • Minimum Version: 2.6
  • Usage: build time + runtime utility scripts (required)
  • Download URL: http://www.python.org/download/

Cheetah

Doxygen

Build Instructions (Unix)

Generate Makefiles with CMake

cd <uhd-repo-path>/host
mkdir build
cd build
cmake ../

Additionally, configuration variables can be passed into CMake via the command line. The following common-use configuration variables are listed below:

  • For a custom install prefix: -DCMAKE_INSTALL_PREFIX=<install-path>
  • To install libs into lib64: cmake -DLIB_SUFFIX=64

Example usage:

cmake -DCMAKE_INSTALL_PREFIX=/opt/uhd ../

Build and install

make
make test
sudo make install

Setup the library path (Linux)

Make sure that libuhd.so is in your LD_LIBRARY_PATH, or add it to /etc/ld.so.conf and make sure to run:

sudo ldconfig

Build Instructions (Windows)

Generate the project with CMake

  • Open the CMake GUI.
  • Set the path to the source code: <uhd-repo-path>/host.
  • Set the path to the build directory: <uhd-repo-path>/host/build.
  • Make sure that the paths do not contain spaces.
  • Click "Configure" and select "Microsoft Visual Studio 10".
  • Set the build variables and click "Configure" again.
  • Click "Generate", and a project file will be created in the build directory.

LibUSB notes

On Windows, CMake does not have the advantage of pkg-config, so we must manually tell CMake how to locate the LibUSB header and lib.

  • From the CMake GUI, select "Advanced View".
  • Set LIBUSB_INCLUDE_DIRS to the directory with libusb.h.
  • Set LIBUSB_LIBRARIES to the full path for libusb-1.0.lib.
  • Recommend the static libusb-1.0.lib to simplify runtime dependencies.
  • Check the box to enable USB support, click "Configure" and "Generate".

Note: On Windows, LibUSBx is required to use most USB3 controllers.

Build the project in MSVC

  • Open the generated project file in MSVC.
  • Change the build type from "Debug" to "Release".
  • Select the "Build All" target, right-click, and choose "Build".
  • Select the install target, right-click, and choose "Build".

Note: You may not have permission to build the install target. You need to be an administrator or to run MSVC as administrator.

Build the project in MSVC (command line)

Open the Visual Studio Command Prompt Shorcut:

cd <uhd-repo-path>\host\build
DevEnv uhd.sln /build Release /project ALL_BUILD
DevEnv uhd.sln /build Release /project INSTALL

Setup the PATH environment variable

Add the UHD bin path to PATH% (usually C:\\Program Files\\UHD\\bin)

Note: The default interface for editing environment variable paths in Windows is very poor. We recommend using "Rapid Environment Editor" (http://www.rapidee.com) over the default editor.

Post-Install Tasks

For USB-based devices, see the USB Transport Application Notes <./transport.html::usb-transport-libusb>_ for platform-specific post-installation tasks.

Post-Install Tasks (Mac OS X)

Make sure that the value of CMAKE_INSTALL_PREFIX is at or near the front of the shell PATH environment variable. Do NOT set DYLD_LIBRARY_PATH or any related DYLD environment variable permanently; these work differently than under Linux and should be used for testing / temporary purposes only.