Project

General

Profile

Actions

Bug #336

open

Intelmetool makefile problem

Added by Max Mustermann almost 3 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
02/02/2022
Due date:
% Done:

0%

Estimated time:
Affected versions:
Needs backport to:
Affected hardware:
Affected OS:

Description

make states, that pci and zlib libraries are not installed, but they are. I guess, theres a problem regarding the makefile?
I tried it with Debian 11 (Bullseye) and Ubuntu 20.04 (Focal Fossa).

Can anyone confirm this issue?

Actions #1

Updated by Idwer Vollering almost 3 years ago

Yes, this is odd. Did you install the debian/ubuntu package 'build-essential'?

Can you run, and paste the output, from:
1) dpkg -l | egrep 'libpci|zlib'
2) in the util/intelmetool/ directory: make --trace

The expected outcome is:

$ make --trace
Makefile:64: target 'pciutils' does not exist
printf "\nChecking for development libraries: pci and zlib... "

Checking for development libraries: pci and zlib... echo "$LIBPCI_TEST" > .test.c
cc -O0 -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function .test.c -o .test -lpci -lz >/dev/null 2>&1 && \
printf "found.\n" || ( printf "not found.\n\n"; \
printf "For RPM based distributions like Fedora, please install pciutils-devel and zlib-devel.\n"; \
printf "For DEB based distributions, please install libpci-dev and zlib1g-dev.\n"; \
rm -f .test.c .test; exit 1)
found.
rm -rf .test.c .test .test.dSYM
Makefile:42: target 'dep' does not exist
cc -O0 -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -MM *.c > .dependencies
: update target 'intelmetool.o' due to: intelmetool.c
cc -O0 -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -c -o intelmetool.o intelmetool.c
: update target 'me.o' due to: me.c
cc -O0 -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -c -o me.o me.c
: update target 'me_status.o' due to: me_status.c
cc -O0 -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -c -o me_status.o me_status.c
: update target 'mmap.o' due to: mmap.c
cc -O0 -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -c -o mmap.o mmap.c
: update target 'rcba.o' due to: rcba.c
cc -O0 -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -c -o rcba.o rcba.c
: update target 'msr.o' due to: msr.c
cc -O0 -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -c -o msr.o msr.c
Makefile:33: update target 'intelmetool' due to: intelmetool.o me.o me_status.o mmap.o rcba.o msr.o
cc -O0 -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -o intelmetool intelmetool.o me.o me_status.o mmap.o rcba.o msr.o -lpci -lz

Actions #2

Updated by Max Mustermann almost 3 years ago

Idwer Vollering wrote:

Yes, this is odd. Did you install the debian/ubuntu package 'build-essential'?

Can you run, and paste the output, from:
1) dpkg -l | egrep 'libpci|zlib'
2) in the util/intelmetool/ directory: make --trace

The expected outcome is:

I was able to track the issue by editing the makefile:

pciutils:
@printf "\nChecking for development libraries: pci and zlib... "
@echo "$$LIBPCI_TEST" > .test.c
@$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) >/dev/null 2>&1 && \
printf "found.\n" || ( printf "not found.\n\n"; \
printf "For RPM based distributions like Fedora, please install pciutils-devel and zlib-devel.\n"; \
printf "For DEB based distributions, please install libpci-dev and zlib1g-dev.\n"; \
rm -f .test.c .test; exit 1)
@rm -rf .test.c .test .test.dSYM

I removed /dev/null 2>&1 to see the output:

Checking for development libraries: pci and zlib... /bin.sh: 1: cc: not found
not found

ubuntu@ubuntu:~/coreboot/util/intelmetool$ sudo update-alternatives --config cc
update-alternatives: error: no alternatives for cc

I don't had 'build-essential' installed. I usually never build anything. First time for me.
So yeah... after installing 'build-essential' everything worked as expected.
Could you please update the makefile and give a hint, that 'build-essential' has to be installed as well?
As a linux newbie, it took me a lot of time and external help to find the issue.

Thank you :)

BR
Max

Actions #3

Updated by Max Mustermann almost 3 years ago

Sorry, i wasn't aware about the wiki. It clearly states, that gcc is necessary.
https://www.coreboot.org/Build_HOWTO#Requirements

I still would appreciate if you could update the makefile, since "libpci-dev and zlib1g-dev not found" is incorrect/imprecise.

Actions

Also available in: Atom PDF