Lucas Hosseini 88eabe97f9 Fix version string in conda builds.
Summary: Currently, conda version strings are built from the latest git tag, which starts with the letter `v`. This confuses conda, which orders v1.6.5 before 1.6.3.

Reviewed By: LowikC

Differential Revision: D25151276

fbshipit-source-id: 7abfb547fee3468b26fedb6637a15e725755daf3
2020-11-22 08:58:08 -08:00

85 lines
2.2 KiB
YAML

# 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 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 }}"
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-devel >=2018
- blas =*=mkl
- cudatoolkit {{ cudatoolkit }}
run:
- mkl >=2018
- blas =*=mkl
- {{ 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 }}"
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 }}
- {{ pin_compatible('numpy') }}
- {{ pin_subpackage('libfaiss', exact=True) }}
test:
requires:
- numpy
- scipy
- pytorch
commands:
- python -m unittest discover tests/
- python -m unittest discover faiss/gpu/test/
source_files:
- tests/
- faiss/gpu/test/