likwid: init at 5.3.0

This commit is contained in:
Vincent Laporte 2024-01-10 11:54:02 +01:00 committed by Vincent Laporte
parent 496ad23caa
commit ffe76ea5e2
3 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,20 @@
--- a/src/access-daemon/accessDaemon.c 2024-01-10 14:26:18.519538418 +0100
+++ b/src/access-daemon/accessDaemon.c 2024-01-10 14:30:44.090278291 +0100
@@ -201,7 +201,7 @@
static int getNumberOfCPUs()
{
FILE* fpipe = NULL;
- char cmd[1024] = "cat /proc/cpuinfo | grep \"processor\" | sort -u | wc -l";
+ char cmd[1024] = "@coreutils@cat /proc/cpuinfo | @gnugrep@grep \"processor\" | @coreutils@sort -u | @coreutils@wc -l";
char buff[1024];
if ( !(fpipe = popen(cmd,"r")) )
{
@@ -219,7 +219,7 @@
static int getNumberOfSockets()
{
FILE* fpipe = NULL;
- char cmd[1024] = "cat /proc/cpuinfo | grep \"physical id\" | sort -u | wc -l";
+ char cmd[1024] = "@coreutils@cat /proc/cpuinfo | @gnugrep@grep \"physical id\" | @coreutils@sort -u | @coreutils@wc -l";
char buff[1024];
if ( !(fpipe = popen(cmd,"r")) )
{

View File

@ -0,0 +1,20 @@
--- a/Makefile 2024-01-10 13:49:40.225104028 +0100
+++ b/Makefile 2024-01-10 13:50:25.660033418 +0100
@@ -393,7 +393,7 @@
install_daemon:
@echo "===> INSTALL access daemon to $(ACCESSDAEMON)"
@mkdir -p `dirname $(ACCESSDAEMON)`
- install -m 4755 $(INSTALL_CHOWN) $(DAEMON_TARGET) $(ACCESSDAEMON)
+ install -m 755 $(DAEMON_TARGET) $(ACCESSDAEMON)
move_daemon:
@echo "===> MOVE access daemon from $(ACCESSDAEMON) to $(INSTALLED_ACCESSDAEMON)"
@mkdir -p `dirname $(INSTALLED_ACCESSDAEMON)`
@@ -430,7 +430,7 @@
install_freq:
@echo "===> INSTALL setFrequencies tool to $(SBINPREFIX)/$(FREQ_TARGET)"
@mkdir -p $(SBINPREFIX)
- @install -m 4755 $(INSTALL_CHOWN) $(FREQ_TARGET) $(SBINPREFIX)/$(FREQ_TARGET)
+ @install -m 755 $(FREQ_TARGET) $(SBINPREFIX)/$(FREQ_TARGET)
move_freq:
@echo "===> MOVE setFrequencies tool from $(SBINPREFIX)/$(FREQ_TARGET) to $(INSTALLED_SBINPREFIX)/$(FREQ_TARGET)"
@mkdir -p $(INSTALLED_SBINPREFIX)

View File

@ -0,0 +1,45 @@
{ lib
, stdenv
, fetchurl
, perl
, substituteAll
, coreutils
, gnugrep
}:
stdenv.mkDerivation rec {
pname = "likwid";
version = "5.3.0";
src = fetchurl {
url = "https://ftp.fau.de/pub/likwid/likwid-${version}.tar.gz";
hash = "sha256-wpDlVMQlMSSsKriwVuFO5NI5ZrjJ+/oQuoH3WuVDzk4=";
};
nativeBuildInputs = [ perl ];
hardeningDisable = [ "format" ];
patches = [
./nosetuid.patch
(substituteAll {
src = ./cat-grep-sort-wc.patch;
coreutils = "${coreutils}/bin/";
gnugrep = "${gnugrep}/bin/";
})
];
postPatch = "patchShebangs bench/ perl/";
makeFlags = [ "PREFIX=$(out)" ];
meta = with lib; {
homepage = "https://hpc.fau.de/research/tools/likwid/";
description = "Performance monitoring and benchmarking suite";
license = licenses.gpl3Only;
# Might work on ARM by appropriately setting COMPILER in config.mk
platforms = intersectLists platforms.linux platforms.x86;
maintainers = [ maintainers.vbgl ];
mainProgram = "likwid-perfctr";
};
}