Commit 77726a9d authored by Valentin Reis's avatar Valentin Reis
Browse files

Refactoring the pinning.

parent 87be7f6b
......@@ -11,51 +11,53 @@
packagepins ? import ./pins.nix {inherit (pkgs) stdenv fetchgit fetchgitPrivate;}
}:
let
toPath = s: ./. + s;
gitpin = f: pkgs.fetchgit {inherit (pkgs.lib.importJSON f) url sha256 rev fetchSubmodules;};
compiler_path = "/opt/intel/compilers_and_libraries_2017.1.132/linux";
callPackage = pkgs.lib.callPackageWith pkgs;
callPackagePinWith =
{ path
{ folderPath
, nixName ? "default"
, jsonName ? nixName
, depset ? {}
, pkgs ? pkgs
} :
let
jsonPath = toPath "/${path}/${jsonName}.json";
nixPath = folderPath + "/${nixName}.nix";
jsonPath = folderPath + "/${jsonName}.json";
src = gitpin jsonPath;
in
pkgs.lib.callPackageWith pkgs (toPath "/${path}/${nixName}.nix") (depset // {src = gitpin jsonPath;});
cpDefaultPin = path: depset: callPackagePinWith { inherit path depset;};
cpAlternatePin = path: depset: alternate: callPackagePinWith {inherit path depset jsonName;};
callPackage nixPath (depset // {inherit src;});
cpDefaultPin = folderPath: depset: callPackagePinWith { inherit folderPath depset;};
cpAlternatePin = folderPath: depset: jsonName: callPackagePinWith {inherit folderPath depset jsonName;};
pythonPackages = pkgs.python27Packages;
in rec {
#NRM components
nodelevel = rec {
libnrm = callPackagePin {path="libnrm";};
containers = cpDefaultPin "./containers" { inherit pythonPackages; };
containers-bandit = cpAlternatePin "./containers" { inherit pythonPackages; } "bandit";
nrm = cpDefaultPin "./nrm" { inherit pythonPackages containers; };
nrm-bandit = cpAlternatePin "./nrm" { inherit pythonPackages containers-bandit; } "bandit";
libnrm = cpDefaultPin ./libnrm {};
containers = cpDefaultPin ./containers { inherit pythonPackages; };
containers-bandit = cpAlternatePin ./containers { inherit pythonPackages; } "bandit";
nrm = cpDefaultPin ./nrm { inherit pythonPackages; nrm-containers = containers; };
nrm-bandit = cpAlternatePin ./nrm { inherit pythonPackages; nrm-containers=containers-bandit; } "bandit";
};
#Instrumented applications
applications = rec {
lammps = pkgs.lammps-mpi;
stream = callPackage {path="applications/stream";};
openmc = callPackage {path="applications/openmc";};
qmcpack = callPackage {path="applications/qmcpack";};
amg = callPackage {path="applications/amg";};
graph500 = cpAlternatePin "applications/simple" {} "graph500";
simple = cpAlternatePin "applications/simple" {inherit intel; inherit (nodelevel) libnrm;} "dgemm_randomwalk";
#lammps = pkgs.lammps-mpi;
amg = cpDefaultPin applications/amg;
qmcpack = cpDefaultPin applications/qmcpack;
openmc = cpDefaultPin applications/openmc;
stream = cpDefaultPin applications/stream;
lammps = cpDefaultPin applications/lammps;
graph500 = cpAlternatePin applications/simple {} "graph500";
simple = cpAlternatePin applications/simple {inherit intel; inherit (nodelevel) libnrm;} "dgemm_randomwalk";
};
#Intel compilers
intel = with pkgs; rec {
icc = callPackage intel/icc { inherit compiler_path; };
mkl = callPackage intel/mkl { inherit compiler_path; };
WrappedICC = (import ../patches/cc-wrapper {
WrappedICC = (import intel/cc-wrapper {
inherit stdenv binutils coreutils ;
libc = glibc;
nativeTools = false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment