forked from rarias/bscpkgs
Add extrae and perf stages
This commit is contained in:
30
bsc/garlic/extrae.nix
Normal file
30
bsc/garlic/extrae.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
stdenv
|
||||
, bash
|
||||
, extrae
|
||||
}:
|
||||
|
||||
{
|
||||
app
|
||||
, traceLib ? "mpi"
|
||||
, configFile
|
||||
, program ? "bin/run"
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "${app.name}-extrae";
|
||||
preferLocalBuild = true;
|
||||
phases = [ "installPhase" ];
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cat > $out/bin/run <<EOF
|
||||
#!${bash}/bin/bash
|
||||
|
||||
export EXTRAE_HOME=${extrae}
|
||||
export LD_PRELOAD=${extrae}/lib/lib${traceLib}trace.so:$LD_PRELOAD
|
||||
export EXTRAE_CONFIG_FILE=${configFile}
|
||||
exec ${app}/${program}
|
||||
EOF
|
||||
chmod +x $out/bin/run
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user