Page 1 of 1

Compile failure for driver 8.9.3

Posted: Mon 18. Nov 2019, 18:34
by gfine
pcanview does not recognize a driver is loaded. I get the 'No PCAN device found' error when I run it.

I had a previous driver (8.8.0) working a few months ago, and lsusb does show the PCAN device and that the sysfs shows the kobjects

My dev system is running Ubuntu 18.04 LTS
> uname -r
4.15.0-66-generic

and the pcan-usb shows up in lsusb
gfine@abe-sapien ~/Downloads/pcan/peak-linux-driver-8.9.3 $ lsusb

Code: Select all

Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 006: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
Bus 003 Device 020: ID 0c72:000c PEAK System PCAN-USB
Bus 003 Device 005: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 003 Device 004: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) Flash Drive
Bus 003 Device 0
03: ID 03f0:094a Hewlett-Packard Optical Mouse [672662-001]
and the previous driver info seems to still be there.

> ls /sys/bus/usb/drivers/peak_usb/

Code: Select all

3-6:1.0  bind  module  new_id  remove_id  uevent  unbind
I downloaded the latest driver 8.9.3 and but it fails to compile.

> make clean

Code: Select all

make[1]: Entering directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver'
rm -f src/*o src/*~ src/.*cmd *o *ko *~ .*cmd  pcan.mod.c Module.symvers modules.order .cache.mk 
make[1]: Leaving directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver'
make[1]: Entering directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/lib'
rm -f src/*~
rm -rf obj lib obj32 lib32
make[1]: Leaving directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/lib'
make[1]: Entering directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/test'
rm -f src/*~ src/*.o *~ receivetest transmitest bitratetest filtertest pcanfdtst pcan-settings receivetest_posix transmitest_posix
make[1]: Leaving directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/test'
make[1]: Entering directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/libpcanbasic'
make[2]: Entering directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/libpcanbasic/pcanbasic'
rm -f src/*~ out/*.o *~ *.so.* *.so
make[2]: Leaving directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/libpcanbasic/pcanbasic'
make[2]: Entering directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/libpcanbasic/pcaninfo'
rm -f src/*~ src/*.o ../pcanbasic/src/*~ ../pcanbasic/src/*.o *~ *.so.* *.so pcaninfo.1.0.3 pcaninfo
make[2]: Leaving directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/libpcanbasic/pcaninfo'
make[2]: Entering directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/libpcanbasic/examples'
make[3]: Entering directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/libpcanbasic/examples/python'
rm -f *.pyc
make[3]: Leaving directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/libpcanbasic/examples/python'
make[3]: Entering directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/libpcanbasic/examples/c++'
rm -f src/*~ src/*.o *~ pcanwrite pcanread pcaneventread pcaneventwrite
make[3]: Leaving directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/libpcanbasic/examples/c++'
make[2]: Leaving directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/libpcanbasic/examples'
make[1]: Leaving directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/libpcanbasic'
> make

Code: Select all

make[1]: Entering directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver'
***
*** Making pcan driver in chardev mode
***
*** Host machine kernel version=4.15.0-66-generic
*** Driver kernel version=4.15.0-66-generic (4.15.0)
*** Path to kernel sources=/usr/src/linux-headers-4.15.0-66-generic
*** use KBUILD=yes
*** gcc version=5.4.0
***
make -C /usr/src/linux-headers-4.15.0-66-generic  EXTRA_CFLAGS="-I/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver -DNO_DEBUG -DMODVERSIONS -DPARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DDONGLE_SUPPORT -DPCCARD_SUPPORT -DNO_NETDEV_SUPPORT -DNO_RT  -Wno-date-time" V=0 modules SUBDIRS=/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver
make[2]: Entering directory '/usr/src/linux-headers-4.15.0-66-generic'
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_main.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_fops.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_fifo.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_filter.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_parse.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_sja1000.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_common.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_timing.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcanfd_core.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcanfd_ucan.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_usb_core.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_usb.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_usbpro.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcanfd_usb.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_pci.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcanfd_pci.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_pciec.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_isa.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_dongle.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_pccard_core.o
  CC [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/src/pcan_pccard.o
  LD [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/pcan.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/pcan.mod.o
  LD [M]  /home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver/pcan.ko
make[2]: Leaving directory '/usr/src/linux-headers-4.15.0-66-generic'
make[1]: Leaving directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/driver'
make[1]: Entering directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/lib'
***
*** Making pcan libraries
***
*** gcc version: 5.4.0
***
gcc -DNO_RT -I. -I../driver -fPIC -Wall -Wcast-align -Wredundant-decls  -DPCANFD_OLD_STYLE_API -c src/libpcan.c -o obj/libpcan.o
gcc -shared -Wl,-soname,libpcan.so -o lib/libpcan.so.6 obj/libpcan.o 
cd lib/; ln -sf libpcan.so.6 libpcan.so
gcc -DNO_RT -I. -I../driver -fPIC -Wall -Wcast-align -Wredundant-decls  -DPCANFD_OLD_STYLE_API -c src/libpcanfd.c -o obj/libpcanfd.o
gcc -shared -Wl,-soname,libpcanfd.so -o lib/libpcanfd.so.8 obj/libpcanfd.o 
cd lib/; ln -sf libpcanfd.so.8 libpcanfd.so
ar rcs lib/libpcanfd.a obj/libpcanfd.o
gcc -DNO_RT -I. -I../driver -fPIC -Wall -Wcast-align -Wredundant-decls  -m32  -DPCANFD_OLD_STYLE_API -c src/libpcan.c -o obj32/libpcan.o
In file included from /usr/include/sys/ioctl.h:26:0,
                 from src/libpcan.c:40:

Code: Select all

/usr/include/bits/ioctls.h:23:24: fatal error: asm/ioctls.h: No such file or directory

Code: Select all

compilation terminated.
Makefile:172: recipe for target 'obj32/libpcan.o' failed
make[1]: *** [obj32/libpcan.o] Error 1
make[1]: Leaving directory '/home/gfine/Downloads/pcan/peak-linux-driver-8.9.3/lib'
Makefile:91: recipe for target 'all' failed
make: *** [all] Error 2
My kernel headers are up to date. I double checked my paths and they all look proper. However in
/usr/src/linux-headers-4.15.0-66-generic ... ioctl.h does not exist there.

Any ideas?

Regards,

Glen Fine

Re: Compile failure for driver 8.9.3

Posted: Tue 19. Nov 2019, 09:11
by M.Heidemann
Hello,

looks like you're either missing the package "linux-libc-dev" or it's path is different from the one defined in the makefile.

Try to locate ioctl.h.

If you do find it, change the path in the makefile accordingly.

if it does not seem to exist install the "linux-libc-dev" package and try again.

A similar error can occur with "popt.h", here the package "libpopt-dev" needs to be installed.


Best Regards


Marvin