Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

cannot compile nigpib-0.8.2 on redhat 8.0

I tried to compile nigpib-0.8.2 linux driver on redhat 8.0, and it didn't work. The errors it got are:
********************************
# ./INSTALL

NI-488.2 GPIB Driver for Linux/x86 (Beta Release 0.8,2)
Copyright (C) 1999-2001 National Instruments Corporation.
Supports AT-GPIB/TNT, AT-GPIB/TNT PnP, and PCI-GPIB cards ONLY.
Note that PCII/a and PCMCIA cards are NOT supported; see README for more info.

This driver requires a stable Linux 2.0.x, 2.2.x, or 2.4.x series kernel with
loadable modules and module versioning enabled.

Your kernel appears to be configured properly to build NI-GPIB for Linux.
Do you want to proceed? [yn]

gcc -c -O2 -D__KERNEL__ -I/lib/modules/2.4.18-17.8.0/build/include -DMODULE -DMODVER
SIONS -include /lib/modules/2.4.18-17.8.0/build/include/linux/modversions.h
-D__GPIBDRIVER__ -o ib_linux-2.4.18-17.8.0.o ib_linux.c
In file included from ib_linux.c:35:
/lib/modules/2.4.18-17.8.0/build/include/linux/malloc.h:4:2: #error linux/malloc.h is deprecated, use linux/slab.h instead.
make: *** [ib_linux-2.4.18-17.8.0.o] Error 1
Couldn't build driver.
#
********************************
Can anyone help?

Thanks.
0 Kudos
Message 1 of 5
(3,640 Views)
Hi,

I checked malloc.h in my system (2.4.19) and it has the following code:

#ifndef _LINUX_MALLOC_H
#define _LINUX_MALLOC_H

#warning linux/malloc.h is deprecated, use linux/slab.h instead.

#include
#endif /* _LINUX_MALLOC_H */

I found a discussion on the web where this file used " #error linux/malloc.h is deprecated, use linux/slab.h instead." generating an error instead of a warning. In the discussion, the user was also using kernel 2.4.19.

Check what's on your malloc.h file. You could change the #error to #warning. If you don't want to mess with the kernel sources, you can also change the #include to #include in the ib_linux.c file of the NI-488.2 driver.

This should allow you to compile the driver.


DiegoF.
National Instruments.
0 Kudos
Message 2 of 5
(3,640 Views)
I replaced with and the kernel module compiled. However, there is an error message that states that the module has been compiled with a 2.9.x series compiler, whereas RedHat 8.0 uses the gcc 3.2 version. It then says that "this is known not to work".

So, what we would need is for someone at NI to compile the nigpib-linux drivers on RedHat 8.0, since they are closed source.

Can this be done?

Best regards, Erwin P.
0 Kudos
Message 3 of 5
(3,640 Views)
I would like to second the other comment in this thread. I am having a similar problem using the NI
driver for the pci-gpib card.

The object files that NI distributes are compiled with GCC 2.95.2, which is quite old now. Redhat 8.0 uses GCC version 3.2 and so the driver cannot be loaded into a redhat 8.0 kernel.

There is really no workaround until NI recompiles the Linux drivers using GCC 3.2. Well, another solution would be to make the driver open source, but that would be too easy for everyone...

jeff
0 Kudos
Message 4 of 5
(3,640 Views)
Hi,

Just to complete this discussion: The nigpib driver compiled with gcc 3.2 is available at:
http://www.ni.com/linux/ni488dl.htm

DiegoF
National Instruments
0 Kudos
Message 5 of 5
(3,640 Views)