Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'ieee802_11' is not defined, when loading wifi_loopback.grc #379

Closed
ptef opened this issue Jun 9, 2023 · 9 comments
Closed

Comments

@ptef
Copy link

ptef commented Jun 9, 2023

Hallo there.

I know this is a very annoying error and I'm sorry for opening issue about that. I tried everything I could think of.

The error I'm getting is this one:

$ gnuradio-companion /home/dukpt/Downloads/gr-ieee802-11/examples/wifi_loopback.grc 
>>> Warning: vocoder_codec2_decode_ps - option_attributes are for enums only, ignoring
>>> Warning: vocoder_codec2_encode_sp - option_attributes are for enums only, ignoring
<<< Welcome to GNU Radio Companion 3.10.5.1 >>>

Block paths:
	/usr/share/gnuradio/grc/blocks

Loading: "/home/dukpt/Downloads/gr-ieee802-11/examples/wifi_loopback.grc"
>>> Loading: /home/dukpt/Downloads/gr-ieee802-11/examples/wifi_phy_hier.grc
[ERROR] Failed to evaluate parameter block chan_est (FlowGraph.py:275)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/FlowGraph.py", line 271, in renew_namespace
    value = eval(
  File "<string>", line 1, in <module>
NameError: name 'ieee802_11' is not defined
[ERROR] Failed to evaluate parameter block encoding (FlowGraph.py:275)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/FlowGraph.py", line 271, in renew_namespace
    value = eval(
  File "<string>", line 1, in <module>
NameError: name 'ieee802_11' is not defined
[ERROR] Failed to evaluate parameter block chan_est (FlowGraph.py:275)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/FlowGraph.py", line 271, in renew_namespace
    value = eval(
  File "<string>", line 1, in <module>
NameError: name 'ieee802_11' is not defined
[ERROR] Failed to evaluate parameter block encoding (FlowGraph.py:275)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/FlowGraph.py", line 271, in renew_namespace
    value = eval(
  File "<string>", line 1, in <module>
NameError: name 'ieee802_11' is not defined
[ERROR] Failed to evaluate parameter block chan_est (FlowGraph.py:275)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/FlowGraph.py", line 271, in renew_namespace
    value = eval(
  File "<string>", line 1, in <module>
NameError: name 'ieee802_11' is not defined
[ERROR] Failed to evaluate parameter block encoding (FlowGraph.py:275)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/FlowGraph.py", line 271, in renew_namespace
    value = eval(
  File "<string>", line 1, in <module>
NameError: name 'ieee802_11' is not defined
>>> Load Error: /home/dukpt/Downloads/gr-ieee802-11/examples/wifi_phy_hier.grc: Flowgraph invalid
**************************************************
6 errors from flowgraph:
Param - Value(value):
	Value "ieee802_11.signal_field()" cannot be evaluated:
	name 'ieee802_11' is not definedParam - Value(value):
	Value "ieee802_11.LS" cannot be evaluated:
	name 'ieee802_11' is not definedParam - Formatter Object(header_formatter):
	Value "header_formatter.formatter()" cannot be evaluated:
	'NoneType' object has no attribute 'formatter'Param - Value(value):
	Value "ieee802_11.BPSK_1_2" cannot be evaluated:
	name 'ieee802_11' is not definedParam - Algorithm(algo):
	Value "chan_est" cannot be evaluated:
	name 'chan_est' is not definedParam - Encoding(encoding):
	Value "encoding" cannot be evaluated:
	name 'encoding' is not defined
**************************************************
>>> Done

The gnuradio-companion print:
image

GNU Radio was installed from the main repository, following Installing instructions in GNU Radio website for Ubuntu 22.04.

$ gnuradio-config-info --prefix
/usr/
$ gnuradio-config-info --sysconfdir
/etc
$ gnuradio-config-info --print-all
/usr/
/etc
/etc/gnuradio/conf.d
/home/dukpt/.gnuradio
Mon, 06 Feb 2023 11:23:06Z
testing-support;python-support;post-install;doxygen;man-pages;gnuradio-runtime;common-precompiled-headers;gr-ctrlport;* thrift;gnuradio-companion;JSON/YAML config blocks;gr-blocks;gr-fec;gr-fft;gr-filter;gr-analog;gr-digital;gr-dtv;gr-audio;* alsa;* oss;* jack;* portaudio;gr-channels;gr-pdu;gr-iio;* libad9361;gr-qtgui;gr-trellis;gr-uhd;gr-uhd UHD 4.0 RFNoC;gr-utils;gr_modtool;gr_blocktool;gr-video-sdl;gr-vocoder;* codec2;* freedv;* gsm;gr-wavelet;gr-zeromq;gr-network;gr-soapy
3.10.5.1
cc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 
Copyright (C) 2021 Free Software Foundation, Inc. 
This is free software see the source for copying conditions.  There is NO 
warranty not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
c++ (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 
Copyright (C) 2021 Free Software Foundation, Inc. 
This is free software see the source for copying conditions.  There is NO 
warranty not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
/usr/bin/cc:::-O3 -DNDEBUG -g -O2 -ffile-prefix-map=/build/gnuradio-8rZ5NI/gnuradio-3.10.5.1-0~gnuradio~jammy=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized 
/usr/bin/c++:::-O3 -DNDEBUG -g -O2 -ffile-prefix-map=/build/gnuradio-8rZ5NI/gnuradio-3.10.5.1-0~gnuradio~jammy=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized
2.9.1

I've cloned from the branch maint-3.10 as I saw you pointed out in some other answer to work with GNU Radio 3.10:
$ git clone https://github.com/bastibl/gr-ieee802-11 --branch maint-3.10

Also python is able to correctly import module (I use asdf as version manager):

$ python
Python 3.11.3 (main, May  9 2023, 16:11:59) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ieee802_11
>>> 
$ which python
/home/dukpt/.asdf/shims/python

I've already checked issue #268, #208, #192 but none was enough. Somehow python inside GNU Radio is not able to find ieee802_11 module, even after specifying PYTHONPATH and LD_LIBRARY_PATH as I saw in other issues.

$ echo $PYTHONPATH 
/usr/lib/python3/dist-packages:/home/dukpt/.local/lib/python3.11/site-packages
$ echo $LD_LIBRARY_PATH 
/home/dukpt/.local/lib:/usr/lib:/usr/local/lib
$ ls -ld /lib
lrwxrwxrwx 1 root root 7 Mai  7 13:54 /lib -> usr/lib
$ find /usr -type d -name ieee802_11
/usr/include/ieee802_11
/usr/lib/cmake/ieee802_11
/usr/lib/python3/dist-packages/ieee802_11
$ find /usr -type d -name gnuradio
/usr/share/gnuradio
/usr/share/gnuradio/modtool/templates/gr-newmod/include/gnuradio
/usr/share/doc/gnuradio
/usr/include/gnuradio
/usr/lib/x86_64-linux-gnu/cmake/gnuradio
/usr/lib/python3/dist-packages/gnuradio
$ find /usr -type d -name foo
/usr/local/lib/python3.10/dist-packages/foo
/usr/local/lib/cmake/foo
/usr/local/include/foo
/usr/include/foo
/usr/lib/cmake/foo
/usr/lib/python3/dist-packages/foo

Considering what you've pointed out in previous answers:

  • incompatible versions of GNU Radio and this module - I think this was addressed by cloning the correct branch mentioned by you;
  • the install path of the Python module was not in the PYTHONPATH - done;
  • the install path of the shared library was not in LD_LIBRARY_PATH - also done;
  • the shared library was installed in a system directory and sudo ldconfig was not run - initially I had done this wrong and I thought it would work after your suggestion, however the error persisted.
  • gr-foo installed in the wrong directory - fixed

Is it possible to have some differences between main und maint-3.10 branches that could cause problems?
Or perhaps I'm still missing something?

Thank you.

@bastibl
Copy link
Owner

bastibl commented Jun 12, 2023

Maybe you didn't build the hierarchical block, i.e., open wifi_phy_hier.grc, click build, and reopen GRC?

@ptef
Copy link
Author

ptef commented Jun 12, 2023

It's not possible to build because the gadgets are not found.

Anyway I reconfigured distro python and removed the local python managed by asdf (I think it was conflicting since gnuradio use /usr/bin/python3):
$ sudo apt install --reinstall python3 python3-minimal --fix-broken

But now I have another problem that maybe is easier to catch:

$ python3 
Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gnuradio import gr
>>> import ieee802_11
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/ieee802_11/__init__.py", line 18, in <module>
    from .ieee802_11_python import *
ImportError: generic_type: type "chunks_to_symbols" referenced unknown base type "gr::tagged_stream_block"
>>> import foo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/foo/__init__.py", line 18, in <module>
    from .foo_python import *
ImportError: generic_type: type "burst_tagger" referenced unknown base type "gr::sync_block"
>>> 

Both gr-foo and gr-ieee802_11 were configured with cmake ../ -DCMAKE_INSTALL_PREFIX=/usr

The environment is also configured:

$ echo $LD_LIBRARY_PATH 
/lib:/usr/lib:/usr/local/lib:/home/dukpt/.local/lib
$ echo $PYTHONPATH 
/usr/lib/python3/dist-packages:/usr/lib/python3.10/site-packages
$ find /usr -type d -name ieee802_11
/usr/include/ieee802_11
/usr/lib/cmake/ieee802_11
/usr/lib/python3.10/site-packages/ieee802_11
$ find /usr -type d -name foo
/usr/local/include/foo
/usr/include/foo
/usr/lib/cmake/foo
/usr/lib/python3.10/site-packages/foo
$ find /usr -type d -name gnuradio
/usr/share/gnuradio
/usr/share/gnuradio/modtool/templates/gr-newmod/include/gnuradio
/usr/share/doc/gnuradio
/usr/include/gnuradio
/usr/lib/x86_64-linux-gnu/cmake/gnuradio
/usr/lib/python3/dist-packages/gnuradio

Any ideas?

@bastibl
Copy link
Owner

bastibl commented Jun 14, 2023

That looks like a PyBind version conflict. Can you please try the one that comes with your distro.

@ptef
Copy link
Author

ptef commented Jun 19, 2023

This is done already, but not working:

$ find /usr -type d -name pybind11
/usr/include/pybind11
/usr/lib/cmake/pybind11
/usr/lib/python3/dist-packages/pybind11
/usr/lib/python3/dist-packages/pybind11/share/cmake/pybind11
/usr/lib/python3/dist-packages/pybind11/include/pybind11
$ python3
Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gnuradio import gr
>>> import pybind11
>>> import foo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/foo/__init__.py", line 18, in <module>
    from .foo_python import *
ImportError: generic_type: type "burst_tagger" referenced unknown base type "gr::sync_block"
>>> import ieee802_11
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/ieee802_11/__init__.py", line 18, in <module>
    from .ieee802_11_python import *
ImportError: generic_type: type "chunks_to_symbols" referenced unknown base type "gr::tagged_stream_block"
>>> 
$ echo $PYTHONPATH 
/usr/lib/python3/dist-packages:/usr/lib/python3.10/site-packages:/home/dukpt/.local/lib/python3.10/site-packages
$ echo $LD_LIBRARY_PATH 
/lib:/usr/lib:/usr/local/lib:/home/dukpt/.local/lib

$ sudo ldconfig -v | grep ieee802
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
(from /etc/ld.so.conf.d/x86_64-linux-gnu.conf:4 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
/sbin/ldconfig.real: Path `/usr/lib32' given more than once
(from /etc/ld.so.conf.d/zz_i386-biarch-compat.conf:3 and /etc/ld.so.conf.d/zz_i386-biarch-compat.conf:2)
/sbin/ldconfig.real: Path `/usr/libx32' given more than once
(from /etc/ld.so.conf.d/zz_x32-biarch-compat.conf:3 and /etc/ld.so.conf.d/zz_x32-biarch-compat.conf:2)
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
(from <builtin>:0 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
(from <builtin>:0 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
/sbin/ldconfig.real: Path `/usr/lib' given more than once
(from <builtin>:0 and <builtin>:0)
	libgnuradio-ieee802_11.so.1.1.0git -> libgnuradio-ieee802_11.so.g56d8c5c
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 is the dynamic linker, ignoring

/sbin/ldconfig.real: /lib32/ld-linux.so.2 is the dynamic linker, ignoring

$ sudo ldconfig -v | grep foo
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
(from /etc/ld.so.conf.d/x86_64-linux-gnu.conf:4 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
/sbin/ldconfig.real: Path `/usr/lib32' given more than once
(from /etc/ld.so.conf.d/zz_i386-biarch-compat.conf:3 and /etc/ld.so.conf.d/zz_i386-biarch-compat.conf:2)
/sbin/ldconfig.real: Path `/usr/libx32' given more than once
(from /etc/ld.so.conf.d/zz_x32-biarch-compat.conf:3 and /etc/ld.so.conf.d/zz_x32-biarch-compat.conf:2)
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
(from <builtin>:0 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
(from <builtin>:0 and /etc/ld.so.conf.d/x86_64-linux-gnu.conf:3)
/sbin/ldconfig.real: Path `/usr/lib' given more than once
(from <builtin>:0 and <builtin>:0)
	libgnuradio-foo.so.1.1.0git -> libgnuradio-foo.so.gcc8bfc6
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 is the dynamic linker, ignoring

/sbin/ldconfig.real: /lib32/ld-linux.so.2 is the dynamic linker, ignoring

Both gr-foo and gr-ieee802_11 were compiled with -DCMAKE_INSTALL_PREFIX=/usr

@bastibl
Copy link
Owner

bastibl commented Jun 19, 2023

This shows that you have pybind11 from you package manager installed. Please also make sure that there is no other version in your user environment or some other Python package manager that may be picked up during the compilation of GNU Radio or the OOT module.

@ptef
Copy link
Author

ptef commented Jun 28, 2023

Unfortunately this is not working for me.
Do you see my PYTHONPATH and LD_LIBRARY_PATH, am I forgetting something?

@bastibl
Copy link
Owner

bastibl commented Jun 29, 2023

Again, your output shows that you have pybind from your package manager installed. It does not show that there is not other version from asdf (or whatever you used) or pip or virtualenv or ... I'm pretty sure either GNU Radio or the OOT or both were not compiled with the correct pybind version.

@ptef
Copy link
Author

ptef commented Jun 29, 2023

Regarding pybind I already showed that it was installed from package manager and there is not other version installed:

$ find ~/ /usr -type d -name pybind\*
/usr/share/doc/pybind11-dev
/usr/include/pybind11
/usr/lib/cmake/pybind11
/usr/lib/python3/dist-packages/pybind11-2.9.1.egg-info
/usr/lib/python3/dist-packages/pybind11
/usr/lib/python3/dist-packages/pybind11/share/cmake/pybind11
/usr/lib/python3/dist-packages/pybind11/include/pybind11
/usr/lib/python3/dist-packages/pybindgen

$ dpkg-query -L python3-pybind11
/.
/usr
/usr/bin
/usr/bin/pybind11-config
/usr/lib
/usr/lib/python3
/usr/lib/python3/dist-packages
/usr/lib/python3/dist-packages/pybind11
/usr/lib/python3/dist-packages/pybind11/__init__.py
/usr/lib/python3/dist-packages/pybind11/__main__.py
/usr/lib/python3/dist-packages/pybind11/_version.py
/usr/lib/python3/dist-packages/pybind11/_version.pyi
/usr/lib/python3/dist-packages/pybind11/commands.py
/usr/lib/python3/dist-packages/pybind11/include
/usr/lib/python3/dist-packages/pybind11/include/pybind11
/usr/lib/python3/dist-packages/pybind11/include/pybind11/attr.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/buffer_info.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/cast.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/chrono.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/common.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/complex.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/detail
/usr/lib/python3/dist-packages/pybind11/include/pybind11/detail/class.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/detail/common.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/detail/descr.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/detail/init.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/detail/internals.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/detail/type_caster_base.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/detail/typeid.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/eigen.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/embed.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/eval.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/functional.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/gil.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/iostream.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/numpy.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/operators.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/options.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/pytypes.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/stl
/usr/lib/python3/dist-packages/pybind11/include/pybind11/stl/filesystem.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/stl.h
/usr/lib/python3/dist-packages/pybind11/include/pybind11/stl_bind.h
/usr/lib/python3/dist-packages/pybind11/py.typed
/usr/lib/python3/dist-packages/pybind11/setup_helpers.py
/usr/lib/python3/dist-packages/pybind11/setup_helpers.pyi
/usr/lib/python3/dist-packages/pybind11/share
/usr/lib/python3/dist-packages/pybind11/share/cmake
/usr/lib/python3/dist-packages/pybind11/share/cmake/pybind11
/usr/lib/python3/dist-packages/pybind11/share/cmake/pybind11/FindPythonLibsNew.cmake
/usr/lib/python3/dist-packages/pybind11/share/cmake/pybind11/pybind11Common.cmake
/usr/lib/python3/dist-packages/pybind11/share/cmake/pybind11/pybind11Config.cmake
/usr/lib/python3/dist-packages/pybind11/share/cmake/pybind11/pybind11ConfigVersion.cmake
/usr/lib/python3/dist-packages/pybind11/share/cmake/pybind11/pybind11NewTools.cmake
/usr/lib/python3/dist-packages/pybind11/share/cmake/pybind11/pybind11Targets.cmake
/usr/lib/python3/dist-packages/pybind11/share/cmake/pybind11/pybind11Tools.cmake
/usr/lib/python3/dist-packages/pybind11-2.9.1.egg-info
/usr/lib/python3/dist-packages/pybind11-2.9.1.egg-info/PKG-INFO
/usr/lib/python3/dist-packages/pybind11-2.9.1.egg-info/dependency_links.txt
/usr/lib/python3/dist-packages/pybind11-2.9.1.egg-info/entry_points.txt
/usr/lib/python3/dist-packages/pybind11-2.9.1.egg-info/not-zip-safe
/usr/lib/python3/dist-packages/pybind11-2.9.1.egg-info/requires.txt
/usr/lib/python3/dist-packages/pybind11-2.9.1.egg-info/top_level.txt
/usr/share
/usr/share/doc
/usr/share/doc/python3-pybind11
/usr/share/doc/python3-pybind11/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/pybind11-config.1.gz
/usr/share/doc/python3-pybind11/changelog.Debian.gz

I unalias and unsourced every asdf python reference, so both pybind and gnuradio are from package manager. I did not compile gnuradio, but installed from Ubuntu repository.

$ strace python3 -s -c 'import foo' 2>&1 | grep foo_python
newfstatat(AT_FDCWD, "/usr/lib/python3.10/site-packages/foo/foo_python.cpython-310-x86_64-linux-gnu.so", {st_mode=S_IFREG|0644, st_size=282456, ...}, 0) = 0
openat(AT_FDCWD, "/usr/lib/python3.10/site-packages/foo/foo_python.cpython-310-x86_64-linux-gnu.so", O_RDONLY|O_CLOEXEC) = 3
write(2, "    from .foo_python import *\n", 30    from .foo_python import *

$ python3
Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import foo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/foo/__init__.py", line 18, in <module>
    from .foo_python import *
ImportError: generic_type: type "burst_tagger" referenced unknown base type "gr::sync_block"
>>> 

$ echo $PYTHONPATH 
/usr/lib/python3/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.10/site-packages

$ echo $LD_LIBRARY_PATH 
/lib64:/lib:/usr/lib:/usr/lib/x86_64-linux-gnu:/usr/local/lib

In case of gr-ieee802_11 I compiled as:

$  cmake ../ -DCMAKE_INSTALL_PREFIX=/usr # gr-ieee802_11
-- The CXX compiler identification is GNU 12.1.0
-- The C compiler identification is GNU 12.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Build type not specified: defaulting to release.
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Found Volk: Volk::volk  
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Checking for module 'gmp'
--   Found gmp, version 6.2.1
-- Found GMP: /usr/lib/x86_64-linux-gnu/libgmpxx.so  
-- Using GMP.
-- Found MPLIB: /usr/lib/x86_64-linux-gnu/libgmpxx.so  
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.74.0") found components: date_time program_options system regex thread unit_test_framework 
-- User set python executable /usr/bin/python3
-- Found PythonInterp: /usr/bin/python3 (found version "3.10.6") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.10.so (found suitable exact version "3.10.6") 
-- Found Git: /usr/bin/git  
-- Extracting version information from git describe...
fatal: No names found, cannot describe anything.
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Looking for xmmintrin.h
-- Looking for xmmintrin.h - found
-- Using install prefix: /usr
-- Building for version: g56d8c5c / 1.1.0git
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- PYTHON and GRC components are enabled
-- Python checking for pygccxml - found
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.10.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Found pybind11: /usr/include (found version "2.9.1")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dukpt/Downloads/gr-ieee802-11/build

And then:

$  sudo make install
[sudo] password for dukpt: 
Consolidate compiler generated dependencies of target gnuradio-ieee802_11
[ 55%] Built target gnuradio-ieee802_11
[ 55%] Built target pygen_apps_9a6dd283c3de653fbca500f9721f634f
[ 60%] Built target pygen_python_e5b31959bf762a590b6f6572ea91d788
[ 63%] Built target ieee802_11_docstrings
Consolidate compiler generated dependencies of target ieee802_11_python
[100%] Built target ieee802_11_python
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/lib/cmake/ieee802_11/ieee802_11Config.cmake
-- Installing: /usr/include/ieee802_11/api.h
-- Installing: /usr/include/ieee802_11/chunks_to_symbols.h
-- Installing: /usr/include/ieee802_11/constellations.h
-- Installing: /usr/include/ieee802_11/decode_mac.h
-- Installing: /usr/include/ieee802_11/ether_encap.h
-- Installing: /usr/include/ieee802_11/extract_csi.h
-- Installing: /usr/include/ieee802_11/frame_equalizer.h
-- Installing: /usr/include/ieee802_11/mac.h
-- Installing: /usr/include/ieee802_11/mapper.h
-- Installing: /usr/include/ieee802_11/parse_mac.h
-- Installing: /usr/include/ieee802_11/signal_field.h
-- Installing: /usr/include/ieee802_11/sync_long.h
-- Installing: /usr/include/ieee802_11/sync_short.h
-- Installing: /usr/lib/x86_64-linux-gnu/libgnuradio-ieee802_11.so.g56d8c5c
-- Up-to-date: /usr/lib/x86_64-linux-gnu/libgnuradio-ieee802_11.so.1.1.0git
-- Up-to-date: /usr/lib/x86_64-linux-gnu/libgnuradio-ieee802_11.so
-- Installing: /usr/lib/cmake/ieee802_11/gnuradio-ieee802_11Targets.cmake
-- Installing: /usr/lib/cmake/ieee802_11/gnuradio-ieee802_11Targets-release.cmake
-- Installing: /usr/lib/cmake/ieee802_11/gnuradio-ieee802_11Config.cmake
-- Installing: /usr/lib/python3.10/site-packages/ieee802_11/__init__.py
-- Installing: /usr/lib/python3.10/site-packages/ieee802_11/utils.py
-- Installing: /usr/lib/python3.10/site-packages/ieee802_11/__init__.pyc
-- Installing: /usr/lib/python3.10/site-packages/ieee802_11/utils.pyc
-- Installing: /usr/lib/python3.10/site-packages/ieee802_11/__init__.pyo
-- Installing: /usr/lib/python3.10/site-packages/ieee802_11/utils.pyo
-- Installing: /usr/lib/python3.10/site-packages/ieee802_11/ieee802_11_python.cpython-310-x86_64-linux-gnu.so
-- Set runtime path of "/usr/lib/python3.10/site-packages/ieee802_11/ieee802_11_python.cpython-310-x86_64-linux-gnu.so" to ""
-- Up-to-date: /usr/share/gnuradio/grc/blocks/ieee802_11_chunks_to_symbols.block.yml
-- Up-to-date: /usr/share/gnuradio/grc/blocks/ieee802_11_decode_mac.block.yml
-- Up-to-date: /usr/share/gnuradio/grc/blocks/ieee802_11_ether_encap.block.yml
-- Up-to-date: /usr/share/gnuradio/grc/blocks/ieee802_11_extract_csi.block.yml
-- Up-to-date: /usr/share/gnuradio/grc/blocks/ieee802_11_frame_equalizer.block.yml
-- Up-to-date: /usr/share/gnuradio/grc/blocks/ieee802_11_mac.block.yml
-- Up-to-date: /usr/share/gnuradio/grc/blocks/ieee802_11_mapper.block.yml
-- Up-to-date: /usr/share/gnuradio/grc/blocks/ieee802_11_parse_mac.block.yml
-- Up-to-date: /usr/share/gnuradio/grc/blocks/ieee802_11_sync_long.block.yml
-- Up-to-date: /usr/share/gnuradio/grc/blocks/ieee802_11_sync_short.block.yml

Regarding the line
-- Set runtime path of "/usr/lib/python3.10/site-packages/ieee802_11/ieee802_11_python.cpython-310-x86_64-linux-gnu.so" to ""
do you think this could indicate some reference problem?

$ python3 -c 'import foo' 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/foo/__init__.py", line 18, in <module>
    from .foo_python import *
ImportError: generic_type: type "burst_tagger" referenced unknown base type "gr::sync_block"

$ python3 -c 'import ieee802_11' 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/ieee802_11/__init__.py", line 18, in <module>
    from .ieee802_11_python import *
ImportError: generic_type: type "chunks_to_symbols" referenced unknown base type "gr::tagged_stream_block"

@bastibl
Copy link
Owner

bastibl commented Jun 29, 2023

All I can say is that I had this exact problem and it turned out to be a pybind issue.

The exact same problem is also identified as a pybind issue here: https://lists.gnu.org/archive/html/discuss-gnuradio/2021-05/msg00056.html

Please try to compile any other GNU Radio module. If other modules work, let me know. Otherwise, please write to the GNU Radio mailing list.

@bastibl bastibl closed this as completed Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants