mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-11-10 12:37:25 +01:00
Just download LIKWID to get the headers (#54)
* Just download LIKWID to get the headers * Remove perl-Data-Dumper from BuildRequires, only required by LIKWID build
This commit is contained in:
parent
21864e0ac4
commit
f2486abeab
@ -1,79 +1,25 @@
|
|||||||
# Use central installation
|
|
||||||
CENTRAL_INSTALL = false
|
|
||||||
# How to access hardware performance counters through LIKWID.
|
|
||||||
# Recommended is 'direct' mode
|
|
||||||
ACCESSMODE = direct
|
|
||||||
|
|
||||||
#######################################################################
|
all: likwid
|
||||||
# if CENTRAL_INSTALL == true
|
|
||||||
#######################################################################
|
|
||||||
# Path to central installation (if CENTRAL_INSTALL=true)
|
# LIKWID version
|
||||||
LIKWID_BASE=/apps/likwid/5.2.1
|
|
||||||
# LIKWID version (should be same major version as central installation, 5.2.x)
|
|
||||||
LIKWID_VERSION = 5.2.1
|
LIKWID_VERSION = 5.2.1
|
||||||
|
|
||||||
#######################################################################
|
.ONESHELL:
|
||||||
# if CENTRAL_INSTALL == false and ACCESSMODE == accessdaemon
|
.PHONY: likwid
|
||||||
#######################################################################
|
likwid:
|
||||||
# Where to install the accessdaemon
|
INSTALL_FOLDER="$${PWD}/likwid"
|
||||||
DAEMON_INSTALLDIR = /usr/local
|
BUILD_FOLDER="$${PWD}/likwidbuild"
|
||||||
# Which user to use for the accessdaemon
|
if [ -d $${INSTALL_FOLDER} ]; then rm -r $${INSTALL_FOLDER}; fi
|
||||||
DAEMON_USER = root
|
mkdir --parents --verbose $${INSTALL_FOLDER} $${BUILD_FOLDER}
|
||||||
# Which group to use for the accessdaemon
|
wget -P "$${BUILD_FOLDER}" ftp://ftp.rrze.uni-erlangen.de/mirrors/likwid/likwid-$(LIKWID_VERSION).tar.gz
|
||||||
DAEMON_GROUP = root
|
tar -C $${BUILD_FOLDER} -xf $${BUILD_FOLDER}/likwid-$(LIKWID_VERSION).tar.gz
|
||||||
|
install -Dpm 0644 $${BUILD_FOLDER}/likwid-$(LIKWID_VERSION)/src/includes/likwid*.h $${INSTALL_FOLDER}/
|
||||||
|
install -Dpm 0644 $${BUILD_FOLDER}/likwid-$(LIKWID_VERSION)/src/includes/bstrlib.h $${INSTALL_FOLDER}/
|
||||||
|
rm -r $${BUILD_FOLDER}
|
||||||
|
|
||||||
|
|
||||||
|
clean:
|
||||||
#################################################
|
|
||||||
# No need to change anything below this line
|
|
||||||
#################################################
|
|
||||||
INSTALL_FOLDER = ./likwid
|
|
||||||
BUILD_FOLDER = ./likwid/build
|
|
||||||
|
|
||||||
ifneq ($(strip $(CENTRAL_INSTALL)),true)
|
|
||||||
LIKWID_BASE := $(shell pwd)/$(INSTALL_FOLDER)
|
|
||||||
DAEMON_BASE := $(LIKWID_BASE)
|
|
||||||
GROUPS_BASE := $(LIKWID_BASE)/groups
|
|
||||||
all: $(INSTALL_FOLDER)/liblikwid.a cleanup
|
|
||||||
else
|
|
||||||
DAEMON_BASE= $(LIKWID_BASE)/sbin
|
|
||||||
all: $(INSTALL_FOLDER)/liblikwid.a cleanup
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(BUILD_FOLDER)/likwid-$(LIKWID_VERSION).tar.gz: $(BUILD_FOLDER)
|
|
||||||
wget -P $(BUILD_FOLDER) ftp://ftp.rrze.uni-erlangen.de/mirrors/likwid/likwid-$(LIKWID_VERSION).tar.gz
|
|
||||||
|
|
||||||
$(BUILD_FOLDER):
|
|
||||||
mkdir -p $(BUILD_FOLDER)
|
|
||||||
|
|
||||||
$(INSTALL_FOLDER):
|
|
||||||
mkdir -p $(INSTALL_FOLDER)
|
|
||||||
|
|
||||||
$(BUILD_FOLDER)/likwid-$(LIKWID_VERSION): $(BUILD_FOLDER)/likwid-$(LIKWID_VERSION).tar.gz
|
|
||||||
tar -C $(BUILD_FOLDER) -xf $(BUILD_FOLDER)/likwid-$(LIKWID_VERSION).tar.gz
|
|
||||||
|
|
||||||
$(INSTALL_FOLDER)/liblikwid.a: $(BUILD_FOLDER)/likwid-$(LIKWID_VERSION) $(INSTALL_FOLDER)
|
|
||||||
cd "$(BUILD_FOLDER)/likwid-$(LIKWID_VERSION)" && make "PREFIX=$(LIKWID_BASE)" "SHARED_LIBRARY=false" "ACCESSMODE=$(ACCESSMODE)" "INSTALLED_ACCESSDAEMON=$(DAEMON_INSTALLDIR)/likwid-accessD"
|
|
||||||
cp \
|
|
||||||
$(BUILD_FOLDER)/likwid-$(LIKWID_VERSION)/liblikwid.a \
|
|
||||||
$(BUILD_FOLDER)/likwid-$(LIKWID_VERSION)/ext/hwloc/liblikwid-hwloc.a \
|
|
||||||
$(BUILD_FOLDER)/likwid-$(LIKWID_VERSION)/src/includes/likwid*.h \
|
|
||||||
$(BUILD_FOLDER)/likwid-$(LIKWID_VERSION)/src/includes/bstrlib.h \
|
|
||||||
$(INSTALL_FOLDER)
|
|
||||||
|
|
||||||
$(DAEMON_INSTALLDIR)/likwid-accessD: $(BUILD_FOLDER)/likwid-$(LIKWID_VERSION)/likwid-accessD
|
|
||||||
sudo -u $(DAEMON_USER) -g $(DAEMON_GROUP) install -m 4775 $(BUILD_FOLDER)/likwid-$(LIKWID_VERSION)/likwid-accessD $(DAEMON_INSTALLDIR)/likwid-accessD
|
|
||||||
|
|
||||||
prepare_collector: likwidMetric.go
|
|
||||||
cp likwidMetric.go likwidMetric.go.orig
|
|
||||||
sed -i -e s+"const GROUPPATH =.*"+"const GROUPPATH = \`$(GROUPS_BASE)\`"+g likwidMetric.go
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
rm -rf $(BUILD_FOLDER)
|
|
||||||
|
|
||||||
clean: cleanup
|
|
||||||
rm -rf likwid
|
rm -rf likwid
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
@ -8,8 +8,8 @@ Source0: %{name}-%{version}.tar.gz
|
|||||||
|
|
||||||
BuildRequires: go-toolset
|
BuildRequires: go-toolset
|
||||||
BuildRequires: systemd-rpm-macros
|
BuildRequires: systemd-rpm-macros
|
||||||
# for internal LIKWID installation
|
# for header downloads
|
||||||
BuildRequires: wget perl-Data-Dumper
|
BuildRequires: wget
|
||||||
|
|
||||||
Provides: %{name} = %{version}
|
Provides: %{name} = %{version}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user