2022-03-05 17:30:40 +01:00
|
|
|
# LIKWID version
|
2024-12-19 23:00:14 +01:00
|
|
|
LIKWID_VERSION := 5.4.1
|
2023-08-29 14:12:49 +02:00
|
|
|
LIKWID_INSTALLED_FOLDER := $(shell dirname $$(which likwid-topology 2>/dev/null) 2>/dev/null)
|
2022-05-13 13:14:47 +02:00
|
|
|
|
2023-08-29 14:12:49 +02:00
|
|
|
LIKWID_FOLDER := $(CURDIR)/likwid
|
2022-05-13 13:14:47 +02:00
|
|
|
|
2023-08-29 14:12:49 +02:00
|
|
|
all: likwid
|
2021-11-25 15:11:39 +01:00
|
|
|
|
2022-03-05 17:30:40 +01:00
|
|
|
.ONESHELL:
|
2023-08-29 14:12:49 +02:00
|
|
|
.PHONY: likwid
|
|
|
|
likwid:
|
|
|
|
if [ -n "$(LIKWID_INSTALLED_FOLDER)" ]; then
|
|
|
|
# Using likwid include files from system installation
|
|
|
|
INCLUDE_DIR="$(LIKWID_INSTALLED_FOLDER)/../include"
|
|
|
|
mkdir --parents --verbose "$(LIKWID_FOLDER)"
|
|
|
|
cp "$${INCLUDE_DIR}"/*.h "$(LIKWID_FOLDER)"
|
|
|
|
else
|
|
|
|
# Using likwid include files from downloaded tar archive
|
|
|
|
if [ -d "$(LIKWID_FOLDER)" ]; then
|
|
|
|
rm --recursive "$(LIKWID_FOLDER)"
|
|
|
|
fi
|
|
|
|
BUILD_FOLDER="$${PWD}/likwidbuild"
|
|
|
|
mkdir --parents --verbose "$${BUILD_FOLDER}"
|
|
|
|
wget --output-document=- http://ftp.rrze.uni-erlangen.de/mirrors/likwid/likwid-$(LIKWID_VERSION).tar.gz |
|
|
|
|
tar --directory="$${BUILD_FOLDER}" --extract --gz
|
2024-12-19 23:00:14 +01:00
|
|
|
install -D --verbose --preserve-timestamps --mode=0644 --target-directory="$(LIKWID_FOLDER)" "$${BUILD_FOLDER}/likwid-$(LIKWID_VERSION)/src/includes"/likwid*.h
|
2023-08-29 14:12:49 +02:00
|
|
|
rm --recursive "$${BUILD_FOLDER}"
|
2022-05-13 13:14:47 +02:00
|
|
|
fi
|
2022-03-05 17:30:40 +01:00
|
|
|
|
|
|
|
|
2023-08-29 14:12:49 +02:00
|
|
|
.PHONY: clean
|
2022-03-05 17:30:40 +01:00
|
|
|
clean:
|
2021-11-25 15:11:39 +01:00
|
|
|
rm -rf likwid
|