likwid: init at 5.3.0

authored by Vincent Laporte and committed by Vincent Laporte ffe76ea5 496ad23c

+85
+20
pkgs/by-name/li/likwid/cat-grep-sort-wc.patch
···
··· 1 + --- a/src/access-daemon/accessDaemon.c 2024-01-10 14:26:18.519538418 +0100 2 + +++ b/src/access-daemon/accessDaemon.c 2024-01-10 14:30:44.090278291 +0100 3 + @@ -201,7 +201,7 @@ 4 + static int getNumberOfCPUs() 5 + { 6 + FILE* fpipe = NULL; 7 + - char cmd[1024] = "cat /proc/cpuinfo | grep \"processor\" | sort -u | wc -l"; 8 + + char cmd[1024] = "@coreutils@cat /proc/cpuinfo | @gnugrep@grep \"processor\" | @coreutils@sort -u | @coreutils@wc -l"; 9 + char buff[1024]; 10 + if ( !(fpipe = popen(cmd,"r")) ) 11 + { 12 + @@ -219,7 +219,7 @@ 13 + static int getNumberOfSockets() 14 + { 15 + FILE* fpipe = NULL; 16 + - char cmd[1024] = "cat /proc/cpuinfo | grep \"physical id\" | sort -u | wc -l"; 17 + + char cmd[1024] = "@coreutils@cat /proc/cpuinfo | @gnugrep@grep \"physical id\" | @coreutils@sort -u | @coreutils@wc -l"; 18 + char buff[1024]; 19 + if ( !(fpipe = popen(cmd,"r")) ) 20 + {
+20
pkgs/by-name/li/likwid/nosetuid.patch
···
··· 1 + --- a/Makefile 2024-01-10 13:49:40.225104028 +0100 2 + +++ b/Makefile 2024-01-10 13:50:25.660033418 +0100 3 + @@ -393,7 +393,7 @@ 4 + install_daemon: 5 + @echo "===> INSTALL access daemon to $(ACCESSDAEMON)" 6 + @mkdir -p `dirname $(ACCESSDAEMON)` 7 + - install -m 4755 $(INSTALL_CHOWN) $(DAEMON_TARGET) $(ACCESSDAEMON) 8 + + install -m 755 $(DAEMON_TARGET) $(ACCESSDAEMON) 9 + move_daemon: 10 + @echo "===> MOVE access daemon from $(ACCESSDAEMON) to $(INSTALLED_ACCESSDAEMON)" 11 + @mkdir -p `dirname $(INSTALLED_ACCESSDAEMON)` 12 + @@ -430,7 +430,7 @@ 13 + install_freq: 14 + @echo "===> INSTALL setFrequencies tool to $(SBINPREFIX)/$(FREQ_TARGET)" 15 + @mkdir -p $(SBINPREFIX) 16 + - @install -m 4755 $(INSTALL_CHOWN) $(FREQ_TARGET) $(SBINPREFIX)/$(FREQ_TARGET) 17 + + @install -m 755 $(FREQ_TARGET) $(SBINPREFIX)/$(FREQ_TARGET) 18 + move_freq: 19 + @echo "===> MOVE setFrequencies tool from $(SBINPREFIX)/$(FREQ_TARGET) to $(INSTALLED_SBINPREFIX)/$(FREQ_TARGET)" 20 + @mkdir -p $(INSTALLED_SBINPREFIX)
+45
pkgs/by-name/li/likwid/package.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , perl 5 + , substituteAll 6 + , coreutils 7 + , gnugrep 8 + }: 9 + 10 + stdenv.mkDerivation rec { 11 + pname = "likwid"; 12 + version = "5.3.0"; 13 + 14 + src = fetchurl { 15 + url = "https://ftp.fau.de/pub/likwid/likwid-${version}.tar.gz"; 16 + hash = "sha256-wpDlVMQlMSSsKriwVuFO5NI5ZrjJ+/oQuoH3WuVDzk4="; 17 + }; 18 + 19 + nativeBuildInputs = [ perl ]; 20 + 21 + hardeningDisable = [ "format" ]; 22 + 23 + patches = [ 24 + ./nosetuid.patch 25 + (substituteAll { 26 + src = ./cat-grep-sort-wc.patch; 27 + coreutils = "${coreutils}/bin/"; 28 + gnugrep = "${gnugrep}/bin/"; 29 + }) 30 + ]; 31 + 32 + postPatch = "patchShebangs bench/ perl/"; 33 + 34 + makeFlags = [ "PREFIX=$(out)" ]; 35 + 36 + meta = with lib; { 37 + homepage = "https://hpc.fau.de/research/tools/likwid/"; 38 + description = "Performance monitoring and benchmarking suite"; 39 + license = licenses.gpl3Only; 40 + # Might work on ARM by appropriately setting COMPILER in config.mk 41 + platforms = intersectLists platforms.linux platforms.x86; 42 + maintainers = [ maintainers.vbgl ]; 43 + mainProgram = "likwid-perfctr"; 44 + }; 45 + }