Check for gr-ctrlport

Is there a recommended or preferred way an application should check
for the availability of control port? I can see some #ifdef
GR_CTRLPORT in the gnuradio headers but that is only defined while
compiling gnuradio. If there is a safe check I could perform at cmake
time I would prefer that.
Thanks in advance.

Alex

On Fri, Mar 29, 2013 at 8:12 PM, Alexandru C. [email protected]
wrote:

Is there a recommended or preferred way an application should check
for the availability of control port? I can see some #ifdef
GR_CTRLPORT in the gnuradio headers but that is only defined while
compiling gnuradio. If there is a safe check I could perform at cmake
time I would prefer that.
Thanks in advance.

Alex

Hi Alex,

Good question. This is what the config.h file is for. It’s installed
into $prefix/include/gnuradio/config.h. If ControlPort is defined and
built for the project, it will be defined in this file as “#define
GR_CTRLPORT”. If you include that header file, you can test #ifdef
GR_CTRLPORT in your own work.

Tom

On Sat, Mar 30, 2013 at 2:42 PM, Tom R. [email protected] wrote:

Hi Alex,

Good question. This is what the config.h file is for. It’s installed
into $prefix/include/gnuradio/config.h. If ControlPort is defined and
built for the project, it will be defined in this file as “#define
GR_CTRLPORT”. If you include that header file, you can test #ifdef
GR_CTRLPORT in your own work.

Hi Tom,

Thanks for the reply. This will work for me, but it seems some cmake
magic is missing from the build procedure because GR_CTRLPORT is not
defined in the config.h that I have. Here are the contents:

#ifndef GNURADIO_CONFIG_H
#define GNURADIO_CONFIG_H
#ifndef TRY_SHM_VMCIRCBUF
#define TRY_SHM_VMCIRCBUF
#endif
#ifndef GR_PERFORMANCE_COUNTERS
/* #undef GR_PERFORMANCE_COUNTERS /
#endif
#ifndef GR_CTRLPORT
/
#undef GR_CTRLPORT */
#endif
#ifndef ENABLE_GR_LOG
#define ENABLE_GR_LOG
#endif
#ifndef HAVE_LOG4CPP
#define HAVE_LOG4CPP
#endif

#endif /* GNURADIO_CONFIG_H */

The cmake step says gr-ctrlport is enabled.

Alex

On Sat, Mar 30, 2013 at 7:10 PM, [email protected] wrote:

I can confirm I had the same problem. Adding -DENABLE_GR_CTRLPORT=TRUE helped,
but it should be enabled without it also, according to the cmake log.

Tim

Sent on the Sprint Now Network from my BlackBerry

I think this has something to do with cmake caching issues.

Try deleting CMakeCache.txt, rerun cmake, and then see what you get.

Tom

On Sun, Mar 31, 2013 at 12:28 AM, Tom R. [email protected] wrote:

Actually, it looks like Tim is right. I always do fresh builds with
clean directory. If I add the -DENABLE_GR_CTRLPORT=TRUE then config.h
will contain the #define GR_CTRLPORT otherwise it will not. This works
fine for me for now.

Alex

I can confirm I had the same problem. Adding -DENABLE_GR_CTRLPORT=TRUE
helped, but it should be enabled without it also, according to the cmake
log.

Tim

Sent on the Sprint Now Network from my BlackBerry