about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/ngt/default.nix
blob: e42ee750cc09c2c892e2b2db43afd5c24c411d1c (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
{ lib, stdenv
, fetchFromGitHub
, cmake
, llvmPackages
, enableAVX ? stdenv.hostPlatform.avxSupport
}:

stdenv.mkDerivation rec {
  pname = "NGT";
  version = "1.12.3-alpha";

  src = fetchFromGitHub {
    owner = "yahoojapan";
    repo = "NGT";
    rev = "29c88ff6cd5824d3196986d1f50b834565b6c9dd";
    sha256 = "sha256-nu0MJNpaenOB4+evoSVLKmPIuZXVj1Rm9x53+TfhezY=";
  };

  nativeBuildInputs = [ cmake ];
  buildInputs = [ llvmPackages.openmp ];

  NIX_ENFORCE_NO_NATIVE = ! enableAVX;
  __AVX2__ = if enableAVX then 1 else 0;

  meta = with lib; {
    homepage = "https://github.com/yahoojapan/NGT";
    description = "Nearest Neighbor Search with Neighborhood Graph and Tree for High-dimensional Data";
    platforms = platforms.linux ++ platforms.darwin;
    license = licenses.asl20;
    maintainers = with maintainers; [ tomberek ];
  };
}