summary refs log tree commit diff
path: root/pkgs/development/libraries/dnnl/default.nix
blob: 73a6ff77522f8c02146f1b51360b284d943380d3 (plain) (blame)
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
{ stdenv, lib, fetchFromGitHub, substituteAll, cmake, bash }:

stdenv.mkDerivation rec {
  pname = "dnnl";
  version = "1.2";

  src = fetchFromGitHub {
    owner = "intel";
    repo = "mkl-dnn";
    rev = "v${version}";
    sha256 = "17xpdwqjfb2bq586gnk3hq94r06jd8pk6qfs703qqd7155fkbil9";
  };

  # Generic fix merged upstream in https://github.com/intel/mkl-dnn/pull/631
  # Delete after next release
  patches = [ (substituteAll {
    src = ./bash-to-sh.patch;
    inherit bash;
  }) ];

  outputs = [ "out" "dev" "doc" ];

  nativeBuildInputs = [ cmake ];

  doCheck = true;

  # The test driver doesn't add an RPath to the build libdir
  preCheck = ''
    export LD_LIBRARY_PATH=$PWD/src
  '';

  # The cmake install gets tripped up and installs a nix tree into $out, in
  # addition to the correct install; clean it up.
  postInstall = ''
    rm -r $out/nix
  '';

  meta = with lib; {
    description = "Deep Neural Network Library (DNNL)";
    homepage = "https://intel.github.io/mkl-dnn/dev_guide_transition_to_dnnl.html";
    license = licenses.asl20;
    platforms = [ "x86_64-linux" ];
    maintainers = with maintainers; [ alexarice bhipple ];
  };
}