Commit 7e056d90 authored by Valentin Reis's avatar Valentin Reis
Browse files

[Refactor] adding declarative channel.

parent aa0c0d5a
{
hostPkgs ? import <nixpkgs> {},
pkgs ? import ../pin.nix { inherit hostPkgs; jsonpath=../nixpkgs-18.03.json; },
system ? builtins.currentSystem,
pkgs ? import ../pin.nix { inherit hostPkgs; jsonpath=../nixpkgs-18.03.json; depset = {inherit system;}; },
kapack ? import ../pin.nix { hostPkgs = pkgs ; jsonpath=../kapack.json; depset = {hostPkgs=pkgs;};},
supportedSystems ? [ "x86_64-linux" "i686-linux" ]
}:
let
releaseTools = import "${pkgs}/top-level/release-lib.nix" {
inherit supportedSystems;
};
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;
......@@ -24,63 +30,73 @@ let
cpAlternatePin = folderPath: depset: jsonName: callPackagePinWith {inherit folderPath depset jsonName;};
cpBothAlternatePin = folderPath: depset: jsonName: callPackagePinWith {inherit folderPath depset jsonName; nixName=jsonName;};
pythonPackages = pkgs.python27Packages;
in rec {
#NRM components
tools = rec {
inherit (kapack) zymake;
};
argopkgs = rec {
#NRM components
tools = rec {
inherit (kapack) zymake;
};
nodelevel = rec {
libnrm = cpDefaultPin ./libnrm {};
libnrm-pmpi = libnrm.overrideAttrs (oldAttrs: rec {
configureFlags = "--enable-pmpi";
buildInputs = oldAttrs.buildInputs ++ [ pkgs.mpich2 ];
});
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";
};
nodelevel = rec {
libnrm = cpDefaultPin ./libnrm {};
libnrm-pmpi = libnrm.overrideAttrs (oldAttrs: rec {
configureFlags = "--enable-pmpi";
buildInputs = oldAttrs.buildInputs ++ [ pkgs.mpich2 ];
});
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 =
let
paths = {
amg = applications/amg;
qmcpack = applications/qmcpack;
openmc = applications/openmc;
stream = applications/stream;
lammps = applications/lammps;
#Instrumented applications
applications =
let
paths = {
amg = applications/amg;
qmcpack = applications/qmcpack;
openmc = applications/openmc;
stream = applications/stream;
lammps = applications/lammps;
};
rawApplication = name : path: cpDefaultPin path {};
instrumentedApplication = name: path:
(cpAlternatePin path {} "nrm").overrideAttrs (oldAttrs:
{
buildInputs = oldAttrs.buildInputs ++ [nodelevel.libnrm];
cmakeFlags = if (name=="qmcpack") then
(oldAttrs.cmakeFlags ++ [ ''-DQMC_INCLUDE=${nodelevel.libnrm}/include/'' ''-DQMC_EXTRA_LIBS=${nodelevel.libnrm}/lib/libnrm.so'' ])
else
[];
});
in
rec {
raw = pkgs.lib.mapAttrs rawApplication paths;
nrm = (pkgs.lib.mapAttrs instrumentedApplication paths) // {
dgemm_randomwalk = cpBothAlternatePin applications/simple {inherit intel; inherit (nodelevel) libnrm;} "dgemm_randomwalk";
graph500 = cpBothAlternatePin applications/simple { inherit (nodelevel) libnrm;} "graph500";
};
};
rawApplication = name : path: cpDefaultPin path {};
instrumentedApplication = name: path:
(cpAlternatePin path {} "nrm").overrideAttrs (oldAttrs:
{
buildInputs = oldAttrs.buildInputs ++ [nodelevel.libnrm];
cmakeFlags = if (name=="qmcpack") then
(oldAttrs.cmakeFlags ++ [ ''-DQMC_INCLUDE=${nodelevel.libnrm}/include/'' ''-DQMC_EXTRA_LIBS=${nodelevel.libnrm}/lib/libnrm.so'' ])
else
[];
#Intel compilers
intel = with pkgs; rec {
icc = callPackage intel/icc { inherit compiler_path; };
mkl = callPackage intel/mkl { inherit compiler_path; };
WrappedICC = (import intel/cc-wrapper {
inherit stdenv binutils coreutils ;
libc = glibc;
nativeTools = false;
nativeLibc = false;
cc = icc;
});
in
rec {
raw = pkgs.lib.mapAttrs rawApplication paths;
nrm = (pkgs.lib.mapAttrs instrumentedApplication paths) // {
dgemm_randomwalk = cpBothAlternatePin applications/simple {inherit intel; inherit (nodelevel) libnrm;} "dgemm_randomwalk";
graph500 = cpBothAlternatePin applications/simple { inherit (nodelevel) libnrm;} "graph500";
};
};
#Intel compilers
intel = with pkgs; rec {
icc = callPackage intel/icc { inherit compiler_path; };
mkl = callPackage intel/mkl { inherit compiler_path; };
WrappedICC = (import intel/cc-wrapper {
inherit stdenv binutils coreutils ;
libc = glibc;
nativeTools = false;
nativeLibc = false;
cc = icc;
});
argopkgs = pkgs.releaseTools.channel {
name = "argopkgs";
src = ./.;
constituents = [ ];
};
};
}
in argopkgs
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