From b499123dcbec8f1529187d23e1eb0be74a2850e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Bon=C3=A9?= Date: Mon, 29 Sep 2025 15:18:53 +0200 Subject: [PATCH] Disable papi when cross compiling Even if we do an override to papi get the proper configure flags for cross-compiling, the memory fences are not defined for risc-v: mb.h:67:2: error: #error Need to define rmb for this architecture! --- pkgs/extrae/default.nix | 3 ++- pkgs/nanos6/default.nix | 7 +++---- pkgs/nosv/default.nix | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/extrae/default.nix b/pkgs/extrae/default.nix index 2ceec916..a6827076 100644 --- a/pkgs/extrae/default.nix +++ b/pkgs/extrae/default.nix @@ -20,6 +20,7 @@ #, python3Packages , installShellFiles , symlinkJoin +, enablePapi ? stdenv.hostPlatform == stdenv.buildPlatform # Disabled when cross-compiling }: let @@ -87,7 +88,7 @@ stdenv.mkDerivation rec { --enable-sampling --with-unwind=${libunwind.dev} --with-xml-prefix=${libxml2.dev} - --with-papi=${papi} + ${lib.optionalString enablePapi "--with-papi=${papi}"} ${if (mpi != null) then ''--with-mpi=${mpi}'' else ''--without-mpi''} --without-dyninst) diff --git a/pkgs/nanos6/default.nix b/pkgs/nanos6/default.nix index 64ee2888..c419f2d9 100644 --- a/pkgs/nanos6/default.nix +++ b/pkgs/nanos6/default.nix @@ -16,6 +16,7 @@ , jemallocNanos6 ? null , cachelineBytes ? 64 , enableGlibcxxDebug ? false +, enablePapi ? stdenv.hostPlatform == stdenv.buildPlatform # Disabled when cross-compiling , useGit ? false , gitUrl ? "ssh://git@bscpm04.bsc.es/nanos6/nanos6" , gitBranch ? "master" @@ -97,16 +98,14 @@ in # TODO: papi_version is needed for configure: # ./configure: line 27378: papi_version: command not found # This probably breaks cross-compilation - papi - ]; + ] ++ lib.optionals enablePapi [ papi ]; buildInputs = [ boost numactl hwloc - papi ovni - ]; + ] ++ lib.optionals enablePapi [ papi ]; # Create a script that sets NANOS6_HOME postInstall = '' diff --git a/pkgs/nosv/default.nix b/pkgs/nosv/default.nix index 0c02fc99..1b33e03d 100644 --- a/pkgs/nosv/default.nix +++ b/pkgs/nosv/default.nix @@ -7,7 +7,7 @@ , numactl , hwloc , papi -, enablePapi ? true +, enablePapi ? stdenv.hostPlatform == stdenv.buildPlatform # Disabled when cross-compiling , cacheline ? 64 # bits , ovni ? null , useGit ? false