import { spawn } from "child_process"; import { promisifySpawn } from "cli"; import { runcpuOptions } from "commands/spec"; import { systemdRunOptions } from "commands/systemd"; import { LLVM_INSTALL } from "environment"; import path from "path"; import { defaultSPEC, renderConfig } from "spec"; (async () => { const llvmHash = "31c8e21f40ea654f9d49b3a926acc6ef1f2ca5d5"; const llvmPrefix = path.join(LLVM_INSTALL, llvmHash); const config = `clang-O2-${llvmHash}.cfg`; const spec = defaultSPEC; spec.newConfig(config, renderConfig({ gccdir: llvmPrefix, optimize: ["-O2", "-msimd"].join(" "), })); await promisifySpawn(spawn("systemd-run", [ ...systemdRunOptions({ scope: false, unit: "spec-loadu", user: true, }), "runcpu", ...runcpuOptions({ benchmarks: ["intspeed"], buildType: "rebuild", config, workload: "ref", }) ], { env: spec.getEnvironment(), })); })();