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: Vipin Sharma
Subject: Re: [Discuss-gnuradio] Runtime AttributeError for custom block
Date: Sun, 16 Jul 2017 23:04:11 -0700

Ahh, guess what. After all this time I spent debugging this issue, it turned it was a simple problem after all. It looks like I had missed including one of the .cpp files for my custom C++ block. This was causing the linker to not find one of the symbols in the generated library file. And eventually of course the import error with SWIG involved along with Python.

After including the missing .cpp file, I am now all good.

Thank you!

Vipin


On Sun, Jul 16, 2017 at 9:56 PM, Vipin Sharma <address@hidden> wrote:
Thank you for offering to help!

You can download the tarball from this link. Let me know if you see any issues:

http://gofile.me/3xsiF/8roibqmka

Vipin

On Sun, Jul 16, 2017 at 5:27 PM, Michael Dickens <address@hidden> wrote:
Hi Vipin - It certainly sounds like you're doing everything correctly in the CMakeLists.txt file for the library. For better or worse, the easiest way to help here is to get eyes on your test-OOT & see if we can replicate the issue. I'm happy to help you if you want: off-list send me a tarball (or link to your online repo) for testing, and instructions on dependencies & anything else I need to know for building / testing. - MLD

On Sun, Jul 16, 2017, at 03:09 PM, Vipin Sharma wrote:
I still continue to shoot in the dark to figure this SWIG issue. I decided to run the 'make test' step as well (after 'sudo make install') step and as expected it fails as well. Looking deeper a bit (using 'ctest -V' under 'build' directory), I see one of the symbols being undefined (see below for the log). In the *_impl.cc function of the TargetDetector_cf block, I call an external cpp function named "TargetDetector" which is defined in a separate source file "TargetDetector.cpp" residing in the lib/* directory. I have made sure that I am including all relevant cpp pointers in the lib/CMakeLists.txt file as below. The 'rtNaN' symbol (from ctest error log below) is defined in rtGetNaN.cpp file which is included as well. I have no idea why this is not seen. I suspect that nothing about the custom block TargetDetect_cf (and its class derivates, etc.) are seen in GRC's python environment. For some reason, PYTHON/CPP are not happy in the GRC environment. 

I would appreciate any pointers to figure this out. Thanks, Vipin


########################################################################
# Setup library
########################################################################
include(GrPlatform) #define LIB_SUFFIX
include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS})

list(APPEND a1System_sources
    rtGetInf.cpp
    rtGetNaN.cpp  
    TargetDetector_emxAPI.cpp
    TargetDetector_emxutil.cpp
    TargetDetector.cpp
    TargetDetector_cf_impl.cc
)


address@hidden:~/a1/grcnew/gr-a1System/build$ ctest -V

UpdateCTestConfiguration  from :/home/vipin/a1/grcnew/gr-a1System/build/DartConfiguration.tcl
UpdateCTestConfiguration  from :/home/vipin/a1/grcnew/gr-a1System/build/DartConfiguration.tcl
Test project /home/vipin/a1/grcnew/gr-a1System/build
Constructing a list of tests
Done constructing a list of tests
Checking test dependency graph...
Checking test dependency graph end
test 1
    Start 1: test_a1System

1: Test command: /bin/sh "/home/vipin/a1/grcnew/gr-a1System/build/lib/test_a1System_test.sh"
1: Test timeout computed to be: 9.99988e+06
1: .
1: 
1/2 Test #1: test_a1System ....................   Passed    0.00 sec
test 2
    Start 2: qa_TargetDetector_cf

2: Test command: /bin/sh "/home/vipin/a1/grcnew/gr-a1System/build/python/qa_TargetDetector_cf_test.sh"
2: Test timeout computed to be: 9.99988e+06
2: Traceback (most recent call last):
2:   File "/home/vipin/a1/grcnew/gr-a1System/python/qa_TargetDetector_cf.py", line 24, in <module>
2:     import a1System_swig as a1System
2:   File "/home/vipin/a1/grcnew/gr-a1System/build/swig/a1System_swig.py", line 28, in <module>
2:     _a1System_swig = swig_import_helper()
2:   File "/home/vipin/a1/grcnew/gr-a1System/build/swig/a1System_swig.py", line 24, in swig_import_helper
2:     _mod = imp.load_module('_a1System_swig', fp, pathname, description)
2: ImportError: /home/vipin/a1/grcnew/gr-a1System/build/lib/libgnuradio-a1System-1.0.0git.so.0.0.0: undefined symbol: rtNaN
2/2 Test #2: qa_TargetDetector_cf .............***Failed    0.14 sec

50% tests passed, 1 tests failed out of 2

Total Test time (real) =   0.14 sec

The following tests FAILED:
 2 - qa_TargetDetector_cf (Failed)
Errors while running CTest




reply via email to

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