discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Swig and python import problem due to other out-o


From: Jeon
Subject: Re: [Discuss-gnuradio] Swig and python import problem due to other out-of-tree modules used in my out-of-tree module
Date: Wed, 1 Apr 2015 15:29:36 +0900

Dear, Marcus.

Struggling for this, but still the problem is not solved.

AND ONE THING I'VE FOUND IS:

    >>> import dvbt
    >>> dir(dvbt)

There are no reed_solomon, reed_solomon_make, reed_solomon_sptr, reed_solomon_sptr_swigregister and reed_solomon_swigregister. But, there are reed_solomon_end_XX and reed_solomon_dec_XX. (XX is _make, _sptr things)
Do you think this has something to do with my probelm? I think there is no reed_solomon_(...) module, thus I can't use gr:dvbt::reed_solomon in MYMODULE.
Can it be solved if I modify gr-dvbt to have _make, _sptr, _swigregister things? But, I wonder if it is a good way to modify other's sources. On the contrary, it might be good if I can contribute to the gr-dvbt sources.

Or is it irrelevant with my problem?
Anyway, I'll try what I am thinking til some respones recevied.

Regards,
Jeon.

2015-03-31 23:50 GMT+09:00 Marcus Müller <address@hidden>:
Hi Jeon,

This looks very proper, but since gr-dvbt doesn't supply a pkgconfig (.pc) file, you can't use pkg_check_modules; the raw find_library call you use should work, though.

also, you set DVBT_LIBRARY, so you'll have to use
target_link_libraries(gnuradio-mymodule ${DVBT_LIBRARY})
(notice the singular LIBRARY).

Greetings,
Marcus

On 03/31/2015 04:37 PM, Jeon wrote:
Dear, Marcus.

Thanks, it's very helpful. But, stil somethings unresolved.

What I've done is:

In CMakeLists.txt of root:

    find_package(DVBT)
    if (NOT DVBT_FOUND) /* ommited */ endif()
    include_directories(
        /* omitted */
        ${DVBT_INCLUDE_DIR}
    )

Add cmake/Modules/[FindDVBT.cmake](https://gist.github.com/gsongsong/49ec2cf84d7907c7ceb0). It's quite long.
And I found that shared object (so) is libgnuradio-dvbt.so.

In lib/CMakeLists.txt:

    target_link_libraries(gnuradio-mymodule ${DVBT_LIBRARIES})

A result of build and installation is:

    pkg_check_modules(PC_DVBT gnuradio-dvbt): returns package 'gnuradio-dvbt' not found

Although I've changed gnuradio-dvbt to gr-dvbt, dvbt gnuradio_dvbt, gr_dvbt, libgnuradio-dvbt and other possible combinations, nothings different.

But DVBT_LIBRARY returns /usr/local/lib/libgnuradio-dvbt.so and DVBT_INCLUDE_DIR returns /usr/local/include.
I think this part is correct.

And in python:

    >>> import mymodule
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/lib/python2.7/dist-packages/myOOTmodule/__init__.py", line 51, in <module>
        from myOOTmodule_swig import *
      File "/usr/local/lib/python2.7/dist-packages/myOOTmodule/myOOTmodule_swig.py", line 28, in <module>
        _myOOTmodule_swig = swig_import_helper()
      File "/usr/local/lib/python2.7/dist-packages/myOOTmodule/myOOTmodule_swig.py", line 24, in swig_import_helper
        _mod = imp.load_module('_myOOTmodule_swig', fp, pathname, description)
    ImportError: /usr/local/lib/libgnuradio-myOOTmodule.so: undefined symbol: _ZN2gr4dvbt12reed_solomonC1Eiiiiiiii

It is the same as the previous.

.........

After some googling and searching, I found that gr-dvbt is not present in 'pkg-config --list-all'.
I think it would be a bit relevant to this problem.
If it is the case, I'd better think to use IT++ Reed Solomon.

I'll let you know if I have further progress.

Regards,
Jeon.

   

2015-03-31 18:32 GMT+09:00 Marcus Müller <address@hidden>:
Hi Jeon,

typically, you'd call a FindSomething function in the root CMakeList

  find_library(GR_DVBT_LIBRARY
    NAMES
      gnuradio-dvbt
    PATHS
      /usr/lib
      /usr/local/lib
      /opt/local/lib
      /sw/lib
  )
or so. I guess "gnuradio-dvbt.so" should be the name of the installed
gr-dvbt library -- please verify that this is correct.

Then add  the resulting library name to the target_link_libraries
directive in lib/CMakeList.txt:

target_link_libraries(<project_name> ${Boost_LIBRARIES}
${GNURADIO_ALL_LIBRARIES} ${GR_DVBT_LIBRARY})
and
target_link_libraries(test-<project_name> ${Boost_LIBRARIES}
${GNURADIO_ALL_LIBRARIES} ${GR_DVBT_LIBRARY} <project_name>)

How is CMake able to find the headers you need to compile your module?
If you have written functionality to detect these headers, you can
probably do the same for the compiled gr-dvbt libraries.

Greetings,
Marcus



On 03/31/2015 08:11 AM, Jeon wrote:
>
> Or maybe I can handle it if you give me some details about CMakeLists.
> As you know, there are a number of CmakeLists in the project. Can it
> be done by modifying and fixing CMakeLists.txt under swig, python or
> project root directory?


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



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


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