Undefined symbol on starting grc

Hi guys,

First time poster…

I wrote a block to read Matlab files, similar to the Wav file importer,
and finally got around to getting all compile errors solved. I receive
up to 50 350 MB Matlab data files per day, and would prefer to have the
format natively readable in gnuradio, so I wrote the code myself.

Only on trying to run the grc, I get the following error:

ImportError:
/usr/local/lib64/python2.6/site-packages/gnuradio/gr/_gnuradio_core_io.so:
undefined symbol: mat_size_of_type

mat_size_of_type is an extern definition of an (int) array with the
sample sizes possible in Matlab data files. It is defined in
gri_matfile.h / .cc

I’m suspecting that I have to declare some dependency somewhere else,
but can’t seem to find out where. Or, maybe it’s not possible to use
lookup tables? I’m somewhat confused that this problem only surfaces
at run-time.

John

On Mon, Feb 20, 2012 at 10:41 AM, John C. [email protected]
wrote:

lookup tables? I’m somewhat confused that this problem only surfaces
at run-time.

John

Most likely, you’ll have to declare this as a typedef inside the Swig
interface (.i) file (SWIG and C++ and search
for typedef). Generally, this is pretty painless.

Tom

On Mon, Feb 20, 2012 at 07:41, John C. [email protected] wrote:

ImportError:
/usr/local/lib64/python2.6/site-packages/gnuradio/gr/_gnuradio_core_io.so:
undefined symbol: mat_size_of_type

This sounds like the library implementing mat_size_of_type is not
getting dynamically linked in at build time, or the system cannot find
it at runtime.

Johnathan

On Mon, Feb 20, 2012 at 07:50, Johnathan C.
[email protected] wrote:

On Mon, Feb 20, 2012 at 07:41, John C. [email protected] wrote:

ImportError:
/usr/local/lib64/python2.6/site-packages/gnuradio/gr/_gnuradio_core_io.so:
undefined symbol: mat_size_of_type

This sounds like the library implementing mat_size_of_type is not
getting dynamically linked in at build time, or the system cannot find
it at runtime.

Scratch that, just reread your post. Is your gri_matfile.cc getting
added to the swig library?

Johnathan

On Tue, Feb 21, 2012 at 10:45, John C. [email protected] wrote:

What generates this error?

That comes from an error in the GRC XML wrapper for your block, and
happens when there is no section for ‘repeat’, or at
least something like that.

Johnathan

On Mon, 20 Feb 2012 07:52:33 -0800
Johnathan C. [email protected] wrote:

Scratch that, just reread your post. Is your gri_matfile.cc getting
added to the swig library?

I suspect so, but I’m not sure how to test it (is there a way to check?)

Anyway, I changed the code a little. After checking quite a few of the
the other blocks, I noticed that the gri_xxx file was never included in
the gr_xxx, which I suspect to be on purpose.

I added a method to enquire the size and that part seems so be
compiling correctly.

I now have another problem:

After successful compilation, on running, I find that xxx/top_block.py
contains the following:

            self.gr_matfile_source_1 = -------->
            cannot find 'repeat': gr.matfile_source($file, $repeat)
            <--------

which, of course, generates a syntax error. As commented before, I
copied the code from the wavfile_source code, and ‘repeat’ is still
defined in the .cc, .h files.

What generates this error?

John