From 3a249c5d88726c4fd32a50bf63160e3ab8298ef9 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 30 May 2023 14:51:36 +0200 Subject: [PATCH] Update nanos6 and merge release with git --- bsc/nanos6/clock-monotonic.patch | 21 ------ bsc/nanos6/default.nix | 107 ++++++++++++++++++------------- bsc/nanos6/git.nix | 64 ------------------ overlay.nix | 5 +- 4 files changed, 67 insertions(+), 130 deletions(-) delete mode 100644 bsc/nanos6/clock-monotonic.patch delete mode 100644 bsc/nanos6/git.nix diff --git a/bsc/nanos6/clock-monotonic.patch b/bsc/nanos6/clock-monotonic.patch deleted file mode 100644 index b05b17b..0000000 --- a/bsc/nanos6/clock-monotonic.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/src/instrument/ctf/ctfapi/CTFClock.hpp b/src/instrument/ctf/ctfapi/CTFClock.hpp -index 7df821c9..27cf269b 100644 ---- a/src/instrument/ctf/ctfapi/CTFClock.hpp -+++ b/src/instrument/ctf/ctfapi/CTFClock.hpp -@@ -9,13 +9,9 @@ - - #include - --// We prefer CLOCK_MONOTONIC_RAW to prevent dynamic NTF time adjustments. --// However, if the system does not support it, we fall back to CLOCK_MONOTONIC -- --#ifdef CLOCK_MONOTONIC_RAW --#define CTF_CLOCK CLOCK_MONOTONIC_RAW --#else -+// Always use the CLOCK_MONOTONIC clock as it is drift-corrected by NTP, -+// and is the most reliable to compensate changes the oscillator -+// frequency. It is not affected by time jumps. - #define CTF_CLOCK CLOCK_MONOTONIC --#endif - - #endif // CTF_CLOCK_HPP diff --git a/bsc/nanos6/default.nix b/bsc/nanos6/default.nix index eeb7925..de0d8e4 100644 --- a/bsc/nanos6/default.nix +++ b/bsc/nanos6/default.nix @@ -15,61 +15,82 @@ , jemalloc ? null , cachelineBytes ? 64 , enableGlibcxxDebug ? false +, useGit ? false +, gitUrl ? "ssh://git@bscpm03.bsc.es/nanos6/nanos6" +, gitBranch ? "master" +, gitCommit ? "58712e669ac02f721fb841247361ea54f53a6a47" }: assert enableJemalloc -> (jemalloc != null); with lib; -stdenv.mkDerivation rec { - pname = "nanos6"; - version = "3.0"; - - src = fetchFromGitHub { - owner = "bsc-pm"; - repo = "nanos6"; - rev = "version-${version}"; - sha256 = "sha256-XEG8/8yQv5/OdSyK9Kig8xuWe6mTZ1eQKhXx3fXlQ1Y="; +let + release = rec { + version = "3.0"; + src = fetchFromGitHub { + owner = "bsc-pm"; + repo = "nanos6"; + rev = "version-${version}"; + sha256 = "sha256-XEG8/8yQv5/OdSyK9Kig8xuWe6mTZ1eQKhXx3fXlQ1Y="; + }; }; - prePatch = '' - patchShebangs scripts/generate_config.sh - patchShebangs autogen.sh - ''; + git = rec { + version = src.shortRev; + src = builtins.fetchGit { + url = gitUrl; + ref = gitBranch; + rev = gitCommit; + }; + }; - enableParallelBuilding = true; + source = if (useGit) then git else release; +in + stdenv.mkDerivation rec { + pname = "nanos6"; + inherit (source) src version; - preConfigure = '' - export CACHELINE_WIDTH=${toString cachelineBytes} - ./autogen.sh - ''; + prePatch = '' + patchShebangs scripts/generate_config.sh + patchShebangs autogen.sh + ''; - configureFlags = [ - "--with-hwloc=${hwloc}" - "--disable-all-instrumentations" - "--enable-ovni-instrumentation" - "--with-ovni=${ovni}" - ] ++ - (optional enableJemalloc "--with-jemalloc=${jemalloc}") ++ - (optional enableGlibcxxDebug "CXXFLAGS=-D_GLIBCXX_DEBUG"); + enableParallelBuilding = true; - # The "bindnow" flags are incompatible with ifunc resolution mechanism. We - # disable all by default, which includes bindnow. - hardeningDisable = [ "all" ]; + preConfigure = '' + export CACHELINE_WIDTH=${toString cachelineBytes} + ./autogen.sh + '' + lib.optionalString (useGit) '' + export NANOS6_GIT_VERSION=${src.rev} + export NANOS6_GIT_BRANCH=${gitBranch} + ''; - # Keep debug symbols in the verbose variant of the library - dontStrip = true; + configureFlags = [ + "--with-hwloc=${hwloc}" + "--disable-all-instrumentations" + "--enable-ovni-instrumentation" + "--with-ovni=${ovni}" + ] ++ + (optional enableJemalloc "--with-jemalloc=${jemalloc}") ++ + (optional enableGlibcxxDebug "CXXFLAGS=-D_GLIBCXX_DEBUG"); - buildInputs = [ - autoconf - automake - libtool - pkg-config - boost - numactl - hwloc - papi - ovni - ]; + # The "bindnow" flags are incompatible with ifunc resolution mechanism. We + # disable all by default, which includes bindnow. + hardeningDisable = [ "all" ]; -} + # Keep debug symbols in the verbose variant of the library + dontStrip = true; + + buildInputs = [ + autoconf + automake + libtool + pkg-config + boost + numactl + hwloc + papi + ovni + ]; + } diff --git a/bsc/nanos6/git.nix b/bsc/nanos6/git.nix deleted file mode 100644 index b512eff..0000000 --- a/bsc/nanos6/git.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ - stdenv -, lib -, automake -, autoconf -, libtool -, pkg-config -, perl -, numactl -, hwloc -, papi -, boost -, enableJemalloc ? true -, jemalloc ? null -, cachelineBytes ? 64 -, enableGlibcxxDebug ? false -, gitUrl ? "ssh://git@bscpm03.bsc.es/nanos6/nanos6" -, gitBranch ? "master" -}: - -with lib; - -stdenv.mkDerivation rec { - pname = "nanos6"; - version = "${src.shortRev}"; - - src = builtins.fetchGit { - url = gitUrl; - ref = gitBranch; - }; - - prePatch = '' - patchShebangs scripts/generate_config.sh - patchShebangs autogen.sh - ''; - - enableParallelBuilding = true; - dontStrip = true; - - preConfigure = '' - export CACHELINE_WIDTH=${toString cachelineBytes} - export NANOS6_GIT_VERSION=${src.rev} - export NANOS6_GIT_BRANCH=${gitBranch} - ./autogen.sh - ''; - - configureFlags = [ "--with-hwloc=${hwloc}" ] - ++ (optional enableJemalloc "--with-jemalloc=${jemalloc}") - ++ (optional enableGlibcxxDebug "CXXFLAGS=-D_GLIBCXX_DEBUG"); - - # The "bindnow" flags are incompatible with ifunc resolution mechanism. We - # disable all by default, which includes bindnow. - hardeningDisable = [ "all" ]; - - buildInputs = [ - autoconf - automake - libtool - pkg-config - boost - numactl - hwloc - papi ]; -} diff --git a/overlay.nix b/overlay.nix index 4247be6..d4a0aae 100644 --- a/overlay.nix +++ b/overlay.nix @@ -118,13 +118,14 @@ let }) { CC = "clang"; CXX = "clang++"; }; stdenvClangOmpss2 = self.stdenv.override { - cc = bsc.clangOmpss2Git; + cc = bsc.clangOmpss2; allowedRequisites = null; }; clangNodes = bsc.clangOmpss2Git.override { rt = bsc.nodes; }; + stdenvClangNodes = self.stdenv.override { cc = bsc.clangNodes; allowedRequisites = null; @@ -142,7 +143,7 @@ let # ================================================================= nanos6 = bsc.nanos6Release; nanos6Release = callPackage ./bsc/nanos6/default.nix { }; - nanos6Git = callPackage ./bsc/nanos6/git.nix { }; + nanos6Git = callPackage ./bsc/nanos6/default.nix { useGit = true; }; nanos6-icx = bsc.nanos6.override { stdenv = bsc.intel2023.stdenv; };