make error on CentOS 5.3

  • lollo_bis

    lollo_bis - 2009-09-16


    I'm trying to install top on a minimized install of CentOS 5.3.

    I've tried both 3.6 and 3.7 and I keep getting the same error.
    Configure completes ok, but make stops with the following error:

    /home/pg10326/top-3.7$ make

    gcc -DHAVE_CONFIG_H  -I. -I. -g -O2 -Wall   -fno-strict-aliasing -o m_linux.o -c ./machine/m_linux.c

    ./machine/m_linux.c: In function âread_one_proc_statâ:

    ./machine/m_linux.c:700: error: âPAGE_SHIFTâ undeclared (first use in this function)

    ./machine/m_linux.c:700: error: (Each undeclared identifier is reported only once

    ./machine/m_linux.c:700: error: for each function it appears in.)

    make: ***  Error 1

    Any idea what am I missing or doing wrong?



  • striebhz

    striebhz - 2009-09-16

    The same thing is happening in some SuSE versions and the reason are broken kernel headers with wrong includes. I made a patch to fix the build but if applied the process list won't work. However, cpu/mem usage and system load are displayed correctly.
    If you are interested I can send you the patch in 2 weeks (don't have it at home).

  • lollo_bis

    lollo_bis - 2009-09-16

    Hi Striebhz,

    Thanks for your prompt reply.

    I managed to get around this by copying the following lines

    /* PAGE_SHIFT determines the page size */

    \#define PAGE_SHIFT      12

    \#define PAGE_SIZE       (1UL << PAGE_SHIFT)
    \#define PAGE_MASK       (~(PAGE_SIZE-1))


    \#define LARGE_PAGE_SIZE (1UL << PMD_SHIFT)

    from /usr/include/asm-i386/page.h

    into /usr/include/asm-x86_64/page.h

    That fixed it for me, make completes ok and unixtop runs flawlessly as expected.

  • William LeFebvre

    Not sure about previous versions but in 3.8beta1 this can be fixed by making a change in m_linux.c as follows:

    change: #include <asm/page.h>

    to: #include <sys/user.h>

    The reason this is a problem is because the i386 version of asm/page.h has PAGE_SHIFT defined while the x86_64 version does not. Until now my tests have been limited to the i386 platform.

    FYI: You also need to have the package "libtermcap-devel" installed before running configure.

    I will make sure this change gets in to future releases of 3.8.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks