Hi,
I am trying to get can4linux running on Ubuntu 16.04 64bit (kernel = 4.4.0-24-generic #43-Ubuntu SMP Wed Jun 8 19:27:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux). It doesn't compile and the error I receive is below.
ugv@ugv-UNO-2483G-434AE:~/Downloads/can/can4linux-code/can4linux$ make TARGET=PCM3680
compile with KDIR=/lib/modules/4.4.0-24-generic/build/, at /home/ugv/Downloads/can/can4linux-code/can4linux
CC = cc
make -C /lib/modules/4.4.0-24-generic/build/ C=0 M=/home/ugv/Downloads/can/can4linux-code/can4linux TARGET=PCM3680 modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.0-24-generic'
CC [M] /home/ugv/Downloads/can/can4linux-code/can4linux/core.o
/home/ugv/Downloads/can/can4linux-code/can4linux/core.c: In function ‘can_init’:
/home/ugv/Downloads/can/can4linux-code/can4linux/core.c:420:29: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time]
__DATE__ " " __TIME__ "\n");
^
/home/ugv/Downloads/can/can4linux-code/can4linux/core.c:420:29: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time]
/home/ugv/Downloads/can/can4linux-code/can4linux/core.c:659:1: warning: label ‘out_class’ defined but not used [-Wunused-label]
out_class:
^
cc1: some warnings being treated as errors
scripts/Makefile.build:258: recipe for target '/home/ugv/Downloads/can/can4linux-code/can4linux/core.o' failed
make[2]: *** [/home/ugv/Downloads/can/can4linux-code/can4linux/core.o] Error 1
Makefile:1402: recipe for target '_module_/home/ugv/Downloads/can/can4linux-code/can4linux' failed
make[1]: *** [_module_/home/ugv/Downloads/can/can4linux-code/can4linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-24-generic'
Makefile:728: recipe for target 'all' failed
make: *** [all] Error 2
I know there were many changes to the 4.XX kernel and that probably affects me in a negative way. There was a previous post regarding a build on a 4.2 kernel but following it did not help me.
I downloaded the latest can4linux from svn (revision 532).
Any thoughts on what is required to get this working on the latest stable LTS kernel for Ubuntu?
Thanks,
Paul.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First let me say I am not a software developer. I'm just trying to get a new computer up and running and need CAN functionality.
I managed to sort out the DATETIME error and turned it into a warning (added Wno-error=date-time to the CFLAGS). Now I am left with the following:
ugv@ugv-UNO-2483G-434AE:~/Downloads/can/can4linux-code/can4linux$ make TARGET=PCM3680
compile with KDIR=/lib/modules/4.4.0-24-generic/build/, at /home/ugv/Downloads/can/can4linux-code/can4linux
CC = cc
make -C /lib/modules/4.4.0-24-generic/build/ C=0 M=/home/ugv/Downloads/can/can4linux-code/can4linux TARGET=PCM3680 modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.0-24-generic'
CC [M] /home/ugv/Downloads/can/can4linux-code/can4linux/core.o
/home/ugv/Downloads/can/can4linux-code/can4linux/core.c: In function ‘can_init’:
/home/ugv/Downloads/can/can4linux-code/can4linux/core.c:420:27: warning: macro "__DATE__" might prevent reproducible builds [-Wdate-time]
__DATE__ __TIME__ "\n");
^
/home/ugv/Downloads/can/can4linux-code/can4linux/core.c:420:27: warning: macro "__TIME__" might prevent reproducible builds [-Wdate-time]
/home/ugv/Downloads/can/can4linux-code/can4linux/core.c:659:1: warning: label ‘out_class’ defined but not used [-Wunused-label]
out_class:
^
CC [M] /home/ugv/Downloads/can/can4linux-code/can4linux/open.o
CC [M] /home/ugv/Downloads/can/can4linux-code/can4linux/read.o
CC [M] /home/ugv/Downloads/can/can4linux-code/can4linux/write.o
CC [M] /home/ugv/Downloads/can/can4linux-code/can4linux/ioctl.o
CC [M] /home/ugv/Downloads/can/can4linux-code/can4linux/select.o
CC [M] /home/ugv/Downloads/can/can4linux-code/can4linux/debug.o
CC [M] /home/ugv/Downloads/can/can4linux-code/can4linux/util.o
CC [M] /home/ugv/Downloads/can/can4linux-code/can4linux/sysctl.o
CC [M] /home/ugv/Downloads/can/can4linux-code/can4linux/async.o
CC [M] /home/ugv/Downloads/can/can4linux-code/can4linux/close.o
CC [M] /home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.o
In file included from include/linux/kernel.h:13:0,
from include/linux/list.h:8,
from include/linux/module.h:9,
from /home/ugv/Downloads/can/can4linux-code/can4linux/defs.h:26,
from /home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:28:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c: In function ‘can_showstat’:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:67:26: error: implicit declaration of function ‘CAN_IN’ [-Werror=implicit-function-declaration]
pr_info(" MODE 0x%x,", CAN_IN(board, canmode));
^
include/linux/printk.h:259:34: note: in definition of macro ‘pr_info’
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:67:40: error: ‘canmode’ undeclared (first use in this function)
pr_info(" MODE 0x%x,", CAN_IN(board, canmode));
^
include/linux/printk.h:259:34: note: in definition of macro ‘pr_info’
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:67:40: note: each undeclared identifier is reported only once for each function it appears in
pr_info(" MODE 0x%x,", CAN_IN(board, canmode));
^
include/linux/printk.h:259:34: note: in definition of macro ‘pr_info’
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:68:40: error: ‘canstat’ undeclared (first use in this function)
pr_info(" STAT 0x%x,", CAN_IN(board, canstat));
^
include/linux/printk.h:259:34: note: in definition of macro ‘pr_info’
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:69:40: error: ‘canirq_enable’ undeclared (first use in this function)
pr_info(" IRQE 0x%x,", CAN_IN(board, canirq_enable));
^
include/linux/printk.h:259:34: note: in definition of macro ‘pr_info’
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:70:40: error: ‘canirq’ undeclared (first use in this function)
pr_info(" INT 0x%x\n", CAN_IN(board, canirq));
^
include/linux/printk.h:259:34: note: in definition of macro ‘pr_info’
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c: In function ‘can_getstat’:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:112:31: error: ‘canstat’ undeclared (first use in this function)
stat->status = CAN_IN(minor, canstat);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:113:44: error: ‘errorwarninglimit’ undeclared (first use in this function)
stat->error_warning_limit = CAN_IN(minor, errorwarninglimit);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:114:35: error: ‘rxerror’ undeclared (first use in this function)
stat->rx_errors = CAN_IN(minor, rxerror);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:115:35: error: ‘txerror’ undeclared (first use in this function)
stat->tx_errors = CAN_IN(minor, txerror);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:117:35: error: ‘errorcode’ undeclared (first use in this function)
stat->error_code = CAN_IN(minor, errorcode);
^
In file included from /home/ugv/Downloads/can/can4linux-code/can4linux/defs.h:229:0,
from /home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:28:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c: In function ‘can_chip_reset’:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:148:49: error: ‘canirq’ undeclared (first use in this function)
DBGPRINT(DBG_DATA, (" INT 0x%x", CAN_IN(minor, canirq)));
^
/home/ugv/Downloads/can/can4linux-code/can4linux/debug.h:34:43: note: in definition of macro ‘DBGPRINT’
{ pr_info("Can[%d]: - :", minor); printk ar; printk("\n"); } }
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:150:2: error: implicit declaration of function ‘CAN_OUT’ [-Werror=implicit-function-declaration]
CAN_OUT(minor, canmode, CAN_RESET_REQUEST);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:150:17: error: ‘canmode’ undeclared (first use in this function)
CAN_OUT(minor, canmode, CAN_RESET_REQUEST);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:157:25: error: ‘canstat’ undeclared (first use in this function)
status = CAN_IN(minor, canstat);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:176:17: error: ‘canclk’ undeclared (first use in this function)
CAN_OUT(minor, canclk, CAN_MODE_PELICAN + CAN_MODE_CLK);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:183:17: error: ‘canoutc’ undeclared (first use in this function)
CAN_OUT(minor, canoutc, proc_outc[minor]);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c: In function ‘can_set_btr’:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:206:17: error: ‘canclk’ undeclared (first use in this function)
CAN_OUT(minor, canclk, CAN_MODE_PELICAN + CAN_MODE_CLK);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:207:17: error: ‘cantim0’ undeclared (first use in this function)
CAN_OUT(minor, cantim0, (u8) (btr0 & 0xff));
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:208:17: error: ‘cantim1’ undeclared (first use in this function)
CAN_OUT(minor, cantim1, (u8) (btr1 & 0xff));
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c: In function ‘can_set_timing’:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:272:17: error: ‘canclk’ undeclared (first use in this function)
CAN_OUT(minor, canclk, CAN_MODE_PELICAN + CAN_MODE_CLK);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:274:18: error: ‘cantim0’ undeclared (first use in this function)
CAN_OUT(minor, cantim0, (u8) (baud >> 8) & 0xff);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:275:18: error: ‘cantim1’ undeclared (first use in this function)
CAN_OUT(minor, cantim1, (u8) (baud & 0xff));
^
In file included from /home/ugv/Downloads/can/can4linux-code/can4linux/defs.h:229:0,
from /home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:28:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c: In function ‘can_start_chip’:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:294:47: error: ‘canmode’ undeclared (first use in this function)
("[%d] CAN_mode 0x%x", minor, CAN_IN(minor, canmode)));
^
/home/ugv/Downloads/can/can4linux-code/can4linux/debug.h:34:43: note: in definition of macro ‘DBGPRINT’
{ pr_info("Can[%d]: - :", minor); printk ar; printk("\n"); } }
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:304:22: error: ‘canirq’ undeclared (first use in this function)
(void)CAN_IN(minor, canirq);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:341:2: error: implicit declaration of function ‘CAN_SET’ [-Werror=implicit-function-declaration]
CAN_SET(minor, canirq_enable, irqmask);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:341:17: error: ‘canirq_enable’ undeclared (first use in this function)
CAN_SET(minor, canirq_enable, irqmask);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:343:2: error: implicit declaration of function ‘CAN_RESET’ [-Werror=implicit-function-declaration]
CAN_RESET(minor, canmode, CAN_RESET_REQUEST);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c: In function ‘can_stopchip’:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:362:17: error: ‘canmode’ undeclared (first use in this function)
CAN_SET(minor, canmode, CAN_RESET_REQUEST);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c: In function ‘can_set_mode’:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:372:17: error: ‘canoutc’ undeclared (first use in this function)
CAN_OUT(minor, canoutc, arg);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c: In function ‘can_set_listenonlymode’:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:394:18: error: ‘canmode’ undeclared (first use in this function)
CAN_SET(minor, canmode, CAN_LISTEN_ONLY_MODE);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c: In function ‘can_set_mask’:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:412:17: error: ‘frameinfo’ undeclared (first use in this function)
CAN_OUT(minor, frameinfo,
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:414:17: error: ‘frame’ undeclared (first use in this function)
CAN_OUT(minor, frame.extframe.canid1,
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c: In function ‘can_send_message’:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:458:33: error: ‘canstat’ undeclared (first use in this function)
while (!((stat = CAN_IN(minor, canstat)) & CAN_TRANSMIT_BUFFER_ACCESS))
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:483:18: error: ‘frameinfo’ undeclared (first use in this function)
CAN_OUT(minor, frameinfo, CAN_EFF + tx2reg);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:484:18: error: ‘frame’ undeclared (first use in this function)
CAN_OUT(minor, frame.extframe.canid1, (u8)(tx->id >> 21));
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:517:17: error: ‘cancmd’ undeclared (first use in this function)
CAN_OUT(minor, cancmd, CAN_TRANSMISSION_REQUEST);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c: In function ‘can_interrupt’:
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:608:25: error: ‘canirq’ undeclared (first use in this function)
irqsrc = CAN_IN(minor, canirq);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:626:43: error: ‘txerror’ undeclared (first use in this function)
proc_txerrcounter[minor] = CAN_IN(minor, txerror);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:627:43: error: ‘rxerror’ undeclared (first use in this function)
proc_rxerrcounter[minor] = CAN_IN(minor, rxerror);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:660:27: error: ‘frameinfo’ undeclared (first use in this function)
dummy = CAN_IN(minor, frameinfo);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:690:35: error: ‘frame’ undeclared (first use in this function)
((unsigned int)(CAN_IN(minor, frame.extframe.canid1)) << 21)
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:743:18: error: ‘cancmd’ undeclared (first use in this function)
CAN_OUT(minor, cancmd, CAN_RELEASE_RECEIVE_BUFFER);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:744:21: error: ‘canstat’ undeclared (first use in this function)
if (CAN_IN(minor, canstat) & CAN_DATA_OVERRUN) {
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:946:24: error: ‘errorcode’ undeclared (first use in this function)
ecc = CAN_IN(minor, errorcode);
^
cc1: some warnings being treated as errors
scripts/Makefile.build:258: recipe for target '/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.o' failed
make[2]: *** [/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.o] Error 1
Makefile:1402: recipe for target '_module_/home/ugv/Downloads/can/can4linux-code/can4linux' failed
make[1]: *** [_module_/home/ugv/Downloads/can/can4linux-code/can4linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-24-generic'
Makefile:728: recipe for target 'all' failed
make: *** [all] Error 2
Anyone able to help sort this out?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Am Samstag, 11. Juni 2016, 14:58:57 schrieb Paul Rocco:
First let me say I am not a software developer. I'm just trying to get a new computer up and running and need CAN functionality.
I managed to sort out the DATETIME error and turned it into a warning (added Wno-error=date-time to the CFLAGS).
I never had this error/warning message, Seems to be new with gcc 4.9.
Moving the error to a warning looks good at a fist step. I will see if there are better solutions.
Now I am left with the following:
In short, all the following messages, like
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:67:26: error: implicit declaration of function ‘CAN_IN’ [-Werror=implicit-function-declaration]
pr_info(" MODE 0x%x,", CAN_IN(board, canmode));
^
include/linux/printk.h:259:34: note: in definition of macro ‘pr_info’
printk(KERN_INFO pr_fmt(fmt), ##VA_ARGS)
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:67:40: error: ‘canmode’ undeclared (first use in this function)
pr_info(" MODE 0x%x,", CAN_IN(board, canmode));
...
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:68:40: error: ‘canstat’ undeclared (first use in this function)
pr_info(" STAT 0x%x,", CAN_IN(board, canstat));
^
...
pr_info(" INT 0x%x\n", CAN_IN(board, canirq));
^
stat->status = CAN_IN(minor, canstat);
^
...
stat->error_warning_limit = CAN_IN(minor, errorwarninglimit);
^
/home/ugv/Downloads/can/can4linux-code/can4linux/sja1000funcs.c:114:35: error: ‘rxerror’ undeclared (first use in this function)
stat->rx_errors = CAN_IN(minor, rxerror);
^
are all missing definitions of the CAN controller registers. They all are in sja1000.h.
I have to check why this header file is not included in your build.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I have adopted the code for the TARGET PCM3680. It now compiles for kernel 3.16. and gcc 4.8. I hope it will compile for kernel 4.x too. Unfortunately I can not test. Please let me know what is in /var/log/messages or what dmesg says when the driver is loaded and used by one of the examples when /proc/sys/dev/Can/dbgMask is set to 7
Please use and update to the latest svn sources
Last edit: Heinz-Jürgen Oertel 2016-06-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am trying to get can4linux running on Ubuntu 16.04 64bit (kernel = 4.4.0-24-generic #43-Ubuntu SMP Wed Jun 8 19:27:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux). It doesn't compile and the error I receive is below.
I know there were many changes to the 4.XX kernel and that probably affects me in a negative way. There was a previous post regarding a build on a 4.2 kernel but following it did not help me.
I downloaded the latest can4linux from svn (revision 532).
Any thoughts on what is required to get this working on the latest stable LTS kernel for Ubuntu?
Thanks,
Paul.
First let me say I am not a software developer. I'm just trying to get a new computer up and running and need CAN functionality.
I managed to sort out the DATE TIME error and turned it into a warning (added Wno-error=date-time to the CFLAGS). Now I am left with the following:
Anyone able to help sort this out?
Hi,
I hope to have a look at it in two or three hours.
Last edit: Heinz-Jürgen Oertel 2016-06-11
Am Samstag, 11. Juni 2016, 14:58:57 schrieb Paul Rocco:
I never had this error/warning message, Seems to be new with gcc 4.9.
Moving the error to a warning looks good at a fist step. I will see if there are better solutions.
In short, all the following messages, like
...
are all missing definitions of the CAN controller registers. They all are in sja1000.h.
I have to check why this header file is not included in your build.
Hi
I have adopted the code for the TARGET PCM3680. It now compiles for kernel 3.16. and gcc 4.8. I hope it will compile for kernel 4.x too. Unfortunately I can not test. Please let me know what is in /var/log/messages or what dmesg says when the driver is loaded and used by one of the examples when /proc/sys/dev/Can/dbgMask is set to 7
Please use and update to the latest svn sources
Last edit: Heinz-Jürgen Oertel 2016-06-12