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!
		
			
				
	
	
		
			63 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
{
 | 
						|
  stdenv
 | 
						|
, lib
 | 
						|
, autoreconfHook
 | 
						|
, fetchFromGitHub
 | 
						|
, pkg-config
 | 
						|
, numactl
 | 
						|
, hwloc
 | 
						|
, papi
 | 
						|
, enablePapi ? stdenv.hostPlatform == stdenv.buildPlatform # Disabled when cross-compiling
 | 
						|
, cacheline ? 64 # bits
 | 
						|
, ovni ? null
 | 
						|
, useGit ? false
 | 
						|
, gitUrl ? "git@gitlab-internal.bsc.es:nos-v/nos-v.git"
 | 
						|
, gitBranch ? "master"
 | 
						|
, gitCommit ? "9f47063873c3aa9d6a47482a82c5000a8c813dd8"
 | 
						|
}:
 | 
						|
 | 
						|
with lib;
 | 
						|
 | 
						|
let
 | 
						|
  release = rec {
 | 
						|
    version = "3.2.0";
 | 
						|
    src = fetchFromGitHub {
 | 
						|
      owner = "bsc-pm";
 | 
						|
      repo = "nos-v";
 | 
						|
      rev = "${version}";
 | 
						|
      hash = "sha256-yaz92426EM8trdkBJlISmAoG9KJCDTvoAW/HKrasvOw=";
 | 
						|
    };
 | 
						|
  };
 | 
						|
 | 
						|
  git = rec {
 | 
						|
    version = src.shortRev;
 | 
						|
    src = builtins.fetchGit {
 | 
						|
      url = gitUrl;
 | 
						|
      ref = gitBranch;
 | 
						|
      rev = gitCommit;
 | 
						|
    };
 | 
						|
  };
 | 
						|
 | 
						|
  source = if (useGit) then git else release;
 | 
						|
in
 | 
						|
  stdenv.mkDerivation rec {
 | 
						|
    pname = "nosv";
 | 
						|
    inherit (source) src version;
 | 
						|
    hardeningDisable = [ "all" ];
 | 
						|
    dontStrip = true;
 | 
						|
    separateDebugInfo = true;
 | 
						|
    configureFlags = [
 | 
						|
      "--with-ovni=${ovni}"
 | 
						|
      "CACHELINE_WIDTH=${toString cacheline}"
 | 
						|
    ];
 | 
						|
    nativeBuildInputs = [
 | 
						|
      autoreconfHook
 | 
						|
      pkg-config
 | 
						|
    ];
 | 
						|
    buildInputs = [
 | 
						|
      numactl
 | 
						|
      hwloc
 | 
						|
      ovni
 | 
						|
    ] ++ lib.optionals enablePapi [ papi ];
 | 
						|
  }
 |