environment: make a dedicated directory
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
import path from "path";
|
||||
|
||||
export const HOME = path.join("/home", "lyc");
|
||||
|
||||
export const SW_AUTOVEC = path.join(HOME, "workspace", "sw-autovec");
|
||||
|
||||
export const LLVM_SRC = path.join(SW_AUTOVEC, "swllvm-13.0.0-vect0919");
|
||||
export const LLVM_INSTALL = path.join(LLVM_SRC, "local", "installed");
|
||||
|
||||
export const projectRoot = path.join(__dirname, "..", "..");
|
||||
|
||||
/// Default toolchain version used in SPEC2017
|
||||
export const PREFIX = path.join(LLVM_INSTALL, "85e4fed0c9e4cd4ab8bce89f307127ccbad31294");
|
||||
export const PREFIXBIN = path.join(PREFIX, "bin");
|
||||
export const LLVM_EXTRACT = path.join(PREFIXBIN, "llvm-extract");
|
||||
|
||||
export const CXX = path.join(PREFIXBIN, "clang++");
|
||||
export const CC = path.join(PREFIXBIN, "clang");
|
||||
export const FLANG = path.join(PREFIXBIN, "flang");
|
||||
|
||||
export const SYSROOT_PREFIX = "/usr/sw/standard-830-6b-test";
|
||||
51
src/environment/index.ts
Normal file
51
src/environment/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import path from "path";
|
||||
|
||||
|
||||
export const SYSROOT_PREFIX = "/usr/sw/standard-830-6b-test";
|
||||
export const projectRoot = path.join(__dirname, "..", "..", "..");
|
||||
export const local = path.resolve(projectRoot, "local");
|
||||
|
||||
|
||||
/**
|
||||
* User-specific environment on Sw6B machine.
|
||||
*/
|
||||
export interface Sw6BEnvironment {
|
||||
/**
|
||||
* Home directory
|
||||
*/
|
||||
home: string;
|
||||
|
||||
/**
|
||||
* Source to llvm-projdct
|
||||
*/
|
||||
llvmSrc?: string;
|
||||
|
||||
/**
|
||||
* Private directory, writable, to put llvm installation.
|
||||
*/
|
||||
privateLLVMInstall?: string;
|
||||
|
||||
/**
|
||||
* Shared llvm installation directory, readonly for all users.
|
||||
*/
|
||||
sharedLLVMInstall?: string;
|
||||
|
||||
/**
|
||||
* Path to default spec2017 installation.
|
||||
*/
|
||||
spec2017: string;
|
||||
}
|
||||
|
||||
|
||||
export const lycEnv: Sw6BEnvironment = (() => {
|
||||
const home = path.resolve("home", "lyc");
|
||||
const swAutoVec = path.resolve(home, "workspace", "sw-autovec");
|
||||
const llvmSrc = path.resolve(swAutoVec, "swllvm-13.0.0-vect0919");
|
||||
const llvmInstall = path.resolve(llvmSrc, "local", "install");
|
||||
return {
|
||||
home,
|
||||
privateLLVMInstall: llvmInstall,
|
||||
sharedLLVMInstall: llvmInstall,
|
||||
spec2017: path.resolve(swAutoVec, "spec2017")
|
||||
};
|
||||
})();
|
||||
11
src/environment/llvm-prefix.ts
Normal file
11
src/environment/llvm-prefix.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import path from "path";
|
||||
|
||||
export function llvmToolchain(prefix: string) {
|
||||
const bin = path.resolve(prefix, "bin");
|
||||
return {
|
||||
CC: path.resolve(bin, "clang"),
|
||||
CXX: path.resolve(bin, "clang++"),
|
||||
FC: path.resolve(bin, "flang"),
|
||||
LLVM_EXTRACT: path.resolve(bin, "llvm-extract"),
|
||||
};
|
||||
}
|
||||
12
src/spec.ts
12
src/spec.ts
@@ -1,12 +1,10 @@
|
||||
import * as path from 'path';
|
||||
import * as fs from "fs";
|
||||
import { promisify } from "util";
|
||||
import { SW_AUTOVEC } from "./environment";
|
||||
import { spec } from 'node:test/reporters';
|
||||
import { ChildProcess, ChildProcessByStdio } from 'child_process';
|
||||
import { ChildProcessByStdio } from 'child_process';
|
||||
import { Readable, Writable } from 'stream';
|
||||
import { Readline } from 'readline/promises';
|
||||
import { createInterface } from 'readline';
|
||||
import { projectRoot } from './environment';
|
||||
|
||||
export interface SPECBenchData {
|
||||
objectNames: string[];
|
||||
@@ -407,13 +405,11 @@ export function mkBench(spec: SPEC, bench: SPECBenchData): Bench {
|
||||
};
|
||||
}
|
||||
|
||||
export const defaultSPEC = mkSPEC(path.join(SW_AUTOVEC, "spec2017"));
|
||||
|
||||
const specTemplate = fs.readFileSync("assets/specTemplate.cfg").toString("utf-8");
|
||||
const specTemplate = fs.readFileSync(path.resolve(projectRoot, "assets", "specTemplate.cfg")).toString("utf-8");
|
||||
|
||||
const writeFile = promisify(fs.writeFile);
|
||||
|
||||
interface ConfigOptions {
|
||||
export interface ConfigOptions {
|
||||
gccdir: string;
|
||||
optimize: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user