"src/git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "a39cd633f88b84f4f6230eb0bf8eda5a52030c8b"
Commit ca1a531d authored by zhanggzh's avatar zhanggzh
Browse files

add mkl so file

parent 8102ac0a
Pipeline #1944 canceled with stages
# 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.
from __future__ import print_function from __future__ import print_function
from setuptools import setup, find_packages from setuptools import setup, find_packages
import os import os
...@@ -17,7 +12,13 @@ shutil.copyfile("__init__.py", "faiss/__init__.py") ...@@ -17,7 +12,13 @@ shutil.copyfile("__init__.py", "faiss/__init__.py")
shutil.copyfile("loader.py", "faiss/loader.py") shutil.copyfile("loader.py", "faiss/loader.py")
shutil.copyfile("libfaiss_python_callbacks.so", "faiss/libfaiss_python_callbacks.so") shutil.copyfile("libfaiss_python_callbacks.so", "faiss/libfaiss_python_callbacks.so")
shutil.copyfile("../libfaiss.so", "faiss/libfaiss.so") shutil.copyfile("../libfaiss.so", "faiss/libfaiss.so")
shutil.copyfile("/opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64_lin/libmkl_rt.so", "faiss/libmkl_rt.so")
# 复制所有的 .so 库到 faiss 目录
intel_mkl_libs_dir = "/opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64_lin"
for file in os.listdir(intel_mkl_libs_dir):
if file.endswith(".so"):
shutil.copyfile(os.path.join(intel_mkl_libs_dir, file), os.path.join("faiss", file))
ext = ".pyd" if platform.system() == 'Windows' else ".so" ext = ".pyd" if platform.system() == 'Windows' else ".so"
prefix = "Release/" * (platform.system() == 'Windows') prefix = "Release/" * (platform.system() == 'Windows')
...@@ -40,6 +41,7 @@ if found_swigfaiss_avx2: ...@@ -40,6 +41,7 @@ if found_swigfaiss_avx2:
print(f"Copying {swigfaiss_avx2_lib}") print(f"Copying {swigfaiss_avx2_lib}")
shutil.copyfile("swigfaiss_avx2.py", "faiss/swigfaiss_avx2.py") shutil.copyfile("swigfaiss_avx2.py", "faiss/swigfaiss_avx2.py")
shutil.copyfile(swigfaiss_avx2_lib, f"faiss/_swigfaiss_avx2{ext}") shutil.copyfile(swigfaiss_avx2_lib, f"faiss/_swigfaiss_avx2{ext}")
ROCM_PATH = os.getenv('ROCM_PATH') ROCM_PATH = os.getenv('ROCM_PATH')
dtk_path = ROCM_PATH + '/.info/rocm_version' dtk_path = ROCM_PATH + '/.info/rocm_version'
with open(dtk_path, 'r') as file: with open(dtk_path, 'r') as file:
...@@ -61,6 +63,7 @@ code for evaluation and parameter tuning. Faiss is written in C++ with ...@@ -61,6 +63,7 @@ code for evaluation and parameter tuning. Faiss is written in C++ with
complete wrappers for Python/numpy. Some of the most useful algorithms complete wrappers for Python/numpy. Some of the most useful algorithms
are implemented on the GPU. It is developed by Facebook AI Research. are implemented on the GPU. It is developed by Facebook AI Research.
""" """
setup( setup(
name='faiss', name='faiss',
version='1.7.2' + "+das.dtk" + dtk_version, version='1.7.2' + "+das.dtk" + dtk_version,
...@@ -75,7 +78,7 @@ setup( ...@@ -75,7 +78,7 @@ setup(
install_requires=['numpy'], install_requires=['numpy'],
packages=['faiss', 'faiss.contrib'], packages=['faiss', 'faiss.contrib'],
package_data={ package_data={
'faiss': ['*.so', '*.pyd'], 'faiss': ['*.so', '*.pyd'], # 包含 .so 和 .pyd 文件
}, },
zip_safe=False, zip_safe=False,
) )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment