National Instruments PCI-GPIB and Linux Mandrake 9.1

Scope

This page describes how to install the National Instruments PCI-GPIB driver on the Mandrake 9.1 Linux distribution. (glibc-2.3.1).
I have succesfully compiled the driver against a 2.4.21-0.18mdk kernel, and can statically compile my own programs with the supplied libgpib.a file.
(NEW: Recently tried 2.4.21-0.25mdk kernel as well, no problems were encountered.)

Background

The NI GPIB driver provided by NI at http://www.ni.com/linux/ni488dl.htm nigpib-linux-0.8.4 compiles fine with some RedHat and other linux distributions which will not be mentioned here.
But the INSTALL script does not work with Mandrake 9.1 installations.

Additionally programs using the gpib functions and routines did not compile.

Compiling the driver versus the Mandrake Kernel

Symptoms

When running the INSTALL script, lots of error messages are produced.
First, it looks for a rhconfig.h file in /usr/include/linux/ which does not exist, it is placed in /usr/src/linux-[version]/include/linux/
Symlinking this file does not solve it, it still produces lots of errors.

Fix

1) Become root

2) Create a symbolic link of the rhconfig.h file:

$ ln -s /usr/src/linux-[your kernel]/include/linux/rhconfig.h /usr/include/linux/rhconfig.h

where [your kernel] is the output of the command:

$ uname -r
3) put this script into the nigpib-linux-0.8.4 directory: [install_mdk91.sh] Make it executable with

$ chmod 744 install_mdk91.sh

and run it as root:

$ ./install_mdk91.sh

Make sure that your libgpib.a file is installed in something like /usr/local/lib/.

Compiling your own GPIB software fails

Symptoms

$ gcc get_trace_gpib.c -o cmdgpib -L/home/bassler/temp -lgpib -Wall
/home/bassler/temp/libgpib.a(cib.o)(.text+0xde): In function `oserr':
: undefined reference to `errno'
collect2: ld returned 1 exit status

Fix

Make sure that the glibc-static-devel package is installed, and add the -static option, something like:
$ gcc get_trace_gpib.c -o get_trace_gpib -lgpib -static -Wall

Did this page help you (or not)? Please send me a mail!
31.07.2003, Niels Bassler, bassler at phys dot au dot dk, [home]