Comedilib question

Hi all,

I have started to build the gnuradio package and encountered a problem
relating to comedilib, in the gnuradio file “comedi_sink_s.cc” the call

ret = comedi_get_cmd_generic_timed(d_dev,d_subdevice,&cmd,(unsigned
int)(1e9/sampling_freq));

exist. However, in comedilib-0.8.1 the header file “comedilib.h” the
following definition occurs

int comedi_get_cmd_generic_timed(comedi_t *dev,unsigned int subdevice,
comedi_cmd *cmd, unsigned chanlist_len, unsigned
scan_period_ns);

It appears as if the version of comedilib is important to build, can
someone comment on this? (I think comedilib 0.7.18 will use four
arguments)
Below are some outputs from my build:

/bin/sh …/…/libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I.
-I…/… -DOMNITHREAD_POSIX=1 -I/tmp/gnuradio/gnuradio-3.1.2/omnithread
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/runtime
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/general
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/general
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/gengen
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/gengen
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/filter
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/filter
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/reed-solomon
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/io
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/g72x
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/swig
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/swig
-I/usr/local/include -I/usr/include/boost/
-I/usr/local/include/python2.5 -g -O2 -Wall -Woverloaded-virtual
-pthread -MT comedi_sink_s.lo -MD -MP -MF .deps/comedi_sink_s.Tpo -c -o
comedi_sink_s.lo comedi_sink_s.cc
g++ -DHAVE_CONFIG_H -I. -I…/… -DOMNITHREAD_POSIX=1
-I/tmp/gnuradio/gnuradio-3.1.2/omnithread
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/runtime
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/general
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/general
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/gengen
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/gengen
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/filter
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/filter
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/reed-solomon
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/io
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/g72x
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/swig
-I/tmp/gnuradio/gnuradio-3.1.2/gnuradio-core/src/lib/swig
-I/usr/local/include -I/usr/include/boost/
-I/usr/local/include/python2.5 -g -O2 -Wall -Woverloaded-virtual
-pthread -MT comedi_sink_s.lo -MD -MP -MF .deps/comedi_sink_s.Tpo -c
comedi_sink_s.cc -fPIC -DPIC -o .libs/comedi_sink_s.o
/usr/local/include/comedilib.h: In constructor
comedi_sink_s::comedi_sink_s(int, std::string)': /usr/local/include/comedilib.h:167: error: too few arguments to functionint comedi_get_cmd_generic_timed(comedi_t*, unsigned int, comedi_cmd*,
unsigned int, unsigned int)’
comedi_sink_s.cc:91: error: at this point in file
make[4]: *** [comedi_sink_s.lo] Error 1
make[4]: Leaving directory /tmp/gnuradio/gnuradio-3.1.2/gr-comedi/src' make[3]: *** [all] Error 2 make[3]: Leaving directory/tmp/gnuradio/gnuradio-3.1.2/gr-comedi/src’
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory /tmp/gnuradio/gnuradio-3.1.2/gr-comedi' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/tmp/gnuradio/gnuradio-3.1.2’

Hi,

I’m totally new to gnuradio… i installed gnuradio via fedora 6 and the
installation was successful. however, i get the ImportError when i tried
to run a program. Below are the exact codes i typed.

[root@localhost ~]# cd gnuradio-3.1.2/gnuradio-examples/python/usrp
[root@localhost usrp]# python usrp_spectrum_sense.py
Traceback (most recent call last):
File “usrp_spectrum_sense.py”, line 23, in?
from gnuradio import gr, gru, eng_notation, optfir, window
ImportError: No module named gnuradio

I did try to search for possible solutions but i really don’t understand
how should i do it as in the codes to type as i’m really totally new to
this. can anyone please help me with this?

really appreciate it!

joreen

Joreen T. wrote:

ImportError: No module named gnuradio

I did try to search for possible solutions but i really don’t understand
how should i do it as in the codes to type as i’m really totally new to
this. can anyone please help me with this?

This problem has to do with the python interpreter not being able to
find
where certain gnu radio files were installed. You can fix this by
creating a
file that points python in the right direction. To do this you can run
these
commands:

su
echo “/usr/local/lib/python2.4/site-packages” | tee
/usr/lib/python2.4/site-packages/gnuradio.pth
exit

This might change depending on your python installation. The first
directory
is the location of gnu radio’s python files, the second is a location
where
python already looks for files.

View this message in context:
http://www.nabble.com/comedilib-question-tp18958726p18970529.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Wed, Aug 13, 2008 at 1:08 AM, Ulf Lindgren A
[email protected] wrote:

I have started to build the gnuradio package and encountered a problem
relating to comedilib, in the gnuradio file “comedi_sink_s.cc” the call

It appears that an incompatible API change between comedilib 0.7 and
0.8 breaks the gr-comedi component.

Please file a bug in the GNU Radio tracker. What system are you
running that now has 0.8 installed?

gr-comedi was originally written and last updated in 2005, and doesn’t
currently have a maintainer. Would you be willing to work on a fix,
with some email guidance from myself and Eric?


Johnathan C.
Corgan Enterprises LLC
http://corganenterprises.com/

see http://gnuradio.org/trac/wiki/FedoraInstall

perhaps your python path does not include the gnuradio install


FC5 and later ¶

x86 (32-bit) systems:

export PYTHONPATH=/usr/local/lib/python2.4/site-packages

X86-64 systems:

export PYTHONPATH=/usr/local/lib64/python2.4/site-packages

-Josh

On Fri, Aug 22, 2008 at 2:00 AM, Ulf Lindgren A
[email protected] wrote:

I have made a fix for the change in comedilib.

Thanks for the update.

We’ll have to figure out a way to conditionalize the code between the
two libcomedi versions so the component works for either one. Since
you are the only one who has reported this, and you’ve figured out an
workaround, this will likely go on the back burner until we start
cleaning up for the final push to release 3.2.


Johnathan C.
Corgan Enterprises LLC
http://corganenterprises.com/

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Aug 25, 2008, at 10:37 AM, Johnathan C. wrote:

workaround, this will likely go on the back burner until we start
cleaning up for the final push to release 3.2.

On this note, but slightly tangential, there are a bunch of third
party gnuradio plugins that are not being kept up to date and even no
longer work with gnuradio without significant changes. (E.g., top
block vs flow graph). Do you think we can create space in SVN
somewhere for the updated versions of these codes? I’m thinking about
gr-ucla and maybe the BBN 802.11 stuff as well.

  • -Dan
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkiy71AACgkQy9GYuuMoUJ4nIwCgqJ8+ON82GOutoHYdokz8tqQh
+HYAn0kAZIoCaGmPkpPBiHKwlaiXLB9o
=xva5
-----END PGP SIGNATURE-----

Hi,

I have made a fix for the change in comedilib. The fix is as follows,
the struct cmd in comedilib has been extended with the variable
chanlist_len (in version 0.8) and it is this variable that is missing in
the calls to “comedi_get_cmd_generic_timed” made in the files
gr-comedi/src/comedi_source_s.cc and gr-comedi/src/comedi_sink_s.cc.

The current call in comedi_source_s.cc is:
ret =
comedi_get_cmd_generic_timed(d_dev,d_subdevice,&cmd,(unsigned
int)(1e9/sampling_freq));
fix
ret =
comedi_get_cmd_generic_timed(d_dev,d_subdevice,&cmd,cmd.chanlist_len,(un
signed int)(1e9/sampling_freq));

and the current call in comedi_sink_s.cc is
ret =
comedi_get_cmd_generic_timed(d_dev,d_subdevice,&cmd,(unsigned
int)(1e9/sampling_freq));
fix
ret =
comedi_get_cmd_generic_timed(d_dev,d_subdevice,&cmd,cmd.chanlist_len,(un
signed int)(1e9/sampling_freq));

/Ulf

is it working now ?

jagdish

Ulf Lindgren A wrote in post #718095:

Hi,

I have made a fix for the change in comedilib. The fix is as follows,
the struct cmd in comedilib has been extended with the variable
chanlist_len (in version 0.8) and it is this variable that is missing in
the calls to “comedi_get_cmd_generic_timed” made in the files
gr-comedi/src/comedi_source_s.cc and gr-comedi/src/comedi_sink_s.cc.

The current call in comedi_source_s.cc is:
ret =
comedi_get_cmd_generic_timed(d_dev,d_subdevice,&cmd,(unsigned
int)(1e9/sampling_freq));
fix
ret =
comedi_get_cmd_generic_timed(d_dev,d_subdevice,&cmd,cmd.chanlist_len,(un
signed int)(1e9/sampling_freq));

and the current call in comedi_sink_s.cc is
ret =
comedi_get_cmd_generic_timed(d_dev,d_subdevice,&cmd,(unsigned
int)(1e9/sampling_freq));
fix
ret =
comedi_get_cmd_generic_timed(d_dev,d_subdevice,&cmd,cmd.chanlist_len,(un
signed int)(1e9/sampling_freq));

/Ulf

is it working now ?
because i am also working gnuradio-comedi…