discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Problem with OOT module import


From: vamsi krishna
Subject: Re: [Discuss-gnuradio] Problem with OOT module import
Date: Fri, 11 Sep 2015 21:44:37 +0000 (UTC)

Hi Michael, 
Thank you for looking into the issue.
I'm working with Richard on this, and we found out the issue with the linking the external ".so" files to OOT module.

There are three extra steps which must be followed along with general OOT workflow.

1) Have header file, which acts as interface to .so functions, inside the 
<path to OOT module>/lib folder.

2) Header file should be included the impl.h or impl.c (depending on where you would need it) using it
Generally,
include "xxxxxxxx.h"
in case you are using C language interface,
extern "c"{
include "xxxxxxxx.h"
}

3) Tell the "ld" command of about the ".so" to be linked.
Add this in the <path to OOT module>/lib/CMakeLists.txt
target_link_libraries(gnuradio-<OOT Module Name> package)
Note: this will help the ld command to have additional configuration as "-lpackage", i.e, it is looking for "libpackage.so" in its search path.

Have a nice weekend.

Vamsi



On Friday, 11 September 2015 10:06 AM, Michael Dickens <address@hidden> wrote:


Hi Richard - Glad you got the runtime part worked out for your OOT
block. CMake has its good and bad moments ...

As for the why the QA code fails, since you're on Linux do you need
to set the LD_LIBRARY_PATH somewhere? I know on OSX we have to "make
install" before doing "make test" because the library paths are
messed up otherwise (NB: I'm working on a fix; just takes time to get
done & tested).

Another question: When you execute "make test" does the QA code get
executed (and then fails), or is it skipped over?

- MLD

On Thu, Sep 10, 2015, at 04:27 PM, Richard Bell wrote:
> I figured out what part of the problem was. I added a few OOT blocks
> (gr_modtool add block1, block2, etc..) to my module and wrote the code
> for one of them, with the other two in default gr_modtool created
> states. I wanted to compile and test each one at a time, so I thought
> I could just comment out the other ones in CMakeLists.txt like this:
>
> list(APPEND my_block_sources    #my_block_source1_impl.cc
> my_block_source2_impl.cc <-- only this gets compiled )
>
> You cannot do this. Once I uncommented the other blocks in the
> CMakeLists.txt file, the block I was testing runs in grc. However, I
> still cannot run my qa python code for the block without the import
> error related to swig. I cd to the python folder of my OOT module and
> do the following
> >> python qa_my_block.py
>
> Traceback (most recent call last):  File "qa_my_block.py", line 24, in
> <module>    import my_block_swig as my_block ImportError: No module
> named my_block_*swig*
>
> I've tried removing the build directory and recreating it. No luck.
> Any suggestions?

_______________________________________________
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]