discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: Cannot compile and build a QTGUI OOT eye_sink


From: Michael Dickens
Subject: Re: Cannot compile and build a QTGUI OOT eye_sink
Date: Fri, 8 Nov 2019 15:49:22 -0500

I'll second what Marcus wrote about your GR being out of date. Using the latest GR37 or GR38 release would be a much better way to go if you can do so.

I cloned your repo & had a heck of a time getting it to build. A few comments on the code itself first:

* when you #include a GR header, it will be "#include <gnuradio/STUFF>" .. not "#include <include/gnuradio/STUFF>" nor "#include</usr/local/include/gnuradio/STUFF>" . If you do the latter 2, your code will either require more "include_directories" paths, or just won't be portable beyond anyone using "/usr/local" for the GR install prefix.

* similarly, your local files should be found at "#include <csqtgui/STUFF>" not "#include <include/csqtgui/STUFF>".

The above said, after digging around some on both GR37 and GR38 latest, there might be an issue with the way GR is exporting class symbols in QtGui. If you're up for some hacking to test out this theory, send me a private email & I'll provide some info for your testing.

Cheers! - MLD

On Fri, Nov 8, 2019 at 9:32 AM Müller, Marcus (CEL) <address@hidden> wrote:
Hi Christophe,

it's indeed a bit surprising that in 2019, I still have to mention
that, but:

Please don't use GNU Radio 3.7.11 to develop new GNU Radio software;
Ubuntu 18.04 is a bit behind the curve on development; the current
release of the 3.7 series is 3.7.13.5, and we've really fixed a lot of
bugs since 3.7.11.
I'd recommend updating to the latest and greatest Ubuntu to at least
get that, anyways, but you can also use our Ubuntu PPA¹ for GNU Radio
3.8, that Josh thankfully set up. It would really make sense to do your
QtGUI work with GNU Radio 3.8 – that uses Qt5 (only) and hence is
future proof.
By the way, if your eye diagram sink is universally useful, I'd
certainly be very interested in you upstreaming it, but realistically,
that would only happen if developed against master (or at least maint-
3.8), not the "maintenance and legacy mode" 3.7 series.

Now, regarding your problem:

> 2- insert in this module the gnuradio C code related to the original
> time_sink; see my code on github
> https://github.com/ChristopheSeg/eye_sink


That is actually pretty much, pretty well-documented code there! I like
it!

Small correction, because relevant:

>  gnuradio C code

That's C++! And as such, it has namespaces; your trigger_mode lives in
gr::qtgui, your class lives in gr::csqtgui, and hence, just saying
"trigger_mode" doesn't point to any existing type.
What should work is using `gr::qtgui::trigger_mode` as type.
You could also add a `using gr::qtgui::trigger_mode;` to the top of
your header file, but: That requires C++11, and GNU Radio 3.7 isn't
C++11, so that might or might not work.

> .. namespace in those files
>  namespace gr {
>        namespace qtgui {
>
> all .cc files object are created , but cmake fails with a lot of
> undefined reference to : DisplayForm::, gr::block::, boost, CppUnit,
pmt....>

Yeah, so that's one source of problem down (living in the same
namespace means that `trigger_mode` now defines a known type), but you
did something I'm not sure you really want to do: put your OOT in the
same name space as an in-tree module. I'd probably avoid the confusion
and stay in your gr::csqtgui namespace, and explicitly use the
`gr::qtgui::` namespace declaration when you want to use gr::qtgui
things.

Now, after the compilation works, the linking step tries to find the
implementations of all the functions your code says it uses, and fails.

Your attempts with direct g++ invocations are a way of investigating
this, but in the end, you really want your CMake to correctly generate
makefiles that do these calls for you, so I'd recommend not even trying
to do that.

That probably means you haven't told the build system that you want to
*link* against gr-qtgui! Lemme check that in your CMakeLists.txt:

> set(GR_REQUIRED_COMPONENTS RUNTIME BLOCKS QTGUI PMT VOLK)

That's good, you're linking against qtgui; sure you want to link
against blocks?
Anyway, let us check lib/CMakeLists.txt:

> target_link_libraries(gnuradio-csqtgui ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES})

Hm, that looks good!

Can you actually do the following:

1. Make a clean build/ directory,
2. run `cmake .. > /tmp/log_cmake` from there; make sure there's no
errors!
3. run `make VERBOSE=1 > /tmp/log_make` after
4. share the two files in /tmp/ with us (gist.github.com or fpaste.org
or so)

Best regards,
Marcus

¹ that can be done via
sudo add-apt-repository ppa:gnuradio/gnuradio-releases
sudo apt-get update
On Fri, 2019-11-08 at 14:38 +0100, Christophe Seguinot wrote:
> Dear all
>
> I working under ubuntu 18.04 and GNURadio 3.7.11 and attempt to define a
> QTGUI eye_sink block to display eye pattern under gnuradio-companion.
> Without any knowledge of the best method to achieve this, I decided to:
> 1- define a new OOT module using gr_modtool
>      gr_modtool newmod csqtgui
>      cd gr-csqtgui/
>      gr_modtool add -t sink -l cpp eye_sink_c
>      gr_modtool add -t sink -l cpp eye_sink_f
> 2- insert in this module the gnuradio C code related to the original
> time_sink
>      see my code on github https://github.com/ChristopheSeg/eye_sink
> 3- try to compile and install this OOT (at this step it should be a
> duplicate of the time-sink block)
>      mdkir build
>      cd build
>      cmake ../
>      qmake ../
>      make
> 4- modify oot code to implement an eye-pattern plot
>
> But I'm stuck at step 3, unable to compile my OOT. (I succesfully tested
> the square_ff OOT module proposed in OOT tutorial 2)
>
> if I use csqtgui namespace in files eye_sinc_*.h eye_sink_*_impl.cc
> eye_sink_*_impl.h: no .o object file are generated
>      namespace gr {
>        namespace csqtgui {
>
> the error is than
>   In file included from ../lib/eye_sink_c_impl.h:25:0,
>                   from ../lib/eye_sink_c_impl.cc:26:
> ../../gr-csqtgui/include/csqtgui/eye_sink_c.h:145:37: error:
> ‘trigger_mode’ has not been declared
>         virtual void set_trigger_mode(trigger_mode mode, trigger_slope
> slope,
>
> When using sqtgui namespace in those files
>
>     namespace gr {
>        namespace qtgui {
>
> all .cc files object are created , but cmake fails with a lot of
> undefined reference to : DisplayForm::, gr::block::, boost, CppUnit, pmt....
>
> the error is than
>
> g++ -m64 -Wl,-O1 -o gr-csqtgui eye_sink_c_impl.o eye_sink_f_impl.o
> qa_csqtgui.o qa_eye_sink_c.o qa_eye_sink_f.o test_csqtgui.o   
> -L/usr/lib/x86_64-linux-gnu -lQtDeclarative -lQtGui -lQtCore -lpthread
> eye_sink_c_impl.o: In function
> `gr::qtgui::eye_sink_c_impl::set_update_time(double)':
> eye_sink_c_impl.cc:(.text+0xc4): undefined reference to
> `DisplayForm::setUpdateTime(double)'
>
> I already modified my CMakelists.txt to include corresponding libraries
> without any success
>      set(GR_REQUIRED_COMPONENTS RUNTIME BLOCKS QTGUI PMT VOLK)
>      find_package(Gnuradio "3.7.2" REQUIRED)
>
> I tried to add -lgnuradio-blocks -lgnuradio-runtime -lgnuradio-qtgui
> -lgnuradio-pmt in the last g++ command for testing but get the same errors
>
> I didn't find any usefull help in GNURadio OOT pages, nor in other OOT
> modules published on CGRAN.
> Who could please tell me what is wrong in my method?
>
> Regards, Christophe
>
>


--
Michael Dickens
Ettus Research Technical Support
Email: address@hidden
Web: https://ettus.com/

reply via email to

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