#5 Error compiling under Linux

closed
5
2012-09-14
2009-07-23
No

$ make -f LINUX/Makefile
make[1]: Entering directory /root/C64/opencbm-0.4.2a/sys/linux' ln -s LINUX/Makefile Makefile make -C here=pwdCBM4LINUX_KERNEL_FLAGS= SUBDIRS=pwdmodules make: Entering an unknown directory make: *** here=/root/C64/opencbm-0.4.2a/sys/linux: No such file or directory. Stop. make: Leaving an unknown directory make[1]: *** [cbm.o] Error 2 make[1]: Leaving directory/root/C64/opencbm-0.4.2a/sys/linux'
make: *** [all] Error 1

$ uname -a
Linux jukebox.atc.no 2.6.18-128.2.1.el5 #1 SMP Tue Jul 14 06:39:56 EDT 2009 i686 athlon i386 GNU/Linux

Kernel headers are installed. I see no file or directory "modules" under sys/linux so this may be a packaging issue.

Discussion

  • Spiro Trikaliotis

    Hello,

    "modules" is a Makefile target. That is, the symbolic link sys/linux/Makefile points to sys/linux/LINUX/Makefile, which contains the target ("modules:")

    However, something is going wrong on your system. Did the ln command successfully create the above mentioned symbolic link? Is /root/C64/opencbm-0.4.2a/ the right directory where you unpacked OpenCBM?

    Regards
    Spiro

     
  • Andreas Lund

    Andreas Lund - 2009-07-24

    That is indeed the correct directory, and the 'ln' was successful:
    $ ls -la
    total 56
    drwxr-xr-x 3 root root 4096 Jul 23 09:49 .
    drwxr-xr-x 10 root root 4096 Nov 18 2007 ..
    -rw-r--r-- 1 root root 180 Nov 11 2007 45-opencbm-parallel.rules
    -rw-r--r-- 1 root root 34128 Nov 11 2007 cbm_module.c
    -rw-r--r-- 1 root root 110 Oct 28 2007 .cvsignore
    drwxr-xr-x 2 root root 4096 Nov 18 2007 LINUX
    lrwxrwxrwx 1 root root 14 Jul 23 09:49 Makefile -> LINUX/Makefile

    I see now that 'modules' is indeed a make target. Unfortunately, it doesn't seem like this Makefile is ever used; I've tried replacing the command for that target but the command is never executed.

     
  • Spiro Trikaliotis

    Hello again,

    I looked again at the line you gave me as your output:

    make -C here=pwd CBM4LINUX_KERNEL_FLAGS= SUBDIRS=pwd modules

    After the -C, there should be a directory, but it is missing.

    Thus, KERNEL_SOURCE is not set. It should be set in /root/C64/opencbm-0.4.2a/LINUX/config.make

    The script searches if either /lib/modules/uname -r/build or /usr/src/linux/ exists. If none of them exists, you get exactly the error you descirbe.

    You told me that kernel headers are installed. Where are they? And what is the output of

    $ uname -r

    Regards,
    Spiro

     
  • Andreas Lund

    Andreas Lund - 2009-07-26

    OK let's see...
    $ uname -r
    2.6.18-128.2.1.el5
    $ ls -la /lib/modules/uname -r/build
    lrwxrwxrwx 1 root root 48 Jul 21 10:21 /lib/modules/2.6.18-128.2.1.el5/build -> ../../../usr/src/kernels/2.6.18-128.2.1.el5-i686

    This looks promising, but...
    $ cd /lib/modules/uname -r/build
    -bash: cd: /lib/modules/2.6.18-128.2.1.el5/build: No such file or directory

    $ rpm -ql kernel-headers | grep linux | head
    /usr/include/linux
    /usr/include/linux/a.out.h
    /usr/include/linux/acct.h
    /usr/include/linux/adb.h
    /usr/include/linux/adfs_fs.h
    /usr/include/linux/affs_fs.h
    /usr/include/linux/affs_hardblocks.h
    /usr/include/linux/agpgart.h
    /usr/include/linux/aio_abi.h
    /usr/include/linux/apm_bios.h

    The kernel headers are there, but it seems what you're looking for is the kernel source which is not installed.
    $ yum install kernel-devel

    Now, obviously they've put in an error here to keep things interesting...
    $ ln -s /usr/src/kernels/2.6.18-128.2.1.el5.centos.plus-i686 /usr/src/kernels/2.6.18-128.2.1.el5-i686

    ...and 'make -f LINUX/Makefile' works at last!
    Suggest you add to the docs that the kernel source is needed, not just the kernel headers.

    Thank you for your help, I would have never figured this out if you hadn't pointed me in the right direction :-)

     
  • Spiro Trikaliotis

    I'm glad I could help out.

    I will try to reformulate this in the manual, especially since this seems to become a common compilation problem.

    • Spiro
     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Anonymous
Anonymous

Cancel  Add attachments