RTAI 3.8.1 + Comedi 0.7.76 + Ubuntu 10.04: Comedi doesn't compile

290 views
Skip to first unread message

Alex

unread,
Aug 4, 2010, 5:46:24 AM8/4/10
to Comedi: Linux Control and Measurement Device Interface
Hi,

I compiled a 2.6.32.11 kernel with RTAI 3.8.1 patch to an Ubuntu 10.04
distribution. I now want to add comedi install and I'm getting into
trouble when running "make" on comedi.

For the fast readers:
My questions are:
1. How do I get the comedi source to compile under Ubuntu 10.04 with
RTAI support?
2. Which module is responsible to deliver the symbol/function
comedi_switch_to_rt? Did I forget to insert or compile a module?


In more detail:

I did a
./configure --with-linuxdir=/usr/src/linux --with-rtaidir=/usr/
realtime
which worked without errors.

Running the make command, I'm getting into trouble:

/usr/src/comedi# make
(snip)
In file included from /usr/src/comedi/include/linux/mutex.h:41,
from include/linux/fs.h:379,
from /usr/src/comedi/comedi/comedi_compat32.h:31,
from /usr/src/comedi/comedi/comedi_fops.c:28:
/usr/src/comedi/include/asm/semaphore.h:18:32: error: asm/semaphore.h:
No such file or directory

In file included from /usr/src/comedi/include/linux/comedidev.h:41,
from /usr/src/comedi/comedi/comedi_fops.c:45:
/usr/src/comedi/include/linux/interrupt.h:27: error: conflicting types
for ‘irqreturn_t’

include/linux/irqreturn.h:16: note: previous declaration of
‘irqreturn_t’ was here
In file included from /usr/src/comedi/include/linux/comedidev.h:41,
from /usr/src/comedi/comedi/comedi_fops.c:45:
/usr/src/comedi/include/linux/interrupt.h:30:1: warning: "IRQ_RETVAL"
redefined

In file included from include/linux/interrupt.h:10,
from /usr/src/comedi/include/linux/interrupt.h:22,
from /usr/src/comedi/include/linux/comedidev.h:41,
from /usr/src/comedi/comedi/comedi_fops.c:45:
include/linux/irqreturn.h:17:1: warning: this is the location of the
previous definition

/usr/src/comedi/comedi/comedi_fops.c: In function ‘comedi_init’:
/usr/src/comedi/comedi/comedi_fops.c:1918: error: implicit declaration
of function ‘class_device_create’

/usr/src/comedi/comedi/comedi_fops.c:1918: warning: assignment makes
pointer from integer without a cast
(snip)

I read the entry from Jeff (9. June 2010, "Failed to build on linux-rt
in Ubuntu 10.04"). Ian suggested to use the linux-rt-package. This
seemed to solve Jeff's problem. My problem is that I need a kcomedilib
which is working with rtai, not LINUX_PREEMPT_RT.

Before compiling comedi myself I tried to use the packages included
with Ubuntu 10.04 (libcomedi-dev, libcomedi0 and comedi-source). I
compiled the comedi source, which worked without a problem. But I got
an error on inserting the kcomedilib module:

insmod kcomedilib
(...)
// cat dmesg | grep kcomedilib says:
kcomedilib: Unknown symbol comedi_switch_to_rt
kcomedilib: Unknown symbol comedi_switch_to_non_rt

So, my questions are:
1. How do I get the comedi source to compile under Ubuntu 10.04 with
RTAI support?
2. Which module is responsible to deliver the symbol/function
comedi_switch_to_rt? Did I forget to insert or compile a module?

Thanks in advance,
Alex

Dieter Wirz

unread,
Aug 4, 2010, 6:09:36 AM8/4/10
to comed...@googlegroups.com
Hi Alex -
Comedi 0.7.76 is dated from 28-Jan-2008 16:23. Therefore Kernel
2.6.32.11 (dated from 01-Apr-2010) is not supported.
Please use Comedi from CVS or the CVS snapshot.

Hope that helps
Dieter

> --
> You received this message because you are subscribed to the Google Groups "Comedi: Linux Control and Measurement Device Interface" group.
> To post to this group, send email to comed...@googlegroups.com.
> To unsubscribe from this group, send email to comedi_list...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/comedi_list?hl=en.
>
>

Alex

unread,
Aug 4, 2010, 9:11:16 AM8/4/10
to Comedi: Linux Control and Measurement Device Interface
Hello Dieter,

thank you very much for your fast response! It's working now.

I had to do the following:
- Loaded comedi and comedilib from CVS-Snapshot
- Installed flexx and bison (yacc) via apt/synaptic for compiling
comedilib
- autogen.sh, configure, make, make install for comedilib and then for
comedi.
- After restarting the box it didn't work. In dmesg I saw some entries
saying that still the old
drivers were being loaded (saying something like "staging drivers
loaded - you have been warned").
- I had to stop the old drivers from getting started. I looked into /
lib/modules/<version>/modules.dep.
Here only the old drivers were listed. depmod- a didn't change the
situation.
- I moved the directory with the old drivers out of the /lib/module-
directory and did a depmod -a
After that the new drivers were listed in modules.dep.
- Reboot.
- After loading the driver for out National-Instruments-Card and
insmodding the RTAI-modules
everything worked fine.

Thanks!
Alex

On 4 Aug., 12:09, Dieter Wirz <didi.w...@gmail.com> wrote:
> Hi Alex -
> Comedi 0.7.76 is dated from 28-Jan-2008 16:23. Therefore Kernel
> 2.6.32.11 (dated from 01-Apr-2010) is not supported.
> Please use Comedi from CVS or the CVS snapshot.
>
> Hope that helps
> Dieter
>

Ian Abbott

unread,
Aug 4, 2010, 12:25:39 PM8/4/10
to comed...@googlegroups.com
Hi Alex,

On 04/08/10 14:11, Alex wrote:
> Hello Dieter,
>
> thank you very much for your fast response! It's working now.
>
> I had to do the following:
> - Loaded comedi and comedilib from CVS-Snapshot
> - Installed flexx and bison (yacc) via apt/synaptic for compiling
> comedilib
> - autogen.sh, configure, make, make install for comedilib and then for
> comedi.
> - After restarting the box it didn't work. In dmesg I saw some entries
> saying that still the old
> drivers were being loaded (saying something like "staging drivers
> loaded - you have been warned").
> - I had to stop the old drivers from getting started. I looked into /
> lib/modules/<version>/modules.dep.
> Here only the old drivers were listed. depmod- a didn't change the
> situation.
> - I moved the directory with the old drivers out of the /lib/module-
> directory and did a depmod -a
> After that the new drivers were listed in modules.dep.

Since you're compiling your own kernel with RTAI support, you might want
to reconfigure the kernel to avoid building the "staging" Comedi
drivers. Then you wouldn't need to move them out of
/lib/modules/$(uname -r)/kernel/drivers/staging/comedi/ as they wouldn't
be built in the first place! (I'm assuming you built the kernel to use
a different `uname -r` value than the normal Ubuntu kernel to avoid
clashes.)

> - Reboot.
> - After loading the driver for out National-Instruments-Card and
> insmodding the RTAI-modules
> everything worked fine.

Great!

[gripe]One thing I hate about RTAI is the default location for the
modules (/usr/realtime/modules) and no way to change it in the
configuration menu. It is possible to configure it to use a more
sensible location using the ./configure script though. The default is
both outside the modutils search path and only usable with a kernel
version.[/gripe]

--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-

Dieter Wirz

unread,
Aug 4, 2010, 2:43:43 PM8/4/10
to comed...@googlegroups.com
Hi Ian -
Every now and then a new, potential comedy user tries to compile
comedi 0.7.76 against an actual kernel and finally writes a desperate
Email to comedi-list.

It might clarify a lot if on "http://www.comedi.org/download.html" a
line could be added similar to:
"The recommended way to install COMEDI and COMEDILIB is to compile
from current SVN source."
And change
"HTTP: http://www.comedi.org/download"
to
"HTTP: Obsolete Versions"

Thanks for considering!
Dieter

BTW: Many thanks for your and FMH's efforts. comedi is great!

Alex

unread,
Aug 6, 2010, 4:33:58 AM8/6/10
to Comedi: Linux Control and Measurement Device Interface
Hi Ian and Dieter,

I agree to Dieter's point with the "obsolete versions" links. Would be
best to link the CVS-snapshot as the "current version" or so.

I'm not a new user of Comedi. So if I run into trouble, newbies will
do that for sure! We are using Comedi here since 2006 (and that was
the last time I set up an RTAI-machine) for force control of robots.

Thanks again,
Alex

On 4 Aug., 20:43, Dieter Wirz <didi.w...@gmail.com> wrote:
> Hi Ian -
> Every now and then a new, potential comedy user tries to compile
> comedi 0.7.76 against an actual kernel and finally writes a desperate
> Email to comedi-list.
>
> It might clarify a lot if on "http://www.comedi.org/download.html" a
> line could be added similar to:
> "The recommended way to install COMEDI and COMEDILIB is to compile
> from current SVN source."
> And change
> "HTTP:http://www.comedi.org/download"
> to
> "HTTP: Obsolete Versions"
>
> Thanks for considering!
> Dieter
>
> BTW: Many thanks for your and FMH's efforts. comedi is great!
>
> > -=( Ian Abbott @ MEV Ltd.    E-mail: <abbo...@mev.co.uk>        )=-

Ian Abbott

unread,
Aug 6, 2010, 7:11:34 AM8/6/10
to comed...@googlegroups.com

I've updated the download page a bit to recommend using the CVS version,
and also mentioned the kernel "staging" stuff.

I haven't added any text about the "Linux-Comedi Git repository" linked
to on that page as I don't know how up-to-date it is.

--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-

Reply all
Reply to author
Forward
0 new messages