Hi,
On 8/27/23 10:46 PM, Bagojfalvi Bagoj wrote:
Hi all,
Apologies in advance as I have no idea what I'm doing on multiple levels.
I'm trying to build my own OOT module. I managed to clear a number of
issues already but I got stuck.
I have a clean install of the latest released GNURadio following the
CondaInstall tutorial on the website, including the steps needed for
building OOT modules. I used gr_modtool as described in the C++ OOT
tutorial to create the template for my module.
Build works seemingly fine, but install places stuff in some crazy
location in my Program Files(x86) folder. (obviously I'm on windows)
E.g.: C:/Program Files (x86)/gr-ni_modinst_rf/bin/gnuradio-ni_modinst_rf.dll
I changed the top level CMakeList.txt to set CMAKE_INSTALL_PREFIX to the
CONDA_PREFIX env variable + /Library.
This puts everything where it should be,
E.g.:
C:/Users/Admin/.conda/envs/gnuradio-env/Library/bin/gnuradio-ni_modinst_rf.dll
except for the python output.
The python output is installed to
E.g.:
C:/Users/Admin/.conda/envs/gnuradio-env/Library/Lib/site-packages/gnuradio/ni_modinst_rf/ni_modinst_rf_python.cp311-win_amd64.pyd
but looking at where GR is expecting and where other stuff is it should
be in
C:/Users/Admin/.conda/envs/gnuradio-env/Lib/site-packages/gnuradio/ni_modinst_rf/
instead
(note gnuradio-env/Lib vs gnuradio-env/Library/Lib )
Any ideas...
1. why was I missing the correct cmake install location?
2. why the difference between the Library/Lib and /Lib locations
3. how to tell cmake properly where to install?
1. CMake guesses on where to put the Python files based on your prefix,
but it happens to guess wrong because of how the conda environment is
structured.
2. %CONDA_PREFIX%/Library/Lib is not anything that anybody uses, except
by mistake, whereas %CONDA_PREFIX%/Lib is where Anaconda decided to put
all the Python files when they released conda, and the ecosystem is
stuck with that split now.
3. The part you're (probably) missing is to add the cmake argument to
set GR_PYTHON_DIR to "%CONDA_PREFIX%\Lib\site-packages", i.e.
cmake -DGR_PYTHON_DIR="%CONDA_PREFIX%\Lib\site-packages" (the rest)
By the way, this is documented on the CondaInstall wiki in the Building
OOT modules section:
https://wiki.gnuradio.org/index.php/CondaInstall#Building_OOT_modules_to_use_with_conda-installed_GNU_Radio
Anyway, my temporary fix was to simply copy over the python files where
they should be and this way GR got one step closer to running my module.
I can drop the block in GRC, however I can't get over the following
error when running.
from .ni_modinst_rf_python import *
ImportError: generic_type: type "ni_rfsa_source" referenced unknown base
type "gr::block"
This feels like an issue with using a different version of pybind or
compiler than what GNU Radio was built with. Maybe look into using the
`gnuradio-build-deps` metapackage to install the same versions of those
as were used to compile gnuradio?
I found this thread here: gr 3.9 OOT execution error: unknown base type
gr::block (gnu.org)
<https://lists.gnu.org/archive/html/discuss-gnuradio/2021-05/msg00023.html>
It sounds like the same issue, but there is no resolution.
Anybody can point me in the right direction please?
I think I'm doing pretty good considering I didn't know what cmake was 2
days ago, but I understand I'm lacking some basics. Please be gentle. :D
Thank you!
Cheers,
Ryan