Commit 6e21d863 authored by Valentin Reis's avatar Valentin Reis
Browse files

refactor

parent 061ce89c
Pipeline #5243 failed with stage
in 10 seconds
{
"url": "https://xgitlab.cels.anl.gov/argo/applications/qmcpack.git",
"rev": "2965b06d4f6de6a9ab1ebb9ea60388825ef9379c",
"date": "2019-02-11T16:33:42-06:00",
"sha256": "0p6wbklri9ax0b8n3c1c0rgmdr5zmgmkcaih7w20slc97knzsrhm",
"fetchSubmodules": false
}
#!/usr/bin/env bash
nix-prefetch-git https://xgitlab.cels.anl.gov/argo/applications/qmcpack.git refs/heads/master > default.json
#!/usr/bin/env bash
nix-prefetch-git https://xgitlab.cels.anl.gov/argo/applications/qmcpack.git refs/heads/progress-nrm > nrm.json
{
"url": "https://xgitlab.cels.anl.gov/argo/applications/simple.git",
"rev": "349ecc8700ff09f40cca9c6ed49c078d79d47b60",
"date": "2019-01-23T14:15:00-06:00",
"sha256": "0ylz2g2cdvrr04f2h7xk3jgfx2cvn0lnc1fy3pjmg2050i6qxqvh",
"fetchSubmodules": false
}
{ stdenv, src, gsl, libnrm, mpich2}:
stdenv.mkDerivation {
inherit src;
name = "dgemm-randomwalk";
buildInputs = [ gsl libnrm mpich2 ];
buildPhase = "cd simple; make randomwalk";
installPhase = ''
mkdir -p $out/bin
cp randomwalk $out/bin/
'';
}
{
"url": "https://xgitlab.cels.anl.gov/argo/applications/simple.git",
"rev": "b6ccaaeab909a0479780bdb9d942cb63def3793f",
"date": "2018-11-02T13:47:10-05:00",
"sha256": "0j8c54k5xprpr1lan8kx3d7dxhpfml3510zwmx6y8bnfb619j7xn",
"fetchSubmodules": true
}
{ stdenv, src, fetchgit, mpich2, libnrm }:
stdenv.mkDerivation {
inherit src;
name = "graph500";
buildInputs = [mpich2 libnrm];
buildPhase = ''
cd graph500/src
make
'';
installPhase = ''
mkdir -p $out/bin
cp graph500_reference_bfs $out/bin/graph500_reference_bfs
cp graph500_reference_bfs_sssp $out/bin/graph500_reference_bfs_sssp
'';
}
#!/usr/bin/env bash
nix-prefetch-git https://xgitlab.cels.anl.gov/argo/applications/simple.git refs/heads/master > dgemm_randomwalk.json
#!/usr/bin/env bash
nix-prefetch-git https://xgitlab.cels.anl.gov/argo/applications/simple.git refs/heads/master > graph500.json
{
"url": "https://xgitlab.cels.anl.gov/argo/applications/stream.git",
"rev": "32e57a2571890b7a2b6628b5d2d4b7b3fae947b8",
"date": "2016-07-27T10:55:31-07:00",
"sha256": "00r88rywxz34chl6whhpjzfbkjnb509qdjzd7bv34wi7bwvw6hwi",
"fetchSubmodules": false
}
{
"url": "https://xgitlab.cels.anl.gov/argo/applications/stream.git",
"rev": "970b17136d7ea3119f9f46ef5f4af853b03281f6",
"date": "2019-02-11T16:02:42-06:00",
"sha256": "030i5nfw3kh9w02m8xhkqjmsp48z8lw4rbr0a69nidb0sf0cy33v",
"fetchSubmodules": false
}
#!/usr/bin/env bash
nix-prefetch-git https://xgitlab.cels.anl.gov/argo/applications/stream.git refs/heads/master > default.json
#!/usr/bin/env bash
nix-prefetch-git https://xgitlab.cels.anl.gov/argo/applications/stream.git refs/heads/progress-nrm > nrm.json
{
"url": "https://xgitlab.cels.anl.gov/argo/containers.git",
"rev": "9be6830772f4f5d6b612660a4988e6cba02429bc",
"date": "2018-02-19T21:23:12+01:00",
"sha256": "1iqw6106ax3l5231bgp1myr99q58hp4nl4v2q4nnrmbllfh2vzhi",
"fetchSubmodules": true
}
{
"url": "https://xgitlab.cels.anl.gov/argo/containers.git",
"rev": "985225a44874c0921117aec9f8788a2a1ae3cee0",
"date": "2019-01-07T17:21:38-06:00",
"sha256": "1q76gbjrp3xwwdd1ylk8xpv12c65ds9x36is9sd8l77kx0sdh22i",
"fetchSubmodules": false
}
{
"fetch": {
"args": {
"fetchSubmodules": false,
"rev": "985225a44874c0921117aec9f8788a2a1ae3cee0",
"sha256": "1q76gbjrp3xwwdd1ylk8xpv12c65ds9x36is9sd8l77kx0sdh22i",
"url": "https://xgitlab.cels.anl.gov/argo/containers.git"
},
"fn": "fetchgit"
},
"rev": "refs/heads/master",
"type": "fetchgit",
"url": "https://xgitlab.cels.anl.gov/argo/containers.git"
}
\ No newline at end of file
{
"url": "https://xgitlab.cels.anl.gov/argo/containers.git",
"rev": "9be6830772f4f5d6b612660a4988e6cba02429bc",
"date": "2018-02-19T21:23:12+01:00",
"sha256": "1iqw6106ax3l5231bgp1myr99q58hp4nl4v2q4nnrmbllfh2vzhi",
"fetchSubmodules": false
}
#!/usr/bin/env bash
nix-prefetch-git https://xgitlab.cels.anl.gov/argo/containers.git refs/heads/master > default.json
nix-prefetch-git https://xgitlab.cels.anl.gov/argo/containers.git refs/heads/nix > nix.json
{
hostPkgs ? import <nixpkgs> {},
system ? builtins.currentSystem,
pkgs-stable ? import ../pin.nix { inherit hostPkgs; jsonpath=../nixpkgs-18.03.json; depset = {inherit system;}; },
pkgs ? import ../pin.nix { inherit hostPkgs; jsonpath=../nixpkgs-unstable.json; depset = {inherit system;}; },
kapack ? import ../pin.nix { hostPkgs = pkgs ; jsonpath=../kapack.json; depset = {hostPkgs=pkgs;};},
supportedSystems ? [ "x86_64-linux" "i686-linux" ],
{ # host package set (unused except for fetching nixpkgs)
hostPkgs ? import <nixpkgs> {}
, # versioned nixpkgs
pkgs ? import (hostPkgs.nix-update-source.fetch ./pkgs.json).src {}
, # fetcher alias for the remaining arguments
fetched ? (s: (pkgs.nix-update-source.fetch s).src)
, #source overrides: core nrm components
aml-src ? fetched aml/master.json
, libnrm-src ? fetched libnrm/master.json
, nrm-src ? fetched nrm/master.json
, containers-src ? fetched containers/master.json
, amg-src ? fetched amg/master.json
, #source overrides: applications
qmcpack-src ? fetched qmcpack/master.json
, openmc-src ? fetched openmc/master.json
, stream-src ? fetched stream/master.json
, lammps-src ? fetched lammps/master.json
, #source overrides :tooling
repoquality-src ? fetched repoquality/master.json,
argotk-src ? fetched argotk/master.json,
argonix-src ? fetched argonix/master.json,
}:
let
releaseTools = import "${pkgs}/top-level/release-lib.nix" {
inherit supportedSystems;
};
callPackage = pkgs.lib.callPackageWith (pkgs // argopkgs);
argopkgs = rec {
argoLib = import ../lib/utils.nix;
# Argo components (source overridabel via argument):
aml = callPackage ./aml {src = aml-src;};
nrm = callPackage ./nrm {src = nrm-src;};
containers = callPackage ./containers {src = containers-src;};
libnrm = callPackage ./libnrm {src = libnrm-src;};
libnrm-pmpi = libnrm.overrideAttrs (oldAttrs: rec {
configureFlags = "--enable-pmpi";
buildInputs = oldAttrs.buildInputs ++ [ pkgs.mpich2 ];
});
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//argopkgs);
callPackagePinWith =
{ folderPath
, nixName ? "default"
, jsonName ? nixName
, depset ? {}
} :
let
nixPath = folderPath + "/${nixName}.nix";
jsonPath = folderPath + "/${jsonName}.json";
src = gitpin jsonPath;
in
callPackage nixPath (depset // {inherit src;});
cpDefaultPin = folderPath: depset: callPackagePinWith { inherit folderPath depset;};
cpAlternatePin = folderPath: depset: jsonName: callPackagePinWith {inherit folderPath depset jsonName;};
cpBothAlternatePin = folderPath: depset: jsonName: callPackagePinWith {inherit folderPath depset jsonName; nixName=jsonName;};
pythonPackages = pkgs.python27Packages;
python = pkgs.python;
# Applications (source overridable via argument):
argopkgs = rec {
#pyzmq = pythonPackages.pyzmq.override { zeromq3 = pkgs.zeromq; };
amg = callPackage ./amg { nrmSupport=true; src = amg-src; };
qmcpack = callPackage ./qmcpack { nrmSupport=true; src = qmcpack-src; };
openmc = callPackage ./openmc { nrmSupport=true; src = openmc-src; };
stream = callPackage ./stream { nrmSupport=true; src = stream-src; };
lammps = callPackage ./lammps { nrmSupport=true; src = lammps-src; };
#NRM components
tools = rec {
inherit (kapack) zymake;
};
# Data (static, non source overridable via arguments):
openmc-data = fetched openmc/data.json;
nodelevel = rec {
libnrm = cpDefaultPin ./libnrm {};
libnrm-pmpi = libnrm.overrideAttrs (oldAttrs: rec {
configureFlags = "--enable-pmpi";
buildInputs = oldAttrs.buildInputs ++ [ pkgs.mpich2 ];
});
containers = cpDefaultPin ./containers { inherit pythonPackages; };
nrm = cpDefaultPin ./nrm { inherit pythonPackages; nrm-containers = containers; };
};
#Tools:
haskellPackages = pkgs.haskellPackages.override {
overrides = self: super: with pkgs.haskell.lib;
let
loader = argoLib.cabalDevLoader pkgs self;
in rec {
panpipe = (pkgs.haskell.lib.doJailbreak super.panpipe);
generic-pretty = doJailbreak super.generic-pretty;
applications =
let
paths = {
amg = applications/amg;
qmcpack = applications/qmcpack;
openmc = applications/openmc;
stream = applications/stream;
lammps = applications/lammps;
};
rawApplication = name : path: cpDefaultPin path { inherit (nodelevel) libnrm; };
instrumentedApplication = name: path:
(cpAlternatePin path {inherit (nodelevel) libnrm; } "nrm").override {nrmSupport = true;};
in
rec {
raw = pkgs.lib.mapAttrs rawApplication paths;
nrm = (pkgs.lib.mapAttrs instrumentedApplication paths) // {
dgemm_randomwalk = cpBothAlternatePin applications/simple { inherit (nodelevel) libnrm;} "dgemm_randomwalk";
graph500 = cpBothAlternatePin applications/simple { inherit (nodelevel) libnrm;} "graph500";
#minor cabal and version fix
panhandle = (self.callCabal2nix "panhandle" (builtins.fetchGit {
inherit (panhandle-src) url rev; })) {};
#argo tools
argotk = (self.callCabal2nix "argotk" (builtins.fetchGit {
inherit (argotk-src) url rev; })) {};
argonix = (self.callCabal2nix "argonix" (builtins.fetchGit {
inherit (argonix-src) url rev; })) {};
repoquality = (self.callCabal2nix "repoquality" (builtins.fetchGit {
inherit (repoquality-src) url rev; })) {};
};
};
# re-export from hpkgs and add non-haskell build outputs.
inherit (haskellPackages) argonix repoquality;
argotk = argoLib.addHackEnv pkgs haskellPackages (haskellPackages.argotk.overrideAttrs (old:{
buildInputs=old.buildInputs ++ [pkgs.hwloc];
installPhase = old.installPhase + ''
mkdir $out/share/
ARGOTK_SHARE=share $out/bin/argotk --bash-completion-script argotk > $out/share/argotk.sh
cp -r share/* $out/share/
substituteInPlace $out/share/simple-H2O.xml --replace \
H2O.HF.wfs.xml $out/share/H2O.HF.wfs.xml
substituteInPlace $out/share/simple-H2O.xml --replace \
O.BFD.xml $out/share/O.BFD.xml
substituteInPlace $out/share/simple-H2O.xml --replace \
H.BFD.xml $out/share/H.BFD.xml
'';
}));
#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;
});
};
# Fixing the pyzmq package in this attribute set.
pyzmq = pkgs.pythonPackages.pyzmq.override { zeromq3 = pkgs.zeromq; };
zmcat = pkgs-stable.haskellPackages.callPackage ./tools/zmcat {};
asv = callPackage ./tools/asv {};
asv-nix = callPackage ./tools/asv-nix/default.nix { inherit asv; };
# archived for sake of the simplicity of this file:
#zmcat = pkgs-stable.haskellPackages.callPackage ./tools/zmcat {};
aml = cpDefaultPin ./aml {};
# nix-shell environments, can not be built.
test = pkgs.stdenv.mkDerivation rec {
name = "testEnv";
repoquality =
let fetched = (pkgs.nix-update-source.fetch repoquality/master.json).src;
repoqualityPkgs = import "${fetched}/default.nix" {pkgs=pkgs;};
in repoqualityPkgs.repoquality;
#required to be able to build the drv.
installPhase = "mkdir $$out";
unpackPhase = "true";
argotk =
let fetched = (pkgs.nix-update-source.fetch argotk/master.json).src;
argotkPkgs = import "${fetched}/default.nix" {pkgs=pkgs;};
in argotkPkgs.argotk;
buildInputs = [
# argotk runs mpiexec:
pkgs.mpich2
# argotk uses hwloc to choose CPU counts:
pkgs.hwloc
# these are needed for some reason:
pkgs.coreutils
pkgs.utillinux
pkgs.git
# argo tools
argotk
# argo components
containers
nrm
# sample application for testing progress reports:
(stream.override {libnrm = libnrm; iterationCount = "20";})
];
shellHook ="source ${argotk}/share/argotk.sh"; # bash completion
ARGOTK_SHARE = "${argotk}/share"; # for argotk to find its versioned data
};
argonixPkgs =
let fetched = (pkgs.nix-update-source.fetch argonix/master.json).src;
in import "${fetched}/default.nix" {pkgs=pkgs;};
argonix = argonixPkgs.argonix;
expe = test.overrideAttrs (old:{
buildInputs = old.buildInputs ++
[amg lammps qmcpack stream openmc openmc-data];
OPENMC_CROSS_SECTIONS = "${openmc-data}/cross_sections.xml";
OPENMC_PWD = "${argotk}/share/openmc";
});
openmc-data = (pkgs.nix-update-source.fetch applications/openmc/data.json).src;
};
# This file re-exports a full nixpkgs-like package set.
in pkgs // argopkgs
# `-B@out@/bin' forces gcc to use ld-wrapper.sh when calling ld.
export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE"
if [ -e @out@/nix-support/libc-cflags ]; then
export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE"
fi
if [ -e @out@/nix-support/gcc-cflags ]; then
export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/cc-cflags) $NIX_CFLAGS_COMPILE"
fi
if [ -e @out@/nix-support/gnat-cflags ]; then
export NIX_GNATFLAGS_COMPILE="$(cat @out@/nix-support/gnat-cflags) $NIX_GNATFLAGS_COMPILE"
fi
if [ -e @out@/nix-support/libc-ldflags ]; then
export NIX_LDFLAGS+=" $(cat @out@/nix-support/libc-ldflags)"
fi
if [ -e @out@/nix-support/gcc-ldflags ]; then
export NIX_LDFLAGS+=" $(cat @out@/nix-support/cc-ldflags)"
fi
if [ -e @out@/nix-support/libc-ldflags-before ]; then
export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE"
fi
export NIX_CC_WRAPPER_FLAGS_SET=1
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