Hi Florian,

I'm not sure if you're who I figured this out with on the Matrix chat, but it's 
worth documenting for the mailing list anyway.

I think the issue here is that CMake on Windows defaults to building the OOT in the 
"Debug" configuration, and this creates pybind11 bindings that are incompatible with a 
non-Debug build of GNU Radio. The solution is to specify "-DCMAKE_BUILD_TYPE=Release" 
when running cmake. I have already updated the CondaInstall guide to reflect this.

Longer-term, it would be good if the build defaulted to the "Release" 
configuration. The CMake code already attempts to do this, but it doesn't work on Windows 
in the same way it does on Linux/macOS. I think I have a solution for that and will be 
submitting a pull request shortly.

Cheers,
Ryan

On 1/23/22 2:32 PM, Florian Euchner wrote:
Hello everyone,

I am having trouble compiling OOT modules on Windows (Windows 10, Visual Studio 
2017 14.16.27023).
As far as I can tell, my problems affect any OOT module, so I will just use 
gr-correctiq [1] as an example.

I am inside a Conda environment as detailed in the CondaInstall guide [2] and 
my GNURadio has been built from the sources following the instructions in [3].
I can compile and install OOT modules just fine, but after installation, they 
fail to import with the following error:

# python
import correctiq
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "C:\Users\florian\.conda\envs\grdev\lib\site-packages\correctiq\__init__.py", 
line 18, in <module>
     from .correctiq_python import *
ImportError: generic_type: type "correctiq" referenced unknown base type 
"gr::sync_block"

The same error occurs when executing a flowgraph with any block from the 
correctiq module inside GNURadio companion.

I have seen a similar question on the mailing list recently [4], where the 
issue turned out to be different pybind versions.
However, this can't be the case for me, since I have compiled GNURadio from 
source inside the same Conda environment (GNURadio version is latest master as 
of today, but also occurs for 3.9.5 and 3.10).
Also, my problem appears to specifically occur on Windows and not on Linux.

Any idea on how to solve or debug it? Any help is greatly appreciated!

Kind regards,
Florian

[1]: https://github.com/ghostop14/gr-correctiq
[2]: https://wiki.gnuradio.org/index.php?title=CondaInstall
[3]: 
https://wiki.gnuradio.org/index.php?title=CondaInstall#Building_GNU_Radio_from_source_within_a_conda_environment
[4]: https://lists.gnu.org/archive/html/discuss-gnuradio/2021-05/msg00056.html


Reply via email to