# Cross-compiled gr-limesdr

**URL:** <https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128>\
**Category:** LimeSDR\
**Created:** [14 May 2021 07:58 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128 "2021-05-14T07:58:01Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![RightHalfPlane](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@RightHalfPlane](https://discourse.myriadrf.org/u/RightHalfPlane)\
**Post date:** [31 May 2021 14:51 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/24 "2021-05-31T14:51:02Z")

</div>

There are hundreds of ways to encode data for transmission. The LiquidSDR file “flexframesync\_example.c” is an example of using an error correction method. It packs the data - which you grab and transmit. On the receiving end, you capture and pass the data thru the unpack routine to get the original data back.

---

<div class="post-metadata">

**Author:** ![rodrirq](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@rodrirq](https://discourse.myriadrf.org/u/rodrirq)\
**Post date:** [31 May 2021 15:05 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/25 "2021-05-31T15:05:46Z")

</div>

Okay, I will investigate about this. That file from LiquidSDR needs the basicTX.cpp from the LimeSuite? Or is it another way to do the same thing?

Thanks again!

---

<div class="post-metadata">

**Author:** ![RightHalfPlane](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@RightHalfPlane](https://discourse.myriadrf.org/u/RightHalfPlane)\
**Post date:** [1 June 2021 04:35 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/26 "2021-06-01T04:35:47Z")

</div>

You would need to put the encode section from in flexframesync\_example.c to some thing like basicTX.cpp and the decode section from flexframesync\_example.c into something like basicRX.cpp. This method is simple, but likely to be slow. LiquidSDR has many other encoding methods you could use - once you get things going and what some speed. I use the soapySDR routines, because they work with many SDRs including the lime devices. Here is a C-example

> **[pothosware/SoapySDR](https://github.com/pothosware/SoapySDR/wiki/C_API_Example)**
>
> Vendor and platform neutral SDR support library. Contribute to pothosware/SoapySDR development by creating an account on GitHub.

of a receiver using soapy. The names are different, but it does the same thing as basicRX.cpp.

---

<div class="post-metadata">

**Author:** ![rodrirq](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@rodrirq](https://discourse.myriadrf.org/u/rodrirq)\
**Post date:** [1 June 2021 08:26 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/27 "2021-06-01T08:26:36Z")

</div>

Thank you so much! I will keep trying with GNU Radio because I am quite close from the objective. It seems I cannot install python3 on PetaLinux 2020.2, so because of that gr-limesdr is giving problems during the make process, and I am looking for the reason. Still, I will study this possibility as well and put them both to work, then I will have to decide which one is better for the project.

---

<div class="post-metadata">

**Author:** ![RightHalfPlane](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@RightHalfPlane](https://discourse.myriadrf.org/u/RightHalfPlane)\
**Post date:** [1 June 2021 13:35 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/28 "2021-06-01T13:35:17Z")

</div>

I assume that you have tried the obvious -

sudo apt-get install python3

What does it do ?

---

<div class="post-metadata">

**Author:** ![rodrirq](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@rodrirq](https://discourse.myriadrf.org/u/rodrirq)\
**Post date:** [1 June 2021 13:48 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/29 "2021-06-01T13:48:19Z")

</div>

Hello, I need python3 on PetaLinux, not on Linux. So if I want to add python3 I do it with petalinux-config -c rootfs, then I add all the components from python3. The thing is that when I try to run python3, I get this:

 ![image](https://canada1.discourse-cdn.com/flex034/uploads/myriadrf/original/2X/9/9c775016b97c472d0e2bce7e24837e96dfbc6002.png)

It makes me think that it is installed, but I can’t execute any of those. I don’t know why.

---

<div class="post-metadata">

**Author:** ![RightHalfPlane](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@RightHalfPlane](https://discourse.myriadrf.org/u/RightHalfPlane)\
**Post date:** [1 June 2021 14:20 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/30 "2021-06-01T14:20:16Z")

</div>

That is really strange. If I were in your position, I would do -

sudo apt-get remove gnuradio  
sudo apt-get update  
sudo apt-get upgrade  
sudo apt-get install gnuradio

then reboot and see if gnuradio-companion works. That process often clears strange problems.

---

<div class="post-metadata">

**Author:** ![rodrirq](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@rodrirq](https://discourse.myriadrf.org/u/rodrirq)\
**Post date:** [1 June 2021 14:29 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/31 "2021-06-01T14:29:13Z")

</div>

I think we are misunderstanding each other.

You talk about gnuradio on Linux, right? Because I don’t install gnuradio like that on PetaLinux, and I don’t even have the apt-get command.

The screenshoot is on PetaLinux. If I do python3 on Linux it works.

My problem is that GNU Radio 3.8 works with python3, which I have on Linux but doesn’t work on my PetaLinux 2020.2. I have already managed to install GNU Radio 3.8, LimeSuite and gr-limesdr on my Linux machine. I have installed gnuradio 3.8 and LimeSuite on PetaLinux 2020.2, but I get an error cross-compiling gr-limesdr for the gr-3.8 branch.

In fact it was you who answered me with this:  
“I says that you do not have “python3” installed at /opt/pkg/test/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3 which is a strange place to look for it - unless you are using a virtualenv - perhaps you build a virtualenv using python2 not python3 and it needs python3.”

So I tried adding python3 but I can’t get it to work.

I hope I have explained myself better.

---

<div class="post-metadata">

**Author:** ![RightHalfPlane](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@RightHalfPlane](https://discourse.myriadrf.org/u/RightHalfPlane)\
**Post date:** [1 June 2021 14:59 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/32 "2021-06-01T14:59:41Z")

</div>

You system cannot correctly do something simple - it is time to refresh the system. I gave the instructions for how to do that on a “apt-get” based system - I did not know PetaLinux was using something different.

---

<div class="post-metadata">

**Author:** ![rodrirq](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@rodrirq](https://discourse.myriadrf.org/u/rodrirq)\
**Post date:** [2 June 2021 07:51 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/33 "2021-06-02T07:51:04Z")

</div>

I get your point, but with PetaLinux there is no apt-get, and I haven’t found anything similar.  
Anyways, I don’t know if it is a problem of the system, or just that I have not included the required packages, which I doubt.  
I asked about this on the Xilinx forum, but I haven’t received a helpful answer.

---

<div class="post-metadata">

**Author:** ![rodrirq](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@rodrirq](https://discourse.myriadrf.org/u/rodrirq)\
**Post date:** [2 June 2021 08:53 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/34 "2021-06-02T08:53:16Z")

</div>

I am studying the possibility of using liquid-dsp.  
Do I have to cross-compile it for ARM or I just need to cross-compile the .c that I create?  
I think it must be the first option, because if not the .h will not be found.  
I cross-compiled LimeSuite to work with BasicTX.cpp so I think it is the same, but as it is not a cmake project, I don’t know where to add the cross-compiler.

---

<div class="post-metadata">

**Author:** ![RightHalfPlane](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@RightHalfPlane](https://discourse.myriadrf.org/u/RightHalfPlane)\
**Post date:** [2 June 2021 13:12 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/35 "2021-06-02T13:12:01Z")

</div>

If you are installing Liquid from scratch - here is the normal process -

if you system does not already have autoconf and automake installed - install them. You should be able to check with a “which autoconf” and “which automake” to see if you have them.

1). install autoconf-2.69 -

cd autoconf-2.69  
configure --prefix=/usr/local  
make  
sudo make install

2). install automake-1.15

cd automake-1.15  
configure --prefix=/usr/local  
make  
sudo make install

Once you have autoconf and automake installed -

1. install liquid sdr -

cd liquid-dsp-1.3.0  
./bootstrap.sh  
configure --prefix=/usr/local  
make -j 8  
sudo make install

By the way - I have tried to install gnuradio from scratch 5 or 6 times and I have only got it to work once - something always gets in the way. What does a “which python3” give you ?

---

<div class="post-metadata">

**Author:** ![rodrirq](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@rodrirq](https://discourse.myriadrf.org/u/rodrirq)\
**Post date:** [3 June 2021 12:45 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/36 "2021-06-03T12:45:10Z")

</div>

Hello

I have installed Liquid on my computer first. Right now I’m just studying how to work with it, and understanding the examples, which I have never worked with.

Thanks for the install instructions, I will use them as well.

About “which python3”, I get:  
/usr/bin/python3

---

<div class="post-metadata">

**Author:** ![rodrirq](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@rodrirq](https://discourse.myriadrf.org/u/rodrirq)\
**Post date:** [18 June 2021 10:47 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/37 "2021-06-18T10:47:30Z")

</div>

Hello, has gr-limesdr gr-3.8 changed?  
I checked the github and it is still the same, but I get an error during cmake:

– Checking for module SWIG  
– Disabling SWIG because version check failed.

But I am using PetaLinux SDK 2020.2 and if I do:

rodrirq@rodrirq-ubuntu:/opt/pkg/zynq-7010$ grep swig images/linux/rootfs.manifest  
swig cortexa9t2hf\_neon 3.0.12  
swig-dev cortexa9t2hf\_neon 3.0.12  
swig-lic cortexa9t2hf\_neon 3.0.12

So I don’t know if the version has changed or what.  
Hope someone knows.

---

<div class="post-metadata">

**Author:** ![RightHalfPlane](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@RightHalfPlane](https://discourse.myriadrf.org/u/RightHalfPlane)\
**Post date:** [18 June 2021 14:41 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/38 "2021-06-18T14:41:19Z")

</div>

swig is required for all gr- programs. What does a "find / -name “\*swig\*” find - it is usually “/usr/bin/swig”

---

<div class="post-metadata">

**Author:** ![rodrirq](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@rodrirq](https://discourse.myriadrf.org/u/rodrirq)\
**Post date:** [19 June 2021 08:16 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/39 "2021-06-19T08:16:37Z")

</div>

Hello, the thing is that I am cross-compiling, but within the PetaLinux SDK I have nativesdk-swig 3.0.12 or something like this, I don’t remember. But it is the same swig I was using, so I am quite confused about why it doesn’t get detected.

---

<div class="post-metadata">

**Author:** ![rodrirq](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@rodrirq](https://discourse.myriadrf.org/u/rodrirq)\
**Post date:** [21 June 2021 10:30 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/40 "2021-06-21T10:30:11Z")

</div>

I managed to add swig, I added nativesdk-swig to /project-spec/meta-user/recipes-core/images/petalinux-image-minimal.bbappend. File which I had to create. The problem I had was that I used the wrong name.

The thing is that after adding swig, I get the error that I got weeks ago.  
This is the output from cmake:

– Toolchain file defaulted to ‘/opt/pkg/sdk/sysroots/x86\_64-petalinux-linux/usr/share/cmake/OEToolchainConfig.cmake’  
– The CXX compiler identification is GNU 9.2.0  
– The C compiler identification is GNU 9.2.0  
– Check for working CXX compiler: /opt/pkg/sdk/sysroots/x86\_64-petalinux-linux/usr/bin/arm-xilinx-linux-gnueabi/arm-xilinx-linux-gnueabi-g++  
– Check for working CXX compiler: /opt/pkg/sdk/sysroots/x86\_64-petalinux-linux/usr/bin/arm-xilinx-linux-gnueabi/arm-xilinx-linux-gnueabi-g++ – works  
– Detecting CXX compiler ABI info  
– Detecting CXX compiler ABI info - done  
– Detecting CXX compile features  
– Detecting CXX compile features - done  
– Check for working C compiler: /opt/pkg/sdk/sysroots/x86\_64-petalinux-linux/usr/bin/arm-xilinx-linux-gnueabi/arm-xilinx-linux-gnueabi-gcc  
– Check for working C compiler: /opt/pkg/sdk/sysroots/x86\_64-petalinux-linux/usr/bin/arm-xilinx-linux-gnueabi/arm-xilinx-linux-gnueabi-gcc – works  
– Detecting C compiler ABI info  
– Detecting C compiler ABI info - done  
– Detecting C compile features  
– Detecting C compile features - done  
– Build type not specified: defaulting to release.  
– Found LOG4CPP: /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/liblog4cpp.so  
– Found PkgConfig: /opt/pkg/sdk/sysroots/x86\_64-petalinux-linux/usr/bin/pkg-config (found version “0.29.2”)  
– Checking for module ‘gmp’  
– No package ‘gmp’ found  
– Found GMP: /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libgmpxx.so  
– Checking for module ‘mpir \>= 3.0’  
– No package ‘mpir’ found  
– Could NOT find MPIR (missing: MPIRXX\_LIBRARY MPIR\_LIBRARY MPIR\_INCLUDE\_DIR)  
– Found MPLIB: /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libgmpxx.so  
– Found Boost: /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version “1.71.0”, minimum required is “1.71.0”) found components: date\_time program\_options filesystem system regex thread  
– Found VOLK: Volk::volk  
– User set python executable /opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3  
– Found PythonInterp: /opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3  
– Could NOT find PythonLibs (missing: PYTHON\_LIBRARIES PYTHON\_INCLUDE\_DIRS) (Required is exact version “.”)  
– Found Git: /usr/bin/git  
– Extracting version information from git describe…  
– LimeSuite version 20.10.0-g1480bfea found.  
– Found Doxygen: /usr/bin/doxygen (found version “1.8.13”) found components: doxygen missing components: dot  
– Using install prefix: /usr/local  
– Building for version: 3.1.5.0 / 3.1.5  
– No C++ unit tests… skipping

– Checking for module SWIG  
– Found SWIG version 3.0.12.  
– Found SWIG: /usr/bin/swig3.0  
– Found PythonLibs: /opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/libpython3.7m.so (found version “3.7.6”)  
– Configuring done  
– Generating done  
– Build files have been written to: /home/rodrirq/gr-limesdr/build

And this is the error:

/bin/sh: /opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3: No such file or directory  
swig/CMakeFiles/limesdr\_swig\_swig\_doc.dir/build.make:60: recipe for target ‘swig/limesdr\_swig\_doc.i’ failed  
make[2]: \*\*\* [swig/limesdr\_swig\_doc.i] Error 127  
CMakeFiles/Makefile2:287: recipe for target ‘swig/CMakeFiles/limesdr\_swig\_swig\_doc.dir/all’ failed  
make[1]: \*\*\* [swig/CMakeFiles/limesdr\_swig\_swig\_doc.dir/all] Error 2  
make[1]: \*\*\* Waiting for unfinished jobs…

I have python3 correctly installed on PetaLinux. I don’t know why swig gives that error.

---

<div class="post-metadata">

**Author:** ![RightHalfPlane](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@RightHalfPlane](https://discourse.myriadrf.org/u/RightHalfPlane)\
**Post date:** [21 June 2021 14:27 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/41 "2021-06-21T14:27:56Z")

</div>

python is a real mess - I have 8 versions on my machine in 4 different locations. You apparently have at least two version “/usr/bin/python3” and “/opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/python3” and it wants a third version in “/opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/bin/python3-native/”.

If you install python3 there you will get by this error, but it may be just a step to the next error.

You have multiple copies of the same programs and libraries in several locations -

/usr/

/opt/pkg/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/

/opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/

and cmake is picking those to use from all three location and some mixtures will not work.

If you are interested in using gnuradio-companion, try to install everything in its tree and make sure that your “PATH” is set correctly.

If gnuradio-companion is at “/opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr/bin/gnuradio-companion” your cmake command for gr-limesdr should be

cmake -DCMAKE\_INSTALL\_PREFIX=/opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/recipe-sysroot-native/usr …/

along with what ever other options are used.

---

<div class="post-metadata">

**Author:** ![rodrirq](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@rodrirq](https://discourse.myriadrf.org/u/rodrirq)\
**Post date:** [22 June 2021 07:57 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/42 "2021-06-22T07:57:02Z")

</div>

Okay, I get what you are saying.  
I installed python3 for ubuntu on /usr/bin/python3.  
Then, I installed gnuradio via meta-sdr, which includes python3 too.  
And last, I installed python3 via petalinux-config -c rootfs.  
About what you say of installing gr-limesdr where gnuradio-companion is… I have/opt/pkg/zynq-7010/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/gnuradio/3.8.2.0-r0/, but the folder recipes-sysroot-native does not exist. I have deploy-rpms, sstate-install-package\_write\_rpm and temp.  
I have used whereis gnuradio-companion, but I only get the one I installed for Ubuntu, not the one from PetaLinux. Still when I boot PetaLinux it appears, so I don’t know where it is located.

---

<div class="post-metadata">

**Author:** ![RightHalfPlane](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@RightHalfPlane](https://discourse.myriadrf.org/u/RightHalfPlane)\
**Post date:** [22 June 2021 12:51 UTC](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128/43 "2021-06-22T12:51:07Z")

</div>

If -

sudo find / -name gnuradio-companion

does not find it - you do not have a second copy.

Try it before and after you boot PetaLinux.

Please list the output that you get.

[Previous page](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128.md?page=1)

[Next page](https://discourse.myriadrf.org/t/cross-compiled-gr-limesdr/7128.md?page=3)
