Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:mslacken:ml
faiss_bug
python-faiss-cpu.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File python-faiss-cpu.spec of Package faiss_bug
# # spec file for package python-faiss-cpu # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %{?sle15_python_module_pythons} Name: python-faiss-cpu Version: 1.8.0 Release: 0 Summary: A library for efficient similarity search and clustering of dense vectors License: MIT URL: https://ai.meta.com/tools/faiss/ Source0: https://github.com/facebookresearch/faiss/archive/refs/tags/v1.8.0.tar.gz#/faiss-%{version}.tar.gz Patch10: fix-swig-on-obs.patch Patch11: install-python-callback-lib.patch BuildRequires: %{python_module numpy-devel} BuildRequires: %{python_module setuptools} BuildRequires: blas-devel BuildRequires: cmake BuildRequires: fdupes BuildRequires: ffcall BuildRequires: gcc-c++ BuildRequires: lapack-devel BuildRequires: python-rpm-macros BuildRequires: suse-module-tools BuildRequires: swig Requires: python-numpy Requires: python-packaging %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "base" %bcond_with avx2 %bcond_with avx512 %bcond_without framework # build framework, devel and python packages %endif %if "%{flavor}" == "avx2" %bcond_without avx2 %bcond_with avx512 %bcond_with framework # build optimized lib only #!BuildTarget: x86_64_v3-linux %endif %if "%{flavor}" == "avx512" #!BuildTarget: x86_64_v4-linux %bcond_with avx2 %bcond_without avx512 %bcond_with framework # build optimized lib only %endif %if %{with framework} %python_subpackages %endif %description Faiss is a library for efficient similarity search and clustering of dense vectors. It contains algorithms that search in sets of vectors of any size, up to ones that possibly do not fit in RAM. It also contains supporting code for evaluation and parameter tuning. Faiss is written in C++ with complete wrappers for Python/numpy. Some of the most useful algorithms are implemented on the GPU. It is developed by Facebook AI Research. %if %{with framework} %package -n faiss-devel Summary: Development headers for faiss %description -n faiss-devel These are the header for C and C++ of faiss %endif %package -n libfaiss Summary: faiss library %description -n libfaiss Faiss is a library for efficient similarity search and clustering of dense vectors. It contains algorithms that search in sets of vectors of any size, up to ones that possibly do not fit in RAM. It also contains supporting code for evaluation and parameter tuning. Faiss is written in C++ with complete wrappers for Python/numpy. Some of the most useful algorithms are implemented on the GPU. It is developed by Facebook AI Research. %prep %setup -q -n faiss-%{version} %autopatch -p1 %build %cmake \ -DCMAKE_SKIP_RPATH=ON \ -DFAISS_ENABLE_GPU=OFF \ -DFAISS_ENABLE_C_API=ON \ -DFAISS_ENABLE_PYTHON=OFF \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_STATIC_LIBS=OFF \ -DBUILD_TESTING=OFF \ -DCMAKE_BUILD_TYPE=Release \ %if %{with avx2} -DFAISS_OPT_LEVEL=avx \ %endif %if %{with avx512} -DFAISS_OPT_LEVEL=avx512 \ %endif %cmake_build faiss cd .. %if %{with framework} %{python_expand # need to disable the standard eror from the linker for # undefined symbols as witg doesn't create all the functions %cmake \ -DCMAKE_EXE_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,-z,now" \ -DCMAKE_SHARED_LINKER_FLAGS="%{?build_ldflags} -Wl,--as-needed -Wl,-z,now" \ -DCMAKE_SKIP_RPATH=ON \ -DFAISS_ENABLE_GPU=OFF \ -DFAISS_ENABLE_C_API=OFF \ -DFAISS_ENABLE_PYTHON=ON \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_STATIC_LIBS=OFF \ -DBUILD_TESTING=OFF \ -DCMAKE_BUILD_TYPE=Release %cmake_build swigfaiss cd .. } cd %{__builddir}/faiss/python %python_build %endif %install %cmake_install %if %{with framework} cd %{__builddir}/faiss/python %python_install %python_expand %fdupes %{buildroot}%{$python_sitearch} %else rm -rf %{buildroot}%{_includedir}/faiss \ %{buildroot}%{_datadir}/faiss %endif %if %{with framework} %files %{python_files} %{python_sitelib}/* %files -n faiss-devel %{_includedir}/faiss/* %dir %{_includedir}/faiss %{_datadir}/faiss %endif %files -n libfaiss %{_libdir}/libfaiss.so %if %{with framework} %{_libdir}/libfaiss_python_callbacks.so %endif %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor