1{ lib, stdenv
2, fetchFromGitHub
3, cmake
4, llvmPackages
5, enableAVX ? stdenv.hostPlatform.avxSupport
6}:
7
8stdenv.mkDerivation rec {
9 pname = "NGT";
10 version = "1.12.3-alpha";
11
12 src = fetchFromGitHub {
13 owner = "yahoojapan";
14 repo = "NGT";
15 rev = "29c88ff6cd5824d3196986d1f50b834565b6c9dd";
16 sha256 = "sha256-nu0MJNpaenOB4+evoSVLKmPIuZXVj1Rm9x53+TfhezY=";
17 };
18
19 nativeBuildInputs = [ cmake ];
20 buildInputs = [ llvmPackages.openmp ];
21
22 NIX_ENFORCE_NO_NATIVE = ! enableAVX;
23 __AVX2__ = if enableAVX then 1 else 0;
24
25 meta = with lib; {
26 homepage = "https://github.com/yahoojapan/NGT";
27 description = "Nearest Neighbor Search with Neighborhood Graph and Tree for High-dimensional Data";
28 platforms = platforms.linux ++ platforms.darwin;
29 license = licenses.asl20;
30 maintainers = with maintainers; [ tomberek ];
31 };
32}