Thank you Josh. You answer came while I was making another post. I will
take a look at what you have suggested. Just would like to add, that my
module is created with gr_modtool from the gnuradio version i have at the
moment (3.8) - should in that case all dependencies be automatically solved
in the modern Cmake way? I also made another brand new module with a dummy
block and no dependencies. The block was realy just returning noutput_items
value or something. It was also making the same trouble. I have an
impression that if linking from my module to the gnuradio modules were bad,
it would raise some kind of runtime error, but I am no expert.

Here is what I wanted to ask before the answer from Josh came:

I decided to localize the problem, though without any success, but there
are some open questions:
1. during making of my module i see the following message and can't figure
out what that means, or is it wrong:
Set runtime path of "/usr/lib/python3.8/site-packages/TPMS/_TPMS_swig.so"
to ""
2. at the beginning of the swig.py file of my module there are following
lines:
# Import the low-level C/C++ module
if __package__ or "." in __name__:
    print ("from . import _TPMS_swig")
    from . import _TPMS_swig
    print ("something")
else:
    import _TPMS_swig
  I added those print commands. "something" is never printed, and I cant
explain why. No error special error is raised even if I write for example
"_TPMS-swig!!!!!" instead of "_TPMS_swig".

Best

On Mon, Jul 13, 2020 at 2:20 AM Nemanja Savic <vlasi...@gmail.com> wrote:

> Hi all,
>
> haven't been using GR and posting here for about 5 years. A few days ago I
> installed GR on my machine which runs under Manjaro. I wanted to port some
> of my old GR blocks (from 3.6.5) to the current GR version. I created a new
> module and started adding some blocks. Making module works just fine but
> when I want to use the blocks a python exception occurs saying my module
> doesn't have the attribute it needs. My block is called TPMS and the error
> is following:
>
> self.TPMS_min_max_threshold_detector_fb_0 =
> TPMS.min_max_threshold_detector_fb(samp_rate, 0.01)
> AttributeError: module 'TPMS' has no attribute
> 'min_max_threshold_detector_fb'
>
> I dont seem to understand why is this happening. Namely, under this path:
> /usr/lib/python3.8/site-packages/TPMS
> I can see TPMS_swig.py and within that file there is a class
> class min_max_threshold_detector_fb(object):
>
> It looks like something is wrong in the python but cant figure out what.
>
> sudo ld config didnt help.
>
> The output of cmake when preparing the block is following
>
> -- Build type not specified: defaulting to release.
> CMake Warning (dev) at
> /usr/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272
> (message):
>   The package name passed to `find_package_handle_standard_args`
> (PkgConfig)
>   does not match the name of the calling package (GMP).  This can lead to
>   problems in calling code that expects `find_package` result variables
>   (e.g., `_FOUND`) to follow a certain pattern.
> Call Stack (most recent call first):
>   /usr/share/cmake-3.17/Modules/FindPkgConfig.cmake:45
> (find_package_handle_standard_args)
>   /usr/lib64/cmake/gnuradio/FindGMP.cmake:1 (include)
>   /usr/lib64/cmake/gnuradio/FindMPLIB.cmake:1 (find_package)
>   /usr/share/cmake-3.17/Modules/CMakeFindDependencyMacro.cmake:47
> (find_package)
>   /usr/lib64/cmake/gnuradio/GnuradioConfig.cmake:26 (find_dependency)
>   CMakeLists.txt:88 (find_package)
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> CMake Warning (dev) at
> /usr/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272
> (message):
>   The package name passed to `find_package_handle_standard_args`
> (PkgConfig)
>   does not match the name of the calling package (MPIR).  This can lead to
>   problems in calling code that expects `find_package` result variables
>   (e.g., `_FOUND`) to follow a certain pattern.
> Call Stack (most recent call first):
>   /usr/share/cmake-3.17/Modules/FindPkgConfig.cmake:45
> (find_package_handle_standard_args)
>   /usr/lib64/cmake/gnuradio/FindMPIR.cmake:1 (include)
>   /usr/lib64/cmake/gnuradio/FindMPLIB.cmake:2 (find_package)
>   /usr/share/cmake-3.17/Modules/CMakeFindDependencyMacro.cmake:47
> (find_package)
>   /usr/lib64/cmake/gnuradio/GnuradioConfig.cmake:26 (find_dependency)
>   CMakeLists.txt:88 (find_package)
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> -- Checking for module 'mpir >= 3.0'
> --   Package 'mpir', required by 'virtual:world', not found
> -- Could NOT find MPIR (missing: MPIRXX_LIBRARY MPIR_INCLUDE_DIR)
> CMake Warning (dev) at
> /usr/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272
> (message):
>   The package name passed to `find_package_handle_standard_args` (VOLK)
> does
>   not match the name of the calling package (Volk).  This can lead to
>   problems in calling code that expects `find_package` result variables
>   (e.g., `_FOUND`) to follow a certain pattern.
> Call Stack (most recent call first):
>   /usr/lib64/cmake/volk/VolkConfig.cmake:32
> (find_package_handle_standard_args)
>   /usr/share/cmake-3.17/Modules/CMakeFindDependencyMacro.cmake:47
> (find_package)
>   /usr/lib64/cmake/gnuradio/GnuradioConfig.cmake:46 (find_dependency)
>   CMakeLists.txt:88 (find_package)
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> -- User set python executable /usr/bin/python3
> -- Found PythonLibs: /usr/lib/libpython3.8.so (found suitable exact
> version "3.8.3")
> -- Using install prefix: /usr/local
> -- Building for version: v1.0-compat-xxx-xunknown / 1.0.0git
> -- No C++ unit tests... skipping
> --
> -- Checking for module SWIG
> -- Found SWIG version 4.0.1.
> -- Found PythonLibs: /usr/lib/libpython3.8.so (found version "3.8.3")
> -- Configuring done
> -- Generating done
> -- Build files have been written to:
> /home/user/work/gnuradio_module_test/gr-TPMS/build
>
> In the past I used Red Hat, this is my first time using a distro based on
> Arch Linux and I don't know if I am missing something regarding shared
> libraries.
>
> Best regards and thank you for your help
>


-- 
Nemanja Savić

Reply via email to