summaryrefslogtreecommitdiff
path: root/pkgs/by-name/co/conduit/package.nix
blob: 74a581ea495cdb824d22af1c836857702207e0a9 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  openmpi,

  # passthru
  conduit,
  python3Packages,
  nix-update-script,

  mpiSupport ? false,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "conduit";
  version = "0.9.4";

  src = fetchFromGitHub {
    owner = "LLNL";
    repo = "conduit";
    tag = "v${finalAttrs.version}";
    fetchSubmodules = true;
    hash = "sha256-xs/9hsE1DLCegXp3CHSl6qpC4ap+niNAWX5lNlUxz9E=";
  };

  nativeBuildInputs = [
    cmake
  ];

  cmakeDir = "../src";

  buildInputs = lib.optionals mpiSupport [
    openmpi
  ];

  cmakeFlags = [
    (lib.cmakeBool "ENABLE_MPI" mpiSupport)
  ];

  installCheckPhase = ''
    runHook preInstallCheck

    make test

    runHook postInstallCheck
  '';
  doInstallCheck = true;

  passthru = {
    tests = {
      withMpi = conduit.override { mpiSupport = true; };
      pythonModule = python3Packages.conduit;
      pythonModuleWithMpi = python3Packages.conduit-mpi;
    };
    updateScript = nix-update-script { };
  };

  meta = {
    description = "Simplified Data Exchange for HPC Simulations";
    homepage = "https://github.com/LLNL/conduit";
    changelog = "https://github.com/LLNL/conduit/blob/v${finalAttrs.version}/CHANGELOG.md";
    license = lib.licenses.bsd3Lbnl;
    maintainers = with lib.maintainers; [ GaetanLepage ];
    platforms = lib.platforms.all;
  };
})