[lug] Problems Compiling GPIB drivers

Kevin Fenzi kevin at scrye.com
Wed Sep 12 11:23:31 MDT 2001


>>>>> "Wayde" == J Wayde Allen <wallen at lug.boulder.co.us> writes:

Wayde> Kevin, at the July meeting in the park I mentioned that I'd
Wayde> been having some trouble trying to compile the National
Wayde> Instruments GPIB drivers.  The messages I'd been getting keep
Wayde> saying that I've got the wrong headers for the version of the
Wayde> kernel I have installed.  You had an explanation about what is
Wayde> going on here.  Unfortunately I don't remember the details or
Wayde> how you said to fix the problem.  Would you mind posting your
Wayde> explanation here?

not at all. ;) 

The problem is this. In later RedHat based distros, they have a
seperate package for the kernel-headers and the actual kernel. 
under RH 7.0, you could have seen:

rpm -qa | grep kernel
kernel-headers-2.4.0-1
kernel-2.2.16-1

Meaning that you had the 2.4.x "stable" headers in there for programs
to compile against, but the kernel is 2.2.16. (Redhat Did this so that
7.0 could be 'kernel 2.4 ready', ie all programs compiled against the
2.4 headers, but still use a 2.2.x kernel. 

The kernel-headers are header files that live in /usr/include/linux
and /usr/include/asm-i386/

Linus doesn't want to have to keep the kernel headers in sync with
glibc and the like, and for most things you compile they really don't
need to know internal details of the kernel. So, just keeping those
headers as a "stable" version works fine for most things. 

If you are compiling drivers tho, or something that really does need
to know the internals of the kernel you are running, you need to use
the headers in the kernel you are using, not the "stable" ones. 

In order to do this, you just need to do:

mv /usr/include/linux /usr/include/linux.old
ln -s /usr/src/linux/include/linux /usr/include/linux

mv /usr/include/asm /usr/include/asm.old
ln -s /usr/src/linux/include/asm /usr/include/asm

This will make the compiler pick up the headers directly from your
kernel source tree. This assumes of course that you have your kernel
source in /usr/src/linux and it's the one you want to compile your
driver against. 

You may way to put the old directories back in place after you compile
your drivers... 

Wayde> - Wayde (wallen at lug.boulder.co.us)

kevin
-- 
Kevin Fenzi
MTS, tummy.com, ltd.
http://www.tummy.com/  KRUD - Kevin's Red Hat Uber Distribution



More information about the LUG mailing list