Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get an error when make RPM #105

Open
Autumn-Roy opened this issue Aug 14, 2023 · 4 comments
Open

Get an error when make RPM #105

Autumn-Roy opened this issue Aug 14, 2023 · 4 comments

Comments

@Autumn-Roy
Copy link

Autumn-Roy commented Aug 14, 2023

I try to get a rpm package, but when I make it, there is an error.

My steps are:

  1. git clone https://github.com/ClusterCockpit/cc-metric-collector.git
  2. cd https://github.com/ClusterCockpit/cc-metric-collector.git
  3. make RPM

The error code is :

+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf cc-metric-collector-0.6.2_2_gf0da073
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/cc-metric-collector-0.6.2_2_gf0da073.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd cc-metric-collector-0.6.2_2_gf0da073
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.353hpQ
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd cc-metric-collector-0.6.2_2_gf0da073
+ make
make -C collectors
/usr/bin/go get
/usr/bin/go build -o cc-metric-collector cc-metric-collector.go
make[1]: Entering directory '/root/rpmbuild/BUILD/cc-metric-collector-0.6.2_2_gf0da073/collectors'
if [ "/usr/bin" != "" ]; then \
        BASE="/usr/bin/../include"; \
        mkdir -p "/root/rpmbuild/BUILD/cc-metric-collector-0.6.2_2_gf0da073/collectors/likwid"; \
        cp $BASE/*.h "/root/rpmbuild/BUILD/cc-metric-collector-0.6.2_2_gf0da073/collectors/likwid"; \
else \
        BUILD_FOLDER="${PWD}/likwidbuild"; \
        if [ -d "/root/rpmbuild/BUILD/cc-metric-collector-0.6.2_2_gf0da073/collectors/likwid" ]; then rm -r "/root/rpmbuild/BUILD/cc-metric-collector-0.6.2_2_gf0da073/collectors/likwid"; fi; \
        mkdir --parents --verbose  "/root/rpmbuild/BUILD/cc-metric-collector-0.6.2_2_gf0da073/collectors/likwid" ${BUILD_FOLDER}; \
        wget -P "${BUILD_FOLDER}" http://ftp.rrze.uni-erlangen.de/mirrors/likwid/likwid-5.2.1.tar.gz; \
        tar -C ${BUILD_FOLDER} -xf ${BUILD_FOLDER}/likwid-5.2.1.tar.gz; \
        install -Dpm 0644 ${BUILD_FOLDER}/likwid-5.2.1/src/includes/likwid*.h "/root/rpmbuild/BUILD/cc-metric-collector-0.6.2_2_gf0da073/collectors/likwid"/; \
        install -Dpm 0644 ${BUILD_FOLDER}/likwid-5.2.1/src/includes/bstrlib.h "/root/rpmbuild/BUILD/cc-metric-collector-0.6.2_2_gf0da073/collectors/likwid"/; \
        rm -r ${BUILD_FOLDER}; \
fi
make[1]: Leaving directory '/root/rpmbuild/BUILD/cc-metric-collector-0.6.2_2_gf0da073/collectors'
go: upgraded github.com/influxdata/influxdb-client-go/v2 v2.9.0 => v2.9.1
# github.com/ClusterCockpit/cc-metric-collector/collectors
collectors/likwidMetric.go:7:10: fatal error: likwid.h: No such file or directory
    7 | #include <likwid.h>
      |          ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:26: cc-metric-collector] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.353hpQ (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.353hpQ (%build)

@TomTheBear
Copy link
Member

The error comes from missing likwid.h header which should have been installed in the big if-else block. It seems LIKWID is installed in /usr/bin, so it wants to copy the likwid.h from /usr/include. According to the output there was no error, so somewhat surprising.

Does make work? The make RPM target uses make inside the rpmbuild step, so that's the basis of the whole installation.

@Autumn-Roy
Copy link
Author

The make doesn,t work, and occurred the same error with make RPM. So how can I solve this? I only install the basic likwid in /usr/bin.

@TomTheBear
Copy link
Member

After executing make, is there a file collectors/likwid/likwid.h? You can put it (and probably bstrlib.h) there yourself before calling make.

Which OS are you using?

@TomTheBear
Copy link
Member

Can you try whether fb48099 fixes your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants