Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-KAL fails to compile

Hi all,

I'm trying to compile the NI-KAL on my gentoo machine but it fails.
I'm using gcc-4.1.1 with kernel 2.6.20-gentoo-r7 and this is my output. Any hint or tip is highly appreciated. cheers!

Installing NI-KAL version 1.5.0f0...
Pre Installation ..
Preparing...                ########################################### [100%]
   1:nikali                 ########################################### [100%]
Post Installation .
Warning: nikali post installation failed! /tmp/nikaliPostInstall.log follows:
 
Configuring for linux kernel version 2.6.20-gentoo-r7.
 
********************************* NOTE *********************************
Using kernel headers found in /lib/modules/2.6.20-gentoo-r7/source.
If this does not correspond to the location of the 2.6.20-gentoo-r7 headers,
then define KERNELHEADERS in your environment to point to the location
of the kernel headers, define KERNELTARGET as the version of the
kernel for which to compile, and then rerun ./configure.
********************************* NOTE *********************************
 
Kernel has reparent_to_init(): yes
Number of arguments for do_munmap(): 3
pte_offset function: pte_offset_kernel()
Levels in page table: 4
Kernel has remap_pfn_range: yes
USB altsetting name: cur_altsetting
Kernel has usb_get_intf(): yes
Kernel has intf_cache member in usb_host_config: yes
Kernel has ep[] members in usb_device: yes
Kernel exports usb_set_configuration(): no
Units of USB_CTRL_GET_TIMEOUT: msec
Kernel has owner member in usb_driver: no
Kernel has put_page_testzero(): yes
Kernel has mutex method: yes
Kernel has kthread: yes
 
Storing configuration in Makefile.in
If the values stored are incorrect they can be changed before running make.
 
Uninstalling NI-KAL (nikal): done
/bin/rm -rf objects
Updating NI-KAL:
 NI-KAL update failed.
 
/bin/cp nikal.c objects/nikal.c
/bin/cp nikal.h objects/nikal.h
make -C /lib/modules/2.6.20-gentoo-r7/source SUBDIRS=/usr/local/natinst/nikal/src/objects modules
make[1]: Entering directory `/usr/src/linux-2.6.20-gentoo-r7'
  CC [M]  /usr/local/natinst/nikal/src/objects/nikal.o
/usr/local/natinst/nikal/src/objects/nikal.c:34:26: error: linux/config.h: No such file or directory
/usr/local/natinst/nikal/src/objects/nikal.c: In function ‘nNIKAL100_registerPCIDriver’:
/usr/local/natinst/nikal/src/objects/nikal.c:2667: warning: ignoring return value of ‘pci_register_driver’, declared with attribute warn_unused_result
/usr/local/natinst/nikal/src/objects/nikal.c: In function ‘nNIKAL100_buildControlURB’:
/usr/local/natinst/nikal/src/objects/nikal.c:3422: warning: passing argument 7 of ‘usb_fill_control_urb’ from incompatible pointer type
/usr/local/natinst/nikal/src/objects/nikal.c: In function ‘nNIKAL100_buildBulkURB’:
/usr/local/natinst/nikal/src/objects/nikal.c:3447: warning: passing argument 6 of ‘usb_fill_bulk_urb’ from incompatible pointer type
/usr/local/natinst/nikal/src/objects/nikal.c: In function ‘nNIKAL100_buildInterruptURB’:
/usr/local/natinst/nikal/src/objects/nikal.c:3498: warning: assignment from incompatible pointer type
/usr/local/natinst/nikal/src/objects/nikal.c: In function ‘nNIKAL100_buildIsochronousURB’:
/usr/local/natinst/nikal/src/objects/nikal.c:3539: warning: assignment from incompatible pointer type
/usr/local/natinst/nikal/src/objects/nikal.c:3644:48: error: macro "INIT_WORK" passed 3 arguments, but takes just 2
/usr/local/natinst/nikal/src/objects/nikal.c: In function ‘nNIKAL100_usbClearHaltAsync’:
/usr/local/natinst/nikal/src/objects/nikal.c:3643: error: ‘INIT_WORK’ undeclared (first use in this function)
/usr/local/natinst/nikal/src/objects/nikal.c:3643: error: (Each undeclared identifier is reported only once
/usr/local/natinst/nikal/src/objects/nikal.c:3643: error: for each function it appears in.)
/usr/local/natinst/nikal/src/objects/nikal.c: In function ‘nNIKAL100_reserveInterrupt’:
/usr/local/natinst/nikal/src/objects/nikal.c:3946: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type
make[2]: *** [/usr/local/natinst/nikal/src/objects/nikal.o] Error 1
make[1]: *** [_module_/usr/local/natinst/nikal/src/objects] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.20-gentoo-r7'
make: *** [objects/nikal.ko] Error 2
0 Kudos
Message 1 of 6
(3,644 Views)
Hi!

You can probably get some help from the patches that I posted in this thread. The fixes are for nikal 1.4.0 that is included with the GPBI driver package. You have to look for your self to see what the differences are between nikal 1.4.0 and 1.5.0 and determine if my patches work for you.

Anyway, it could be worth a try!
 
0 Kudos
Message 2 of 6
(3,633 Views)
Thanks for the patches. Ok I downloaded nikal-1.4 and applied all the three patches. It fails again but this time different from before:

Configuring for linux kernel version 2.6.20-gentoo-r7.
 
********************************* NOTE *********************************
Using kernel headers found in /lib/modules/2.6.20-gentoo-r7/source.
If this does not correspond to the location of the 2.6.20-gentoo-r7 headers,
then define KERNELHEADERS in your environment to point to the location
of the kernel headers, define KERNELTARGET as the version of the
kernel for which to compile, and then rerun ./configure.
********************************* NOTE *********************************
 
Kernel has reparent_to_init(): yes
Number of arguments for do_munmap(): 3
pte_offset function: pte_offset_kernel()
Levels in page table: 4
Kernel has remap_pfn_range: yes
USB altsetting name: cur_altsetting
Kernel has usb_get_intf(): yes
Kernel has intf_cache member in usb_host_config: yes
Kernel has ep[] members in usb_device: yes
Kernel exports usb_set_configuration(): no
Units of USB_CTRL_GET_TIMEOUT: msec
Kernel has owner member in usb_driver: no
 
Storing configuration in Makefile.in
If the values stored are incorrect they can be changed before running make.
 
Uninstalling NI-KAL (nikal): done
/bin/rm -rf objects
Updating NI-KAL:
 NI-KAL update failed.
 
/bin/cp nikal.c objects/nikal.c
/bin/cp nikal.h objects/nikal.h
make -C /lib/modules/2.6.20-gentoo-r7/source SUBDIRS=/usr/local/natinst/nikal/src/objects modules
make[1]: Entering directory `/usr/src/linux-2.6.20-gentoo-r7'
  CC [M]  /usr/local/natinst/nikal/src/objects/nikal.o
In file included from /usr/local/natinst/nikal/src/objects/nikal.c:17:
include/linux/version.h:3: warning: data definition has no type or storage class
include/linux/version.h:3: warning: type defaults to ‘int’ in declaration of ‘UTS_RELEASE’
In file included from /usr/local/natinst/nikal/src/objects/nikal.c:17:
include/linux/version.h:3:15: error: too many decimal points in number
include/linux/version.h:3: error: ‘gentoo’ undeclared here (not in a function)
In file included from include/linux/preempt.h:9,
                 from include/linux/spinlock.h:49,
                 from include/linux/module.h:9,
                 from /usr/local/natinst/nikal/src/objects/nikal.c:50:
include/linux/version.h:3: error: ‘r7’ undeclared here (not in a function)
include/linux/thread_info.h:13: error: expected ‘,’ or ‘;’ before ‘struct’
include/linux/thread_info.h:18: warning: ‘struct restart_block’ declared inside parameter list
include/linux/thread_info.h:18: warning: its scope is only this definition or declaration, which is probably not what you want
In file included from include/linux/thread_info.h:21,
                 from include/linux/preempt.h:9,
                 from include/linux/spinlock.h:49,
                 from include/linux/module.h:9,
                 from /usr/local/natinst/nikal/src/objects/nikal.c:50:
include/asm/thread_info.h:41: error: field ‘restart_block’ has incomplete type
make[2]: *** [/usr/local/natinst/nikal/src/objects/nikal.o] Error 1
make[1]: *** [_module_/usr/local/natinst/nikal/src/objects] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.20-gentoo-r7'
make: *** [objects/nikal.ko] Error 2
 
ERROR: make of nikal kernel module failed, not installing kernel module.
   updateNIDrivers should be called again after fixing the problem.
   Logging failure...
   Include the file /tmp/niSystemReport.out.gz when contacting
   National Instruments for support.

0 Kudos
Message 3 of 6
(3,634 Views)
This looks like an issue with the file /lib/modules/2.6.20-gentoo-r7/source/include/linux/version.h from Gentoos kernel source tree. In Fedora Core 6 (which I use) with kernel 2.6.20 the corresponding file (version.h) looks like this:

#define LINUX_VERSION_CODE 132628
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 😎 + (c))


How does your version.h look?

Previous kernels also had a define for UTS_RELEASE in version.h but for 2.6.18 and above this has moved to a separate file named utsrelease.h (located in the same directory as version.h). For the 2.6.20 kernel i FC6 this looks like this:

#define UTS_RELEASE "2.6.20-1.2948.fc6"

Do you have a file named utsrelease.h and if so, what does it contain?


The exact location of these defines and what they define could vary between distributions. The updateNIDrivers script looks for the UTS_RELEASE define to determine the release name. One of my patches (nikal-2.6.18.patch) fixes the script to also look in utsrelease.h for the define and after that it works with FC6 kernels up to 2.6.20.
Message 4 of 6
(3,624 Views)
Thanks man! I changed it to what you said and it's compiling fine. Thanks again.
0 Kudos
Message 5 of 6
(3,611 Views)
Good to hear that the patches work on Gentoo as well!

Now, what would be *realy* intresting is if you can *use* the driver. Compiling is the first necessary step but it must run withot messing up the kernel as well. If possible, please report back any usage success!
0 Kudos
Message 6 of 6
(3,602 Views)