Building LimeSuite and SoapySDR from source

I’m trying to build LimeSuite and SoapySDR from source (on Gentoo) and would like to do a local installation without changing any system wide libraries.

Here’s what I’ve done. First building SoapySDR:

~/projects/sdr/SoapySDR.git $ git rev-parse --short HEAD
74f890c
~/projects/sdr/SoapySDR.git $ mkdir build;cd build
~/projects/sdr/SoapySDR.git/build $ cmake ../

...

~/projects/sdr/SoapySDR.git/build $ find .. -name SoapySDRConfig.cmake
../cmake/SoapySDRConfig.cmake

Then I try to build LimeSuite:

~/projects/sdr/limesdr/LimeSuite.git $ rm -fr build
~/projects/sdr/limesdr/LimeSuite.git $ git rev-parse --short HEAD
f53a592
~/projects/sdr/limesdr/LimeSuite.git $ mkdir build;cd build
~/projects/sdr/limesdr/LimeSuite.git/build $ cmake ../
-- The C compiler identification is GNU 4.9.4
...
-- GNUPlot Found
CMake Warning at SoapyLMS7/CMakeLists.txt:5 (find_package):
  Could not find a package configuration file provided by "SoapySDR" with any
  of the following names:

    SoapySDRConfig.cmake
    soapysdr-config.cmake

  Add the installation prefix of "SoapySDR" to CMAKE_PREFIX_PATH or set
  "SoapySDR_DIR" to a directory containing one of the above files.  If
  "SoapySDR" provides a separate development package or SDK, be sure it has
  been installed.
...

Then I try again and specify the location of the above cmake file as indicated:

~/projects/sdr/limesdr/LimeSuite.git/build $ cd ..
~/projects/sdr/limesdr/LimeSuite.git $ rm -fr build; mkdir build; cd build
~/projects/sdr/limesdr/LimeSuite.git/build $ SoapySDR_DIR=~/projects/sdr/SoapySDR.git/cmake cmake ../
-- The C compiler identification is GNU 4.9.4
..
-- GNUPlot Found
CMake Error at /home/zener/projects/sdr/SoapySDR.git/cmake/SoapySDRConfig.cmake:161 (message):
  cannot find SoapySDR library in /home/zener/projects/lib
Call Stack (most recent call first):
  SoapyLMS7/CMakeLists.txt:5 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/zener/projects/sdr/limesdr/LimeSuite.git/build/CMakeFiles/CMakeOutput.log".
See also "/home/zener/projects/sdr/limesdr/LimeSuite.git/build/CMakeFiles/CMakeError.log".
~/projects/sdr/limesdr/LimeSuite.git/build $

CMakeError.log has an error:

/home/zener/projects/sdr/limesdr/LimeSuite.git/build/CMakeFiles/CMakeTmp/src.c:2:27: error: array type has incomplete element type
 int main(){struct i2c_msg messages[2]; return 0;}

Unfortunately, the src.c is removed after cmake has completed.

Any ideas on how to proceed?

Try this incantation. I think it’ll work.

i.e.
export SoapySDR_DIR=/home/zener/projects/sdr/SoapySDR.git/cmake

Thanks, but that’s exactly what I did in my second attempt above, i.e. setting the SoapySDR_DIR variable on the command line and running cmake. The shell would expand the tilde.

I also tried to export the variable by itself using the full path like in your example, but as expected the result is the same.

Do you have i2c-dev installed?

Thank you. I’m on Gentoo so there is no “i2c-dev” package. But I’ve managed to build it on a different computer (also Gentoo) with a bit more recent kernel where I have enabled more I2C drivers in the kernel. This is the specs:

~/projects/sdr/LimeSuite.git/build $ uname -r
4.4.26-gentoo

~/projects/sdr/LimeSuite.git/build $ gzip -dc /proc/config.gz |grep -i i2c|grep -v ^\#
CONFIG_REGMAP_I2C=y
CONFIG_I2C=y
CONFIG_ACPI_I2C_OPREGION=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
CONFIG_I2C_MUX=y
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_ALGOBIT=y
CONFIG_I2C_I801=y
CONFIG_VIDEO_IR_I2C=y

However, now I’m faced with a different error which seem to tell me that I’ll have to to actually install SoapySDR

~/projects/sdr/LimeSuite.git/build $ SoapySDR_DIR=$HOME/projects/sdr/SoapySDR.git/cmake cmake ../

...
-- GNUPlot Found
CMake Error at /home/zener/projects/sdr/SoapySDR.git/cmake/SoapySDRConfig.cmake:161 (message):
  cannot find SoapySDR library in /home/zener/projects/lib

Does this mean I have to install SoapySDR, i.e. that LimeSuite will not be able to find its files where it was built?

But even if I re-run cmake with -DCMAKE_INSTALL_PREFIX, re-build and make install it I get the same error message. I never specified the ~/projects/lib directory anywhere.

SoapySDR is a dependency and you would need to install it. Can you try with -DSoapySDR_DIR=/path/to/soapysdr .

Thanks. Using the option to cmake rather than the environment variable seem to resolve the issue

With the latest source 225afe4 (and SoapySDR c772ee1) LimeUtil (and SoapySDRUtil) seem to work fine:

LD_LIBRARY_PATH=~/root/lib ~/root/bin/LimeUtil --info
######################################################
## LimeSuite information summary
######################################################

Version information:
  Library version:	v17.07.0-g225afe41
  Build timestamp:	2017-08-05
  Interface version:	v2017.6.0
  Binary interface:	17.07-1

System resources:
  Installation root:	//home/zener/root
  User home directory:	/home/zener
  App data directory:	/home/zener/.local/share/LimeSuite
  Config directory:	/home/zener/.limesuite
  Image search paths:
     - /home/zener/.local/share/LimeSuite/images
     - //home/zener/root/share/LimeSuite/images

Supported connections:
   * PCIEXillybus
   * STREAM
   * uLimeSDR

But LimeSuiteGUI will crash right away:

zener@zappa ~ $ LD_LIBRARY_PATH=~/root/lib ~/root/bin/LimeSuiteGUI 
*** Error in `/home/zener/root/bin/LimeSuiteGUI': munmap_chunk(): invalid pointer: 0x0000000001d938e0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x6fbfb)[0x7f8abef12bfb]
/lib64/libc.so.6(+0x75486)[0x7f8abef18486]
/home/zener/root/bin/LimeSuiteGUI[0x41bf06]
/home/zener/root/bin/LimeSuiteGUI(__libc_csu_init+0x4d)[0x5f5e3d]
/lib64/libc.so.6(__libc_start_main+0x7f)[0x7f8abeec35ff]
/home/zener/root/bin/LimeSuiteGUI(_start+0x29)[0x41d449]

Anybody else experienced this?

I updated all my git sources to:

LimeSuite.git: a15f8c3
SoapySDR.git: 285e72a

And re-built and now the GUI is running too.