default.nix 4.11 KB
Newer Older
Valentin Reis's avatar
.    
Valentin Reis committed
1
{
2
  hostPkgs ? import <nixpkgs> {},
Valentin Reis's avatar
Valentin Reis committed
3
  system          ? builtins.currentSystem,
Valentin Reis's avatar
Valentin Reis committed
4
  pkgs-stable     ? import ../pin.nix { inherit hostPkgs; jsonpath=../nixpkgs-18.03.json; depset = {inherit system;}; },
5
  pkgs            ? import ../pin.nix { inherit hostPkgs; jsonpath=../nixpkgs-unstable.json; depset = {inherit system;}; },
Valentin Reis's avatar
Valentin Reis committed
6
  kapack          ? import ../pin.nix { hostPkgs = pkgs ; jsonpath=../kapack.json; depset = {hostPkgs=pkgs;};},
7
  supportedSystems ? [ "x86_64-linux" "i686-linux" ],
Valentin Reis's avatar
.    
Valentin Reis committed
8
9
}:
let
10
11
12
13
  releaseTools = import "${pkgs}/top-level/release-lib.nix" {
    inherit supportedSystems;
  };

Valentin Reis's avatar
Valentin Reis committed
14
  gitpin = f: pkgs.fetchgit {inherit (pkgs.lib.importJSON f) url sha256 rev fetchSubmodules;};
Valentin Reis's avatar
Valentin Reis committed
15
  compiler_path = "/opt/intel/compilers_and_libraries_2017.1.132/linux";
Valentin Reis's avatar
Valentin Reis committed
16
  callPackage = pkgs.lib.callPackageWith (pkgs//argopkgs);
Valentin Reis's avatar
Valentin Reis committed
17
  callPackagePinWith =
Valentin Reis's avatar
Valentin Reis committed
18
  { folderPath
Valentin Reis's avatar
Valentin Reis committed
19
20
  , nixName ? "default"
  , jsonName ? nixName
Valentin Reis's avatar
Valentin Reis committed
21
22
  , depset ? {}
  } :
Valentin Reis's avatar
Valentin Reis committed
23
  let
Valentin Reis's avatar
Valentin Reis committed
24
25
26
    nixPath = folderPath + "/${nixName}.nix";
    jsonPath = folderPath + "/${jsonName}.json";
    src = gitpin jsonPath;
Valentin Reis's avatar
Valentin Reis committed
27
  in
Valentin Reis's avatar
Valentin Reis committed
28
29
30
31
  callPackage nixPath (depset // {inherit src;});

  cpDefaultPin = folderPath: depset: callPackagePinWith { inherit folderPath depset;};
  cpAlternatePin = folderPath: depset: jsonName: callPackagePinWith {inherit folderPath depset jsonName;};
Valentin Reis's avatar
Valentin Reis committed
32
  cpBothAlternatePin = folderPath: depset: jsonName: callPackagePinWith {inherit folderPath depset jsonName; nixName=jsonName;};
Valentin Reis's avatar
Valentin Reis committed
33
  pythonPackages = pkgs.python27Packages;
34
  python = pkgs.python;
35

36
  argopkgs = rec {
37
    #pyzmq = pythonPackages.pyzmq.override { zeromq3 = pkgs.zeromq; };
Valentin Reis's avatar
Valentin Reis committed
38

39
40
41
42
    #NRM components
    tools = rec {
      inherit (kapack) zymake;
    };
Valentin Reis's avatar
Valentin Reis committed
43

44
45
46
47
48
49
    nodelevel = rec {
      libnrm = cpDefaultPin ./libnrm {};
      libnrm-pmpi = libnrm.overrideAttrs (oldAttrs: rec {
        configureFlags = "--enable-pmpi";
        buildInputs = oldAttrs.buildInputs ++ [ pkgs.mpich2 ];
      });
50
51
      containers = cpDefaultPin ./containers { inherit pythonPackages; };
      nrm = cpDefaultPin ./nrm { inherit pythonPackages; nrm-containers = containers; };
52
    };
Valentin Reis's avatar
Valentin Reis committed
53

54
55
56
57
    applications =
    let
      paths = {
       amg = applications/amg;
58
       qmcpack = applications/qmcpack;
59
       openmc = applications/openmc;
60
61
62
       stream = applications/stream;
       lammps = applications/lammps;
      };
63
      rawApplication = name : path: cpDefaultPin path { inherit (nodelevel) libnrm; };
64
      instrumentedApplication = name: path:
65
        (cpAlternatePin path {inherit (nodelevel) libnrm; } "nrm").override {nrmSupport = true;};
66
67
68
69
    in
    rec {
      raw = pkgs.lib.mapAttrs rawApplication paths;
      nrm = (pkgs.lib.mapAttrs instrumentedApplication paths) // {
70
        dgemm_randomwalk = cpBothAlternatePin applications/simple { inherit (nodelevel) libnrm;} "dgemm_randomwalk";
71
72
        graph500 = cpBothAlternatePin applications/simple { inherit (nodelevel) libnrm;} "graph500";
      };
Valentin Reis's avatar
Valentin Reis committed
73
    };
74
75
76
77
78
79
80
81
82
83
84

    #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;
Valentin Reis's avatar
Valentin Reis committed
85
      });
Valentin Reis's avatar
Valentin Reis committed
86
    };
Valentin Reis's avatar
Valentin Reis committed
87
88

    zmcat = pkgs-stable.haskellPackages.callPackage ./tools/zmcat {};
89
90
    asv = callPackage ./tools/asv {};
    asv-nix = callPackage ./tools/asv-nix/default.nix { inherit asv; };
91
92

    aml = cpDefaultPin ./aml {};
93

Valentin Reis's avatar
Valentin Reis committed
94
95
96
97
98
    repoquality =
      let fetched = (pkgs.nix-update-source.fetch repoquality/master.json).src;
          repoqualityPkgs = import "${fetched}/default.nix" {pkgs=pkgs;};
      in repoqualityPkgs.repoquality;

99
    argotk =
Valentin Reis's avatar
Valentin Reis committed
100
101
      let fetched = (pkgs.nix-update-source.fetch argotk/master.json).src;
          argotkPkgs = import "${fetched}/default.nix" {pkgs=pkgs;};
102
      in argotkPkgs.argotk;
Valentin Reis's avatar
Valentin Reis committed
103

Valentin Reis's avatar
Valentin Reis committed
104
    argonixPkgs =
Valentin Reis's avatar
Valentin Reis committed
105
      let fetched = (pkgs.nix-update-source.fetch argonix/master.json).src;
Valentin Reis's avatar
Valentin Reis committed
106
107
      in  import "${fetched}/default.nix" {pkgs=pkgs;};
    argonix =  argonixPkgs.argonix;
Valentin Reis's avatar
Valentin Reis committed
108
109

    openmc-data = (pkgs.nix-update-source.fetch applications/openmc/data.json).src;
110
  };
111
in pkgs // argopkgs