meta.yaml 2.45 KB
Newer Older
huchen's avatar
huchen committed
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

{% set version = environ.get('GIT_DESCRIBE_TAG').lstrip('v') %}
{% set suffix = "_nightly" if environ.get('PACKAGE_TYPE') == 'nightly' else "" %}
{% set number = GIT_DESCRIBE_NUMBER %}

package:
  name: faiss-pkg
  version: {{ version }}

build:
  number: {{ number }}

about:
  home: https://github.com/facebookresearch/faiss
  license: MIT
  license_family: MIT
  license_file: LICENSE
  summary: A library for efficient similarity search and clustering of dense vectors.

source:
  git_url: ../../

outputs:
  - name: libfaiss
    script: build-lib.sh
    build:
      string: "h{{ PKG_HASH }}_{{ number }}_cuda{{ cudatoolkit }}{{ suffix }}"
      run_exports:
        - {{ pin_compatible('libfaiss', exact=True) }}
      script_env:
        - CUDA_ARCHS
    requirements:
      build:
        - {{ compiler('cxx') }}
        - llvm-openmp  # [osx]
        - cmake >=3.18
        - make  # [not win]
      host:
        - mkl =2018
        - cudatoolkit {{ cudatoolkit }}
      run:
        - mkl >=2018  # [not win]
        - mkl >=2018,<2021  # [win]
        - {{ pin_compatible('cudatoolkit', max_pin='x.x') }}
    test:
      commands:
        - test -f $PREFIX/lib/libfaiss.so              # [linux]
        - test -f $PREFIX/lib/libfaiss.dylib           # [osx]
        - conda inspect linkages -p $PREFIX $PKG_NAME  # [not win]
        - conda inspect objects -p $PREFIX $PKG_NAME   # [osx]

  - name: faiss-gpu
    script: build-pkg.sh
    build:
      string: "py{{ PY_VER }}_h{{ PKG_HASH }}_{{ number }}_cuda{{ cudatoolkit }}{{ suffix }}"
    requirements:
      build:
        - {{ compiler('cxx') }}
        - swig
        - cmake >=3.17
        - make  # [not win]
      host:
        - python {{ python }}
        - numpy =1.11
        - {{ pin_subpackage('libfaiss', exact=True) }}
      run:
        - python {{ python }}
        - numpy >=1.11,<2
        - {{ pin_subpackage('libfaiss', exact=True) }}
    test:
      requires:
        - numpy
        - scipy
        - pytorch
      commands:
        - python -m unittest discover tests/
        - cp tests/common_faiss_tests.py faiss/gpu/test
        - python -m unittest discover faiss/gpu/test/
        - sh test_cpu_dispatch.sh  # [linux]
      files:
        - test_cpu_dispatch.sh  # [linux]
      source_files:
        - tests/
        - faiss/gpu/test/