2024-10-07 13:33:53 +02:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, spec-cpu
|
2024-10-08 09:27:32 +02:00
|
|
|
, spec-cpu-tools
|
2024-10-08 10:13:27 +02:00
|
|
|
, specinvoke
|
2024-10-09 15:53:57 +02:00
|
|
|
, speclaunch
|
2024-10-07 13:33:53 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "spec-cpu-mini";
|
|
|
|
version = spec-cpu.version;
|
|
|
|
src = null;
|
|
|
|
unpackPhase = "true";
|
|
|
|
|
|
|
|
# Select only a subset of the benchmarks:
|
|
|
|
# https://www.spec.org/cpu2017/Docs/#benchdocs
|
|
|
|
benchList = [
|
|
|
|
# -- SPECspeed 2017 Integer --
|
|
|
|
"600.perlbench_s"
|
|
|
|
"602.gcc_s"
|
|
|
|
"605.mcf_s"
|
|
|
|
"620.omnetpp_s"
|
|
|
|
#"623.xalancbmk_s" # Big
|
|
|
|
#"625.x264_s" # Big
|
2024-10-09 21:33:21 +02:00
|
|
|
#"631.deepsjeng_s" # Requires 7 GiB of RAM
|
2024-10-07 13:33:53 +02:00
|
|
|
"641.leela_s"
|
|
|
|
"648.exchange2_s"
|
2024-10-10 10:47:13 +02:00
|
|
|
# "657.xz_s" # Runs out of memory with 700 MiB of RAM
|
2024-10-07 13:33:53 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
dontConfigure = true;
|
2024-10-07 14:50:36 +02:00
|
|
|
buildPhase = ''
|
|
|
|
pwd
|
|
|
|
mkdir -p benchspec/CPU
|
2024-10-07 13:33:53 +02:00
|
|
|
for bench in $benchList; do
|
2024-10-07 14:50:36 +02:00
|
|
|
cp -r ${spec-cpu}/benchspec/CPU/$bench benchspec/CPU/
|
2024-10-07 13:33:53 +02:00
|
|
|
done
|
2024-10-07 14:50:36 +02:00
|
|
|
|
|
|
|
# Make writable
|
|
|
|
chmod -R +w benchspec
|
|
|
|
|
|
|
|
# Remove environment
|
|
|
|
find benchspec -name '*.cmd' | xargs sed -i '/^-E/d'
|
|
|
|
# Remove compare script as it refers to spec-cpu-tools
|
|
|
|
find benchspec -name 'compare.cmd' -delete
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
pwd
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r benchspec/ $out
|
2024-10-07 14:16:47 +02:00
|
|
|
mkdir -p $out/bin
|
|
|
|
echo -e "#!$SHELL\necho $out" > $out/bin/spec-cpu-mini
|
|
|
|
chmod +x $out/bin/spec-cpu-mini
|
2024-10-08 10:13:27 +02:00
|
|
|
cp ${specinvoke}/bin/specinvoke $out/bin
|
2024-10-09 15:53:57 +02:00
|
|
|
cp ${speclaunch}/bin/speclaunch $out/bin
|
2024-10-07 13:33:53 +02:00
|
|
|
'';
|
|
|
|
enableParallelBuilding = false;
|
|
|
|
hardeningDisable = [ "all" ];
|
|
|
|
dontStrip = true;
|
|
|
|
}
|