nixos-riscv/pkgs/spec-cpu/default.nix

62 lines
1.3 KiB
Nix
Raw Normal View History

2024-10-07 09:23:28 +02:00
{
stdenv
, spec-cpu-tools
, libarchive
, xz
, gnutar
, gfortran
, coreutils
, requireFile
, autoPatchelfHook
, libxcrypt-legacy
, lib
, benchSize ? "test"
2024-10-07 09:23:28 +02:00
}:
stdenv.mkDerivation rec {
pname = "spec-cpu";
version = "1.1.7";
src = null;
unpackPhase = "true";
# We need a working specxz binary
config = ./gcc-linux-x86.cfg;
buildPhase = ''
cp ${config} config.cfg
chmod +w config.cfg
export SPEC_NOCHECK=1
mkdir out
runcpu \
--verbose=80 \
--tune=base \
--size=${benchSize} \
2024-10-07 09:23:28 +02:00
--output_root=$PWD/out \
--config=$PWD/config.cfg \
--define build_ncpus=$NIX_BUILD_CORES \
--action=runsetup \
all
'';
# 519.lbm_r
# 502.gcc_r
# all
# We only need the run directories
installPhase = ''
# Remove build/ and exe/ directories, we only need run/
rm -rf out/benchspec/CPU/*/build/
rm -rf out/benchspec/CPU/*/exe/
mkdir -p $out
cp -a out/benchspec $out
'';
#buildInputs = [ ];
nativeBuildInputs = [ spec-cpu-tools gfortran ];
enableParallelBuilding = false;
hardeningDisable = [ "all" ];
dontStrip = true;
meta.broken = (stdenv.buildPlatform.config != "x86_64-unknown-linux-gnu") ||
(stdenv.hostPlatform.config != "riscv64-unknown-linux-gnu") ||
(stdenv.targetPlatform.config != "riscv64-unknown-linux-gnu");
}