Rodrigo Arias Mallo
ce70726bf6
The one contained in the CPU SPEC ISO is built for x86, and there is no binary for RISC-V.
59 lines
1.3 KiB
Nix
59 lines
1.3 KiB
Nix
{
|
|
stdenv
|
|
, spec-cpu
|
|
, spec-cpu-tools
|
|
, specinvoke
|
|
}:
|
|
|
|
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
|
|
"631.deepsjeng_s"
|
|
"641.leela_s"
|
|
"648.exchange2_s"
|
|
"657.xz_s"
|
|
];
|
|
|
|
dontConfigure = true;
|
|
buildPhase = ''
|
|
pwd
|
|
mkdir -p benchspec/CPU
|
|
for bench in $benchList; do
|
|
cp -r ${spec-cpu}/benchspec/CPU/$bench benchspec/CPU/
|
|
done
|
|
|
|
# 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
|
|
mkdir -p $out/bin
|
|
echo -e "#!$SHELL\necho $out" > $out/bin/spec-cpu-mini
|
|
chmod +x $out/bin/spec-cpu-mini
|
|
cp ${specinvoke}/bin/specinvoke $out/bin
|
|
'';
|
|
enableParallelBuilding = false;
|
|
hardeningDisable = [ "all" ];
|
|
dontStrip = true;
|
|
}
|