2021-05-12 14:28:10 +02:00
# Use central installation
2021-11-25 17:51:34 +01:00
CENTRAL_INSTALL = false
# How to access hardware performance counters through LIKWID.
# Recommended is 'direct' mode
ACCESSMODE = direct
2021-05-12 14:28:10 +02:00
2021-11-25 17:51:34 +01:00
#######################################################################
# if CENTRAL_INSTALL == true
#######################################################################
2021-05-12 14:28:10 +02:00
# Path to central installation (if CENTRAL_INSTALL=true)
2022-01-19 15:55:15 +01:00
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
2021-11-25 15:11:39 +01:00
#######################################################################
2021-11-25 17:51:34 +01:00
# if CENTRAL_INSTALL == false and ACCESSMODE == accessdaemon
2021-11-25 15:11:39 +01:00
#######################################################################
2021-11-25 17:51:34 +01:00
# Where to install the accessdaemon
DAEMON_INSTALLDIR = /usr/local
# Which user to use for the accessdaemon
DAEMON_USER = root
# Which group to use for the accessdaemon
DAEMON_GROUP = root
2021-03-27 13:39:43 +01:00
2021-05-12 14:28:10 +02:00
2021-03-27 13:39:43 +01:00
#################################################
# No need to change anything below this line
#################################################
2021-03-27 12:44:11 +01:00
INSTALL_FOLDER = ./likwid
BUILD_FOLDER = ./likwid/build
2021-05-12 14:28:10 +02:00
i f n e q ( $( strip $ ( CENTRAL_INSTALL ) ) , t r u e )
LIKWID_BASE := $( shell pwd ) /$( INSTALL_FOLDER)
DAEMON_BASE := $( LIKWID_BASE)
GROUPS_BASE := $( LIKWID_BASE) /groups
2021-11-25 17:51:34 +01:00
all : $( INSTALL_FOLDER ) /liblikwid .a cleanup
2021-05-12 14:28:10 +02:00
e l s e
DAEMON_BASE = $( LIKWID_BASE) /sbin
2021-11-25 17:51:34 +01:00
all : $( INSTALL_FOLDER ) /liblikwid .a cleanup
2021-05-12 14:28:10 +02:00
e n d i f
2021-03-27 12:44:11 +01:00
$(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)
2021-05-12 14:28:10 +02:00
$(INSTALL_FOLDER) :
mkdir -p $( INSTALL_FOLDER)
2021-03-27 12:44:11 +01:00
$(BUILD_FOLDER)/likwid-$(LIKWID_VERSION) : $( BUILD_FOLDER ) /likwid -$( LIKWID_VERSION ) .tar .gz
tar -C $( BUILD_FOLDER) -xf $( BUILD_FOLDER) /likwid-$( LIKWID_VERSION) .tar.gz
2021-05-12 14:28:10 +02:00
$(INSTALL_FOLDER)/liblikwid.a : $( BUILD_FOLDER ) /likwid -$( LIKWID_VERSION ) $( INSTALL_FOLDER )
2022-03-01 15:39:26 +01:00
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)
2021-05-12 14:28:10 +02:00
2021-11-25 17:51:34 +01:00
$(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
2021-03-27 12:44:11 +01:00
2021-05-12 14:28:10 +02:00
prepare_collector : likwidMetric .go
cp likwidMetric.go likwidMetric.go.orig
sed -i -e s+"const GROUPPATH =.*" +" const GROUPPATH = \` $( GROUPS_BASE) \` " +g likwidMetric.go
2021-03-27 12:44:11 +01:00
cleanup :
rm -rf $( BUILD_FOLDER)
2021-11-25 15:11:39 +01:00
clean : cleanup
rm -rf likwid
.PHONY : clean