Pkg-config cflags for gnuradio-uhd

Greetings,

Lets say I am trying to compile a C++ application that uses
gnuradio-core
and gnuradio-uhd. I have gnuradio installed in
/opt/gnuradio/some-version
and uhd installed in /opt/uhd/some-version - both of these paths are
within
pkg-config reach. The problem is if I do:

pkg-config --cflags gnuradio-core gnuradio-uhd

I get:
-I/opt/gnuradio/3.6.0/include/gnuradio -I/opt/gnuradio/3.6.0/include

which does not include where the UHD headers are located. Consequently,
compilation will fail with:
/opt/gnuradio/3.6.0/include/gnuradio/gr_uhd_api.h:25:26: fatal error:
uhd/config.hpp: No such file or directory

In this simple case I could just include uhd as dependency but is it
really
what I am supposed to do or should gnuradio-uhd pull it in
automatically?
Also note that the same happens with --ldflags:

pkg-config --libs gnuradio-core gnuradio-uhd
-L/opt/gnuradio/3.6.0/lib -lgnuradio-uhd -lgnuradio-core -lgruel
-lfftw3f
-lm

My real problem is that I am trying to build gr-osmosdr from
http://cgit.osmocom.org/cgit/gr-osmosdr/ which checks for gnuradio-uhd
but
not for uhd itself and therefore cmake will not include the UHD paths.

Thanks in advance.

Alex

On 05/12/2012 04:42 AM, Alexandru C. wrote:

Greetings,

Lets say I am trying to compile a C++ application that uses gnuradio-core
and gnuradio-uhd. I have gnuradio installed in /opt/gnuradio/some-version
and uhd installed in /opt/uhd/some-version - both of these paths are within
pkg-config reach. The problem is if I do:

pkg-config --cflags gnuradio-core gnuradio-uhd

Just add uhd to the list of pkg config dependencies.
Does it work?

-josh

On Sat, May 12, 2012 at 7:41 PM, Josh B. [email protected] wrote:

pkg-config --cflags gnuradio-core gnuradio-uhd

Just add uhd to the list of pkg config dependencies.
Does it work?

Yes, that works for the pkg-config part, but not when compiling
gr-osmosdr using cmake. I guess we can also include uhd as dependency
in the gr-osmosdr cmake files, but I’m curious if that is the right
way to do it?

Alex

On Sat, May 12, 2012 at 9:26 PM, Josh B. [email protected] wrote:

and uhd installed in /opt/uhd/some-version - both of these paths are within
in the gr-osmosdr cmake files, but I’m curious if that is the right
way to do it?

Probably since gr-uhd public headers expose stuff in uhd public headers.
You might as well grab FindUHD.cmake from gnuradio and copy it into
gr-osmosdr cmake source tree.

Thanks for the tip.
UHD has now been added as dependency and it compiles fine now.

Alex

On 05/12/2012 11:10 AM, Alexandru C. wrote:

Probably since gr-uhd public headers expose stuff in uhd public headers.
You might as well grab FindUHD.cmake from gnuradio and copy it into
gr-osmosdr cmake source tree.

-Josh