62 lines
1.3 KiB
Nix
62 lines
1.3 KiB
Nix
{
|
|
stdenv
|
|
, spec-cpu-tools
|
|
, libarchive
|
|
, xz
|
|
, gnutar
|
|
, gfortran
|
|
, coreutils
|
|
, requireFile
|
|
, autoPatchelfHook
|
|
, libxcrypt-legacy
|
|
, lib
|
|
, benchSize ? "test"
|
|
}:
|
|
|
|
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} \
|
|
--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");
|
|
}
|