Skip to content

Build Linux

Dantali0n edited this page Jan 31, 2019 · 41 revisions

Building CubicSDR for Linux:


Basic build support: (debian)

$ sudo apt-get install git build-essential automake cmake

Base Dependencies: (debian)

$ sudo apt-get install libpulse-dev libgtk-3-dev

OpenGL Dependencies (debian):

$ sudo apt-get install freeglut3 freeglut3-dev

Build and install SoapySDR

$ git clone https://github.com/pothosware/SoapySDR.git
$ cd SoapySDR
SoapySDR$ mkdir build
build$ cd build
build$ cmake ../ -DCMAKE_BUILD_TYPE=Release
build$ make -j4
build$ sudo make install
build$ sudo ldconfig
build$ SoapySDRUtil --info #test SoapySDR install

Build and install liquid-dsp

$ git clone https://github.com/jgaeddert/liquid-dsp
liquid-dsp$ cd liquid-dsp
liquid-dsp$ ./bootstrap.sh
liquid-dsp$ CFLAGS="-march=native -O3" ./configure --enable-fftoverride 
liquid-dsp$ make -j4
liquid-dsp$ sudo make install
liquid-dsp$ sudo ldconfig

Build static wxWidgets:

Note: replace '~/Develop/wxWidgets-staticlib' with your own path if you prefer, remember it to be used later when building CubicSDR.

$ wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxWidgets-3.1.2.tar.bz2
[ downloading.. ]
$ tar -xvjf wxWidgets-3.1.2.tar.bz2  
[ unpacking.. ]
$ cd wxWidgets-3.1.2/
wxWidgets-3.1.2$ mkdir -p ~/Develop/wxWidgets-staticlib
wxWidgets-3.1.2$ ./autogen.sh 
wxWidgets-3.1.2$ ./configure --with-opengl --disable-shared --enable-monolithic --with-libjpeg --with-libtiff --with-libpng --with-zlib --disable-sdltest --enable-unicode --enable-display --enable-propgrid --disable-webkit --disable-webview --disable-webviewwebkit --prefix=`echo ~/Develop/wxWidgets-staticlib` CXXFLAGS="-std=c++0x"

[ configuring.. ]

wxWidgets-3.1.2$ make -j4 && make install

[ building and installed to ~/Develop/wxWidgets-staticlib in this example ]

Build CubicSDR

Note: add -DUSE_HAMLIB=1 to cmake command line to include hamlib support.

$ git clone https://github.com/cjcliffe/CubicSDR.git
CubicSDR$ cd CubicSDR
CubicSDR$ mkdir build
CubicSDR$ cd build
build$ cmake ../ -DCMAKE_BUILD_TYPE=Release -DwxWidgets_CONFIG_EXECUTABLE=~/Develop/wxWidgets-staticlib/bin/wx-config
build$ make
# You can now run the build from the folder, note if you're on 32-bit linux it will be in x86/
build$ cd x64/
x64$ ./CubicSDR

Install CubicSDR (and launcher)

build$ sudo make install

Un-install CubicSDR

build$ sudo make uninstall

Support Modules


SoapyRTLSDR (similar to other Soapy modules):

$ sudo apt-get install librtlsdr-dev
$ git clone https://github.com/pothosware/SoapyRTLSDR.git
$ cd SoapyRTLSDR
SoapyRTLSDR$ mkdir build
SoapyRTLSDR$ cd build
build$ cmake .. -DCMAKE_BUILD_TYPE=Release
build$ make
build$ sudo make install
build$ sudo ldconfig
# should now show RTL-SDR device if connected
build$ SoapySDRUtil --info     

SoapySDRPlay (similar to other Soapy modules):

** Note: requires API from http://www.sdrplay.com/linuxdl.php to be installed first.
** Also note that the SoapySDRPlay installer will at present time install an earlier SoapySDR binary -- please re-run 'sudo make install' for your SoapySDR build folder to update to the build version after installing.

$ git clone https://github.com/pothosware/SoapySDRPlay.git
$ cd SoapySDRPlay
SoapySDRPlay$ mkdir build
SoapySDRPlay$ cd build
build$ cmake .. -DCMAKE_BUILD_TYPE=Release
build$ make
build$ sudo make install
build$ sudo ldconfig
build$ SoapySDRUtil --info

SoapyLMS7 (similar to other Soapy modules):

$ git clone https://github.com/myriadrf/LimeSuite.git
$ cd LimeSuite
LimeSuite$ sudo cp udev-rules/64-limesuite.rules /etc/udev/rules.d/
LimeSuite$ mkdir builddir #build directory already exists
LimeSuite$ cd builddir 
builddir$ cmake .. -DENABLE_EXAMPLES=off -DENABLE_GUI=off -DCMAKE_BUILD_TYPE=Release
builddir$ make 
builddir$ RESULT=`SoapySDRUtil --sparse --info | grep "Search path:"`; MODULEPATH=${RESULT:12}; sudo cp SoapyLMS7/libLMS7Support.so $MODULEPATH
builddir$ 
builddir$ sudo ldconfig
builddir$ SoapySDRUtil --info
  • Always ensure to update, build and install SoapySDR before building dependent projects.

Ubuntu 15.10 Note:

If you've installed a graphics driver that includes OpenGL and your libGL.so currently points to an invalid mesa/libGL.so you may get a compiler error:

make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libGL.so', needed by 'x64/CubicSDR'.  Stop.

Checking the link should reveal that it's pointing at a deleted file:

$ ls -lah /usr/lib/x86_64-linux-gnu/libGL.so
lrwxrwxrwx 1 root root 13 Oct  9 01:16 /usr/lib/x86_64-linux-gnu/libGL.so -> mesa/libGL.so

To fix the link first remove the old one:

$ sudo rm /usr/lib/x86_64-linux-gnu/libGL.so

Then check where libGL.so.1 is pointing:

$ ls -lah /usr/lib/x86_64-linux-gnu/libGL.so.1
lrwxrwxrwx 1 root root 15 Dec 20 19:03 /usr/lib/x86_64-linux-gnu/libGL.so.1 -> libGL.so.358.16

And create a new link to the same location:

$ sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.358.16 /usr/lib/x86_64-linux-gnu/libGL.so
You can’t perform that action at this time.