BuildGuide

Josh Blum edited this page Dec 10, 2018 · 16 revisions

Get the dependencies

The main SoapySDR library really only requires CMake and a compiler. Additional components require additional dependencies. If those dependencies are not available, the component does not build.

  • CMake
  • C++ compiler

Optional depedencies

  • Python dev and SWIG for python bindings
  • Numpy recommended for python bindings

Ubuntu

http://i.imgur.com/rzuCBUr.png

Recommended apt-get install instructions for Ubuntu:

sudo apt-get install \
    cmake g++ \
    libpython-dev python-numpy swig

Windows

http://i.imgur.com/YAu30uL.png

Optional dependencies based on your needs:

OSX

http://i.imgur.com/gLxShgE.jpg

Step 1) Install Xcode Command Line Tools: https://railsapps.github.io/xcode-command-line-tools.html

Step 2) Install SoapySDR, various support modules, and dependencies with a few simple commands using the Pothos Homebrew tap or follow the instructions below to build from source.

Get the source code

http://i.imgur.com/YImPftq.png

First time repository clone from git

git clone https://github.com/pothosware/SoapySDR.git
cd SoapySDR

Update from an existing checkout

cd SoapySDR
git pull origin master

Build and install

http://i.imgur.com/n7WReFx.png

Unix instructions

mkdir build
cd build
cmake ..
make -j4
sudo make install
sudo ldconfig #needed on debian systems
SoapySDRUtil --info

If you want to change installation paths to something more specific, the cmake line could look like this:

cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DLIB_INSTALL_DIR:PATH=lib64 -DLIB_SUFFIX=64 -DSOAPY_SDR_ROOT=/usr ..

Rebuild after pulling from git

cd build #use previous build directory, no need to run cmake again

make -j4
sudo make install

#repeat this step for projects that depend on SoapySDR

Windows instructions

https://developer.valvesoftware.com/w/images/6/6a/Visual_studio_logo.png

The first step is to configure the project with CMake. This can be done with the cmake command line utility, however we will discuss configuring using the graphical CMake application. Launch CMake from the start menu, specify the source directory and choose a location for the binaries. Click configure and select the correct version of the visual studio compiler.

http://i.imgur.com/nbIADom.png

The project should complete configuration successfully. However you will notice a lot of verbose concerning other libraries and dependencies. These are optional dependencies based on the user's needs. If you are interested in a particular component, you must tell CMake how to find the libraries and headers for its dependencies. When finished configuring optional components, click generate. Visual studio project files will be generated.

The next step is to build and install the generated project. The project can be built in a variety of ways, using MSBuild and opening the project in the Visual studio environment. In this tutorial, we will invoke cmake within a Visual studio terminal to build and install the project.

http://i.imgur.com/zg6tnVD.png

Find the shortcut to the Visual studio cross tools command prompt and execute the following commands:

cmake --build my_build_dir --config Release
cmake --build my_build_dir --config Release --target install

After installation, complete the setup by adding Soapy SDR to the system path, and invoke the command line utility for a quick sanity check.

  • add C:\Program Files\SoapySDR\bin to the %PATH%
  • open cmd and run SoapySDRUtil.exe --info

Environment variables

The SoapySDR library needs to know its installation path. The library is compiled with the CMAKE_INSTALL_PREFIX as the default search path for modules. However, if the library is installed to a different location other than the one it was configured with, the SOAPY_SDR_ROOT environment variable can be set to reflect the new installation path.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.