mirror of
https://github.com/facebookresearch/faiss.git
synced 2026-10-11 22:50:00 +00:00
181 lines
6.5 KiB
YAML
181 lines
6.5 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 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 # [x86_64 and not win and not osx]
|
|
script: build-lib-osx.sh # [x86_64 and osx]
|
|
script: build-lib-arm64.sh # [not x86_64]
|
|
script: build-lib.bat # [win]
|
|
build:
|
|
string: "py{{ PY_VER }}_h{{ PKG_HASH }}_{{ number }}_cpu{{ suffix }}"
|
|
run_exports:
|
|
- {{ pin_compatible('libfaiss', exact=True) }}
|
|
requirements:
|
|
build:
|
|
- python {{ python }}
|
|
- {{ compiler('cxx') }}
|
|
- libcxx =20.1.1 # [osx and arm64]
|
|
- sysroot_linux-64 =2.17 # [linux64]
|
|
- llvm-openmp # [osx or linux64]
|
|
- cmake >=3.24.0
|
|
- make =4.2 # [not win and not (osx and arm64)]
|
|
- make =4.4 # [osx and arm64]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl-devel >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl-devel >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl-devel >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% else %}
|
|
- mkl-devel >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl-devel >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi
|
|
{% endif %}
|
|
- libopenblas =0.3.34 # [osx]
|
|
host:
|
|
- python {{ python }}
|
|
- libcxx =20.1.1 # [osx and arm64]
|
|
- libsvs-runtime =0.4.0 # [x86_64 and linux]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% endif %}
|
|
- openblas =0.3.34 # [linux and not x86_64]
|
|
- libopenblas =0.3.34 # [osx]
|
|
run:
|
|
- python {{ python }}
|
|
- libcxx =20.1.1 # [osx and arm64]
|
|
- libsvs-runtime =0.4.0 # [x86_64 and linux]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% endif %}
|
|
- openblas =0.3.34 # [linux and not x86_64]
|
|
- libopenblas =0.3.34 # [osx]
|
|
test:
|
|
requires:
|
|
- conda-build =25.3.1
|
|
commands:
|
|
- test -f $PREFIX/lib/libfaiss$SHLIB_EXT # [not win]
|
|
- test -f $PREFIX/lib/libfaiss_avx2$SHLIB_EXT # [x86_64 and not win]
|
|
- test -f $PREFIX/lib/libfaiss_metal.a # [osx and arm64]
|
|
- test -f $PREFIX/lib/MetalDistance.metallib # [osx and arm64]
|
|
- conda inspect linkages -p $PREFIX $PKG_NAME # [not win]
|
|
- conda inspect objects -p $PREFIX $PKG_NAME # [osx]
|
|
|
|
- name: faiss-cpu
|
|
script: build-pkg.sh # [x86_64 and not win and not osx]
|
|
script: build-pkg-osx.sh # [x86_64 and osx]
|
|
script: build-pkg-arm64.sh # [not x86_64]
|
|
script: build-pkg.bat # [win]
|
|
build:
|
|
string: "py{{ PY_VER }}_h{{ PKG_HASH }}_{{ number }}_cpu{{ suffix }}"
|
|
requirements:
|
|
build:
|
|
- python {{ python }}
|
|
- {{ compiler('cxx') }}
|
|
- libcxx =20.1.1 # [osx and arm64]
|
|
- sysroot_linux-64 =2.17 # [linux64]
|
|
- swig =4.0
|
|
- cmake >=3.24.0
|
|
- make =4.2 # [not win and not (osx and arm64)]
|
|
- make =4.4 # [osx and arm64]
|
|
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% endif %}
|
|
- libopenblas =0.3.34 # [osx]
|
|
host:
|
|
- python {{ python }}
|
|
- numpy >=2.0,<3.0
|
|
- setuptools
|
|
- {{ pin_subpackage('libfaiss', exact=True) }}
|
|
- libcxx =20.1.1 # [osx and arm64]
|
|
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% endif %}
|
|
- libopenblas =0.3.34 # [osx]
|
|
run:
|
|
- python {{ python }}
|
|
- numpy >=2.0,<3.0
|
|
- packaging
|
|
- {{ pin_subpackage('libfaiss', exact=True) }}
|
|
- libcxx =20.1.1 # [osx and arm64]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% endif %}
|
|
- libopenblas =0.3.34 # [osx]
|
|
test:
|
|
requires:
|
|
- numpy >=2.0,<3.0
|
|
- scipy
|
|
- pytorch-cpu >=2.7 # [not win]
|
|
- pytorch >=2.7 # [win]
|
|
- pytest # [osx and arm64]
|
|
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64]
|
|
- python_abi <3.12
|
|
{% elif PY_VER == '3.12' %}
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and not win]
|
|
- mkl >=2024.2.2,<2026 # [x86_64 and win]
|
|
- python_abi =3.12
|
|
{% endif %}
|
|
commands:
|
|
- python -X faulthandler -m unittest discover -v -s tests/ -p "test_*" # [not (osx and arm64)]
|
|
- python -X faulthandler -m pytest tests/ -v -q -k "not test_update_codebooks_with_double and not (TestProductLocalSearchQuantizer and test_lut)" # [osx and arm64]
|
|
- python -X faulthandler -m unittest discover -v -s tests/ -p "torch_*"
|
|
- sh test_cpu_dispatch.sh # [linux64]
|
|
files:
|
|
- test_cpu_dispatch.sh # [linux64]
|
|
source_files:
|
|
- tests/
|