discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Runtime AttributeError for custom block


From: Nicolas Cuervo
Subject: Re: [Discuss-gnuradio] Runtime AttributeError for custom block
Date: Mon, 10 Jul 2017 08:43:30 +0200

There are two things worth checking as of now, before getting into the specifics:

1. You have all the libraries that your module need, and they are properly linked: this is part of your first answer to this thread. If you included external/custom libraries, that is the ones that you'd need to manually link 
2. Your swig installation exists and its working: sometimes (maybe always? not sure anymore) the compilation of your module succeed even if you don't have SWIG working, and it leads to issues like this. Read the output of the 'cmake ..' step to check if it tells that that something is missing.

-N

On Mon, Jul 10, 2017 at 8:08 AM, Vipin Sharma <address@hidden> wrote:
Thanks for your quick post. Looks like it cannot find the custom block in standalone Python as well. I have followed the custom block OOT module tutorial verbatim; I don't think I saw any issues with any of the outlined steps in the guided tutorial.

There seems to be some installation issue for the custom block during 'sudo make install' step of the guided tutorial?

Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import a1System
>>> from a1System import TargetDetector_cf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name TargetDetector_cf
>>> 



On Sun, Jul 9, 2017 at 11:04 PM, Nicolas Cuervo <address@hidden> wrote:
Hello Vipin,

Just as a sanity check (from some funny behaviour that I saw recently): can you actually import that module in a python interpreter (such as ipython or bpython)? I.e. are you able to do the following?

    >>> import a1System
    >>> from a1System import TargetDetector_cf



On Mon, Jul 10, 2017 at 7:59 AM, <address@hidden> wrote:

I tried ‘sudo ldconfig’ and then regenerated the flowgraph after re-building the application. I see the same issue as before. Here is the output of ‘ldd’. How do I know what is missing?

 

                linux-vdso.so.1 =>  (0x00007ffc10dfd000)

                libboost_system.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 (0x00007fc09f77b000)

                libgnuradio-runtime-3.7.11.1.so.0.0.0 => /usr/local/lib/libgnuradio-runtime-3.7.11.1.so.0.0.0 (0x00007fc09f48f000)

                libgnuradio-pmt-3.7.11.1.so.0.0.0 => /usr/local/lib/libgnuradio-pmt-3.7.11.1.so.0.0.0 (0x00007fc09f23f000)

                libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc09eebd000)

                libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc09ebb4000)

                libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc09e99d000)

                libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc09e5d3000)

                libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc09e3b6000)

                libvolk.so.1.3 => /usr/local/lib/libvolk.so.1.3 (0x00007fc09dfea000)

                libboost_program_options.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.58.0 (0x00007fc09dd6c000)

                libboost_filesystem.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0 (0x00007fc09db54000)

                libboost_thread.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0 (0x00007fc09d92d000)

                librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fc09d725000)

                /lib64/ld-linux-x86-64.so.2 (0x000055ff2d4b7000)

                liborc-0.4.so.0 => /usr/lib/x86_64-linux-gnu/liborc-0.4.so.0 (0x00007fc09d4a4000)

 

 

Sent from Mail for Windows 10

 

From: Nicolas Cuervo
Sent: Sunday, July 9, 2017 10:49 PM
To: Vipin Sharma
Cc: GNURadio Discussion List
Subject: Re: [Discuss-gnuradio] Runtime AttributeError for custom block

 

Hi,

 

it is nice that you look for the error before posting, but does your module actually need the ITPP libraries? because that might have been something specific for the case that you quoted. 

To check if your problem is linking, first run the following command:

 

    $ sudo ldconfig

 

and then try to start again your application in GRC. 

 

If the problem persists, then you have to look for some required library which linking is not made properly. To check the linking you can run the "ldd" command on the generated shared object of your module (which, based on your email, is supposed to be called something like 'libgnuradio-a1System.so')

Regards,

- Nicolas

 

On Mon, Jul 10, 2017 at 6:31 AM, Vipin Sharma <address@hidden> wrote:

I have a Python flowgraph which instantiates a few custom blocks (written in C++). The flow graph generate is fine but when I try to run the program through GUI, I get attribute errors as shown below.

 

After researching a bit, I found out that one potential cause could be missing ITPP libraries as discussed in an old post here: https://lists.gnu.org/archive/html/discuss-gnuradio/2015-02/msg00158.html

 

I followed through suggested changes (adding following lines in my lib/CMakeList.txt). This doesn't seem to help at all; I don't see any extra libraries being included in the final a1System.so library under build/lib/ after the 'make build'. This likely implies I am still missing a critical step for the custom blocks in C++. Any ideas how I can proceed?

 

Excerpt from lib/CMakeList.txt file:

 

list(APPEND a1System_libs

 ${GNURADIO_ALL_LIBRARIES}

 ${ITPP_LIBRARIES}

)

target_link_libraries(gnuradio-a1System ${Boost_LIBRARIES} ${a1System_libs})

 

Runtime Log from GRC:

 

File "/home/vipin/a1/grc/a1-rfe+mimo/gr-a1System/build/top_block.py", line 234, in <module>
main() 
File "/home/vipin/a1/grc/a1-rfe+mimo/gr-a1System/build/top_block.py", line 222, in main
tb = top_block_cls()
File "/home/vipin/a1/grc/a1-rfe+mimo/gr-a1System/build/top_block.py", line 164, in __init__
self.a1System_TargetDetector_cf_0 = a1System.TargetDetector_cf(512, 10, 1024, 2, 5, 1, 1, 1, 1)
AttributeError: 'module' object has no attribute 'TargetDetector_cf'


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

 

 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]