cyring / CoreFreq

CoreFreq : CPU monitoring and tuning software designed for 64-bit processors.
https://www.cyring.fr
GNU General Public License v2.0
1.94k stars 127 forks source link

Compilation error: "Makefile:768: arch/amd64/Makefile: No such file or directory" #448

Closed vitaly-zdanevich closed 1 year ago

vitaly-zdanevich commented 1 year ago

Version 1.96.2.

Full log:

>>> Emerging (1 of 1) sys-apps/corefreq-1.96.2::guru
 * corefreq-1.96.2.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                                                      [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     6.1.12-gentoo+
 * Checking for kernel configurations...
 * Enable optional configurations only as you see fit.
 * Not all optional configurations will be suitable for your system.
 * Build will fail for required configs.
 * The other configs are all optional configs.
 * Checking for suitable kernel configuration options ...
 *   CONFIG_XEN:    is not set when it should be.
 *   CONFIG_SCHED_MUQSS:    is not set when it should be.
 *   CONFIG_SCHED_BMQ:  is not set when it should be.
 *   CONFIG_SCHED_PDS:  is not set when it should be.                                                                                                                                                                                                                     [ !! ]
 * Please check to make sure these options are set correctly.
 * Failure to do so may cause unexpected problems.
>>> Unpacking source...
>>> Unpacking corefreq-1.96.2.tar.gz to /var/tmp/portage/sys-apps/corefreq-1.96.2/work
>>> Source unpacked in /var/tmp/portage/sys-apps/corefreq-1.96.2/work
>>> Preparing source in /var/tmp/portage/sys-apps/corefreq-1.96.2/work/corefreq-1.96.2 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-apps/corefreq-1.96.2/work/corefreq-1.96.2 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-apps/corefreq-1.96.2/work/corefreq-1.96.2 ...
ln: failed to create symbolic link 'Module.symvers': File exists
 * Preparing corefreqk module
make -j8 HOSTCC=x86_64-pc-linux-gnu-gcc 'LDFLAGS=-m elf_x86_64' clean all 
rm -f corefreqd corefreq-cli
cc  -Wall -Wfatal-errors -pthread -c corefreqd.c \
  -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
  -o corefreqd.o
cc  -Wall -Wfatal-errors -c corefreqm.c \
  -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
  -o corefreqm.o
cc  -Wall -Wfatal-errors -c corefreq-cli.c \
  -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1  \
  -o corefreq-cli.o
make -j1 -C /lib/modules/6.1.12-gentoo+/build M=/var/tmp/portage/sys-apps/corefreq-1.96.2/work/corefreq-1.96.2 clean
cc  -Wall -Wfatal-errors -c corefreq-ui.c \
  -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
  -o corefreq-ui.o
cc  -Wall -Wfatal-errors -c corefreq-cli-rsc.c \
  -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1  \
  -o corefreq-cli-rsc.o
cc  -Wall -Wfatal-errors -c corefreq-cli-json.c \
  -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
  -o corefreq-cli-json.o
cc  -Wall -Wfatal-errors -c corefreq-cli-extra.c \
  -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
  -o corefreq-cli-extra.o
make[1]: Entering directory '/usr/src/linux-6.1.12-gentoo'
make[1]: warning: -j1 forced in submake: resetting jobserver mode.
make[1]: Leaving directory '/usr/src/linux-6.1.12-gentoo'
cc  -Wall -Wfatal-errors corefreqd.c corefreqm.c \
  -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
  -o corefreqd -lpthread -lm -lrt
cc  -Wall -Wfatal-errors \
  corefreq-cli.c corefreq-ui.c corefreq-cli-rsc.c \
  corefreq-cli-json.c corefreq-cli-extra.c \
  -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1  \
  -o corefreq-cli -lm -lrt
make -j1 -C /lib/modules/6.1.12-gentoo+/build M=/var/tmp/portage/sys-apps/corefreq-1.96.2/work/corefreq-1.96.2 modules
make[1]: Entering directory '/usr/src/linux-6.1.12-gentoo'
make[1]: warning: -j1 forced in submake: resetting jobserver mode.
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Gentoo 12.2.1_p20230121-r1 p10) 12.2.1 20230121
  You are using:           x86_64-pc-linux-gnu-gcc (Gentoo 12.2.1_p20230428-r1 p2) 12.2.1 20230428
make[1]: Leaving directory '/usr/src/linux-6.1.12-gentoo'
>>> Source compiled.
>>> Test phase [not enabled]: sys-apps/corefreq-1.96.2

>>> Install sys-apps/corefreq-1.96.2 into /var/tmp/portage/sys-apps/corefreq-1.96.2/image
 * Installing corefreqk module
make -j8 -j1 PREFIX=/var/tmp/portage/sys-apps/corefreq-1.96.2/image/usr install 
make -C /lib/modules/6.1.12-gentoo+/build M=/var/tmp/portage/sys-apps/corefreq-1.96.2/work/corefreq-1.96.2 modules_install
Makefile:768: arch/amd64/Makefile: No such file or directory
make[1]: *** No rule to make target 'arch/amd64/Makefile'.  Stop.
make: *** [Makefile:96: module-install] Error 2

I am on laptop with Intel CPU, maybe AMD-something if disabled on my system.

Gentoo Linux.

cyring commented 1 year ago

Why many compilations are done again and again ?

First make sure everything works ok with the provided source code. Your Port has to do the followings.

  1. Pull or download CoreFreq source code
  2. Build the project simply as below:
    make clean all
  3. Install the binaries and start CoreFreq:
    ## as root
    make install
    depmod
    modprobe corefreqk
    systemctl daemon-reload
    systemctl start corefreqd
    ## as a user
    corefreq-cli
vitaly-zdanevich commented 1 year ago

Compilation outside of ebuild is ok, so, looks like something with the ebuild, I will investigate...