Successful install of Comedi on Scientific Linux 6.1

131 views
Skip to first unread message

James

unread,
May 30, 2012, 10:13:20 PM5/30/12
to Comedi: Linux Control and Measurement Device Interface
Our research group uses Scientific Linux 6.1 (based on RedHat), and we
are using the National Instruments PCI-6229 card.

We got Comedi working on SL6.1 and given that RedHat is not officially
supported (and much online documentation on the subject is from many
years back), I figured other folks might benefit from our experience.

On SL6.1, comedi *almost* compiles "out of the box." Only one
modification is required (see below). For reference, here is some
info on my system:

> uname -a
Linux nest 2.6.32-131.0.15.el6.x86_64 #1 SMP Sat May 21 10:27:57 CDT
2011 x86_64 x86_64 x86_64 GNU/Linux
> cat /etc/redhat-release
Scientific Linux release 6.1 (Carbon)

I downloaded the Comedi source from git then untar and enter the
directory

> tar xvzf comedi-HEAD-c40b2f5.tar.gz
> cd comedi-HEAD-c40b2f5

Next, run autogen.sh to generate a configure file, and then run
configure (with no options)
> ./autogen.sh
> ./configure

If you then run make, it will fail, with an error in comedi-HEAD-
c40b2f5/include/linux/firmware.h where it was calling a kernel
function with the wrong number of parameters.

So the only modification that is needed is to modify one line in:
comedi-HEAD-c40b2f5/include/linux/firmware.h
Change line 11 from:
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
to:
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)

Although the kernel used in SL6.1 is 2.6.32, as the comedi
documentation specifies RHEL heavily modifies the kernels and it's
likely that the requisite change here was backported. Changing the
"33" in the #if macro to "32" make the kernel modules compile without
issue.

So, next, run make:
> make

Then as root, run make install and make the /dev/comedi* devices and
remake the module dependencies
> su
password:
$ make install
$ make dev
$ /sbin/depmod -a
$ exit

And it should be smooth sailing from there!

James (with help from colleagues!)

Ian Abbott

unread,
May 31, 2012, 1:43:32 AM5/31/12
to comed...@googlegroups.com
Thanks for the report. It looks like we'll need to add a test in the
configure scripts for this.

Also, with the new version of request_firmware_nowait(), the callback
function is meant to call release_firmware(), which it doesn't at the
moment, leading to a memory leak. This shouldn't be called if the
underlying request_firmware_nowait() is the old version.

I'll have a think about it some more before I fix it.

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

Ian Abbott

unread,
May 31, 2012, 1:51:33 AM5/31/12
to comed...@googlegroups.com
On 31/05/12 03:13, James wrote:
> Then as root, run make install and make the /dev/comedi* devices and
> remake the module dependencies
>> su
> password:
> $ make install
> $ make dev
> $ /sbin/depmod -a
> $ exit

Also, I'm wondering if you need the make dev? It's only needed if your
/dev contents are static. Most systems generate use UDEV to generate
the /dev contents dynamically.

Ian Abbott

unread,
May 31, 2012, 8:58:07 AM5/31/12
to comed...@googlegroups.com
On 2012-05-31 06:43, Ian Abbott wrote:
>> If you then run make, it will fail, with an error in comedi-HEAD-
>> c40b2f5/include/linux/firmware.h where it was calling a kernel
>> function with the wrong number of parameters.
>>
>> So the only modification that is needed is to modify one line in:
>> comedi-HEAD-c40b2f5/include/linux/firmware.h
>> Change line 11 from:
>> #if LINUX_VERSION_CODE< KERNEL_VERSION(2,6,33)
>> to:
>> #if LINUX_VERSION_CODE< KERNEL_VERSION(2,6,32)
>>
>> Although the kernel used in SL6.1 is 2.6.32, as the comedi
>> documentation specifies RHEL heavily modifies the kernels and it's
>> likely that the requisite change here was backported. Changing the
>> "33" in the #if macro to "32" make the kernel modules compile without
>> issue.

> Thanks for the report. It looks like we'll need to add a test in the
> configure scripts for this.
>
> Also, with the new version of request_firmware_nowait(), the callback
> function is meant to call release_firmware(), which it doesn't at the
> moment, leading to a memory leak. This shouldn't be called if the
> underlying request_firmware_nowait() is the old version.
>
> I'll have a think about it some more before I fix it.

This should be fixed in git now if you want to check it builds properly.

James

unread,
May 31, 2012, 4:19:05 PM5/31/12
to Comedi: Linux Control and Measurement Device Interface
Hi Ian,

Thanks for the code update. I did check out the code and it builds
out of the box on SL6.1 now.

Thanks!
James
> -=( Ian Abbott @ MEV Ltd.    E-mail: <abbo...@mev.co.uk>        )=-
Reply all
Reply to author
Forward
0 new messages