Gnuradio 3.8 and gr-limesdr: module 'limesdr' has no attribute 'sink'

Hello, I have gnuradio 3.8, LimeSuite and gr-limesdr cross-compiled on the Zybo Z7-10.
I tried to modify the FM_TRANSMITTER to check if the setup works.

This is the output after the python3 command:

Limesdr-sink

Any ideas?

One thing that got me thinking is that during sudo make install, it could not find the init.pyc and init.pyo from swig and python. Could this be the reason? I modified the cmake_install.cmake from the swig and python folder so it would not look for those files.
I hope someone can help.

– Installing: /usr/lib/python3.7/site-packages/limesdr/limesdr_swig.py
CMake Error at swig/cmake_install.cmake:89 (file):
file INSTALL cannot find
“/home/rodrirq/gr-limesdr/build/swig/limesdr_swig.pyc”.
Call Stack (most recent call first):
cmake_install.cmake:50 (include)

After changing the __init__.py, I got that there is an error importing ligbnuradio-limesdr.so.3.1.5.
Any idea?

If you do a -

nm -A /usr/lib/* | grep LMS_StopStream

you should get a hit in libgnuradio-limesdr and libLimeSuite.

Best Guess - you do not have libLimeSuite installed or it is in the wrong place or it is the wrong version.

1 Like

Thanks for the answer.
I asked about this on the GNU Radio chat and they told me to do the nm command as well.
I don’t have it on PetaLinux, so I am going to search how to do it.
When I manage to do it, I will tell you what I get.

You are looking for libLimeSuite -

sudo find / -name “*libLimeSuite*”

should find it. This screen editor screws thing up. Type it in - do not copy and paste from the screen.

I got this output. Moreover, I can use LimeQuickTest and LimeUtil, so these libraries work.
The one giving problems is lignuradio-limesdr.so.3.1.5.

root@zynq-7010:~# find / -name “libgnuradio-limesdr”
/media/sd-mmcblk0p2/usr/lib/libgnuradio-limesdr.so.3.1.5
/media/sd-mmcblk0p2/usr/lib/libgnuradio-limesdr.so.3.1.5.0
/media/sd-mmcblk0p2/usr/lib/libgnuradio-limesdr.so
/media/sd-mmcblk0p2/home/root/gnuradio/lib/libgnuradio-limesdr.so.3.1.5
/media/sd-mmcblk0p2/home/root/gnuradio/lib/libgnuradio-limesdr.so.3.1.5.0
/media/sd-mmcblk0p2/home/root/gnuradio/lib/libgnuradio-limesdr.so
/usr/lib/libgnuradio-limesdr.so.3.1.5
/usr/lib/libgnuradio-limesdr.so.3.1.5.0
/usr/lib/libgnuradio-limesdr.so
/home/root/gnuradio/lib/libgnuradio-limesdr.so.3.1.5
/home/root/gnuradio/lib/libgnuradio-limesdr.so.3.1.5.0
/home/root/gnuradio/lib/libgnuradio-limesdr.so

root@zynq-7010:~# find / -name “libLimeSuite”
/media/sd-mmcblk0p2/usr/lib/libLimeSuite.so
/media/sd-mmcblk0p2/usr/lib/libLimeSuite.so.20.10-1
/media/sd-mmcblk0p2/usr/lib/libLimeSuite.so.20.10.0
/media/sd-mmcblk0p2/home/root/gnuradio/lib/libLimeSuite.so
/media/sd-mmcblk0p2/home/root/gnuradio/lib/libLimeSuite.so.20.10-1
/media/sd-mmcblk0p2/home/root/gnuradio/lib/libLimeSuite.so.20.10.0
/usr/lib/libLimeSuite.so
/usr/lib/libLimeSuite.so.20.10-1
/usr/lib/libLimeSuite.so.20.10.0
/home/root/gnuradio/lib/libLimeSuite.so
/home/root/gnuradio/lib/libLimeSuite.so.20.10-1
/home/root/gnuradio/lib/libLimeSuite.so.20.10.0

I don’t know what you mean about typing in -. Maybe it is the way to write code?

I had that problem a year ago - python does not know use libLimeSuite - I think that the fix was to add the libLimeSuite path to the PYTHONPATH variable. Anyway, it needs to be added to the python library search list.

Thanks for the answer.

Should I add the path to the directory where the libLimeSuite is located? Or include libLimeSuite on the path? I ​will try both anyways.

I tried adding /usr/lib and /usr/lib/libLimeSuite.so to the PYTHONPATH, but I got the same error.

I managed to add the ldd command, but I couldn’t add the nm. I am still trying.
This is the output from ldd with the .so:

root@zynq-7010:~# ldd /usr/lib/libgnuradio-limesdr.so
ldd: warning: you do not have execution permission for `/usr/lib/libgnuradio-limesdr.so’
libgnuradio-runtime.so.3.8.2 => /usr/lib/libgnuradio-runtime.so.3.8.2 (0xb6ec1000)
libgnuradio-pmt.so.3.8.2 => /usr/lib/libgnuradio-pmt.so.3.8.2 (0xb6e70000)
liblog4cpp.so.5 => /usr/lib/liblog4cpp.so.5 (0xb6e37000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6cf8000)
libm.so.6 => /lib/libm.so.6 (0xb6c91000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6c68000)
libc.so.6 => /lib/libc.so.6 (0xb6b75000)
libvolk.so.2.3 => /usr/lib/libvolk.so.2.3 (0xb6ae9000)
libboost_program_options.so.1.71.0 => /usr/lib/libboost_program_options.so.1.71.0 (0xb6a7d000)
libboost_filesystem.so.1.71.0 => /usr/lib/libboost_filesystem.so.1.71.0 (0xb6a5c000)
libboost_thread.so.1.71.0 => /usr/lib/libboost_thread.so.1.71.0 (0xb6a30000)
librt.so.1 => /lib/librt.so.1 (0xb6a1a000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb69f5000)
libgmp.so.10 => /usr/lib/libgmp.so.10 (0xb699e000)
/lib/ld-linux-armhf.so.3 (0xb6f98000)

root@zynq-7010:~# ldd /usr/lib/libLimeSuite.so
ldd: warning: you do not have execution permission for `/usr/lib/libLimeSuite.so’
libusb-1.0.so.0 => /lib/libusb-1.0.so.0 (0xb6e47000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6d08000)
libm.so.6 => /lib/libm.so.6 (0xb6ca1000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6c78000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb6c53000)
libc.so.6 => /lib/libc.so.6 (0xb6b60000)
/lib/ld-linux-armhf.so.3 (0xb6ef6000)
libudev.so.1 => /lib/libudev.so.1 (0xb6b39000)

Your “ldd /usr/lib/libgnuradio-limesdr.so” should include a pointer to “libLimeSuite”. When I do a ldd on “limesdr.so” on Linux, “libLimeSuite” shows up in the list. Perhaps, you built “libgnuradio-limesdr.so”, before you built “libLimeSuite” - you had the include files around, but not the library and it printed a warning message that you missed. Your could destroy all versions of libgnuradio-limesdr.so and rebuild - maybe that would get libLimeSuite in the list.

I will make a reinstall, but I always build LimeSuite before gr-limesdr.
In fact, to build gr-limesdr I have to specify the path to LimeSuite.
But you are right, on Linux I get the path to libLimeSuite as well.
Thanks!

I reinstalled all. During the gr-limesdr build, it detected LimeSuite.
Still, the command ldd doesn’t have a pointer to libLimeSuite.so.
I don’t know why.

I tried this:

root@zynq-7010:~# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/libLimeSuite.so
root@zynq-7010:~# ldconfig
ldconfig: /usr/lib/libgnuradio-limesdr.so.3.1.5 is not a symbolic link

ldconfig: /usr/lib/libLimeSuite.so.20.10-1 is not a symbolic link

Here is an example of something that should work -

You need to find where “libgnuradio-limesdr.so” is created and add -llibLimeSuite to the “gcc -shared …” statement that builds it.

1 Like

Hello, I have found link.txt that contains this:

/opt/pkg/sdk/sysroots/x86_64-petalinux-linux/usr/bin/arm-xilinx-linux-gnueabi/arm-xilinx-linux-gnueabi-g++ -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi --sysroot=/opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi -fPIC -O2 -pipe -g -feliminate-unused-debug-types -O3 -DNDEBUG -Wl,-O1 -Wl,–hash-style=gnu -Wl,–as-needed -shared -Wl,-soname,libgnuradio-limesdr.so.3.1.5 -o libgnuradio-limesdr.so.3.1.5.0 CMakeFiles/gnuradio-limesdr.dir/device_handler.cc.o CMakeFiles/gnuradio-limesdr.dir/source_impl.cc.o CMakeFiles/gnuradio-limesdr.dir/sink_impl.cc.o /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libgnuradio-runtime.so.3.8.2.0 /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libgnuradio-pmt.so.3.8.2.0 /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libvolk.so.2.3 -ldl -lm /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libboost_program_options.so.1.71.0 /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libboost_filesystem.so.1.71.0 /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libboost_system.so.1.71.0 /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libboost_regex.so.1.71.0 /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libboost_thread.so.1.71.0 -lpthread /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/liblog4cpp.so /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libgmpxx.so /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libgmp.so -lrt

Maybe I should add the path to libLimeSuite.so here?

Okey @RightHalfPlane

I got it done.

I added /usr/lib/libLimeSuite.so to ~/gr-limesdr/build/lib/CMakeFiles/gnuradio-limesdr.dir/link.txt before doing $ make

With this, after installing, I used ldd command on PetaLinux and lignuradio-limesdr.so has a pointer to libLimeSuite.so.

Now I have to create a program to see if I can transmit.

Thank you so much for your help, I really appreciate it.

That is Great - You are likely the only person to get it all working on PetaLinux. It would be nice if you could document it some place - so that the next person does not have to work it all out again.

1 Like

I still need to test the setup and keep working on this.
Until I am finished I won’t be able to publish anything.
Anyways, I am open to help people with the same objective I have.
Where should I post the document after I am finished?

You could create a GitHub repository call something like -

“PetaLinux-using-gnuradio-and-gr-limesdr”

and put copies of the files and information on how the do it there.

Create a YouTube video “How to install gr-limesdr on PetaLiunx” that tells how to do it an points to the GitHub site and then on the PetaLiunx sites post notifications that point to the GitHub site and video. I have done things like that -

How to Install RtAudio on Windows 10

and I have found it to be very useful to me. I had to look at the video to recall the details when I needed to do a new install.

Okay, thanks for the info.

After I’m done with the project I will think of the way to publish it.