|
From: | Nicolas Cuervo |
Subject: | Re: [Discuss-gnuradio] Runtime AttributeError for custom block |
Date: | Mon, 10 Jul 2017 08:43:30 +0200 |
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 linux2Type "help", "copyright", "credits" or "license" for more information.>>> import a1System>>> from a1System import TargetDetector_cfTraceback (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_cfOn 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/libb
oost_system.so.1.58.0 (0x00007fc09f77b000) libgnuradio-runtime-3.7.11.1.s
o.0.0.0 => /usr/local/lib/libgnuradio-run time-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/libs
tdc++.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/libpthre
ad.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/libb oost_program_options.so.1.58.0 (0x00007fc09dd6c000) libboost_filesystem.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libb
oost_filesystem.so.1.58.0 (0x00007fc09db54000) libboost_thread.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libb
oost_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/libo
rc-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/ar
chive/html/discuss-gnuradio/20 .15-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. , line 234, in <module>py" main()
File "/home/vipin/a1/grc/a1-rfe+mimo/gr-a1System/build/top_block. , line 222, in mainpy" tb = top_block_cls()
File "/home/vipin/a1/grc/a1-rfe+mimo/gr-a1System/build/top_block. , line 164, in __init__py" self.a1System_TargetDetector_c
f_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
[Prev in Thread] | Current Thread | [Next in Thread] |