GNU Radio & GSL

Hi!
I’m trying to do a block for GRC, using some functions availables in
GSL.
First, I put a example within work function including “#include
<gsl/gsl_sf_bessel.h>”


int
ocupacion_correlator::general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
float x = 5.0;
float y = gsl_sf_bessel_J0 (x);
printf (“J0(%g) = %.18e\n”, x, y);
out[0]=y;
out[1]=x;

// Tell runtime system how many input items we consumed on
// each input stream.
consume_each (noutput_items);

// Tell runtime system how many output items we produced.
return noutput_items;
}


During the exection of cmake, make and make install, I didn’t have any
problem. But, when I execute the flow graph in GRC this error appears:


Traceback (most recent call last):
File “/home/xuan/Documents/GRC
generados/probando_correlator_gsl/top_block.py”, line 14, in
import ocupacion
File “/usr/local/lib/python2.7/dist-packages/ocupacion/init.py”,
line 45, in
from ocupacion_swig import *
File
“/usr/local/lib/python2.7/dist-packages/ocupacion/ocupacion_swig.py”,
line 26, in
_ocupacion_swig = swig_import_helper()
File
“/usr/local/lib/python2.7/dist-packages/ocupacion/ocupacion_swig.py”,
line 22, in swig_import_helper
_mod = imp.load_module(’_ocupacion_swig’, fp, pathname, description)
ImportError: /usr/local/lib/libgnuradio-ocupacion.so: undefined symbol:
gsl_sf_bessel_J0


I think I have to make some change on Makefile or a PATH, but I don’t
know how. I installed gsl-bin and libgsl0ldbl packets.

Best Regards.

Adriana A.

On 11/14/2012 01:59 PM, Zing Yu wrote:

Below link might be helpful to you:
http://www.ruby-forum.com/topic/4407135#new

gr-wavelet is a good example for this as well.

-josh

Below link might be helpful to you:
http://www.ruby-forum.com/topic/4407135#new


From: Adriana A. [email protected]
To: “[email protected][email protected]
Sent: Wednesday, November 14, 2012 3:56 PM
Subject: [Discuss-gnuradio] GNU Radio & GSL

Hi!

I’m trying to do a block for GRC, using some functions availables in
GSL.
First, I put a example within work function including “#include
<gsl/gsl_sf_bessel.h>”


int
ocupacion_correlator::general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
float x = 5.0;
float y = gsl_sf_bessel_J0 (x);
printf (“J0(%g) = %.18e\n”, x, y);
out[0]=y;
out[1]=x;

// Tell runtime system how many input items we consumed on
// each input stream.
consume_each (noutput_items);

// Tell runtime system how many output items we produced.
return noutput_items;
}


During the exection of cmake, make and make install, I didn’t have any
problem. But, when I execute the flow graph in GRC this error appears:


Traceback (most recent call last):
File “/home/xuan/Documents/GRC
generados/probando_correlator_gsl/top_block.py”, line 14, in
import ocupacion
File “/usr/local/lib/python2.7/dist-packages/ocupacion/init.py”,
line 45, in
from ocupacion_swig import *
File
“/usr/local/lib/python2.7/dist-packages/ocupacion/ocupacion_swig.py”,
line 26, in
_ocupacion_swig = swig_import_helper()
File
“/usr/local/lib/python2.7/dist-packages/ocupacion/ocupacion_swig.py”,
line 22, in swig_import_helper
_mod = imp.load_module(’_ocupacion_swig’, fp, pathname, description)
ImportError: /usr/local/lib/libgnuradio-ocupacion.so: undefined symbol:
gsl_sf_bessel_J0


I think I have to make some change on Makefile or a PATH, but I don’t
know how. I installed gsl-bin and libgsl0ldbl packets.

Best Regards.

Adriana A.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs