Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Faiss
Commits
ca1a531d
Commit
ca1a531d
authored
Sep 26, 2024
by
zhanggzh
Browse files
add mkl so file
parent
8102ac0a
Pipeline
#1944
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
faiss/python/setup.py
faiss/python/setup.py
+11
-8
No files found.
faiss/python/setup.py
View file @
ca1a531d
# 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
,
...
@@ -71,11 +74,11 @@ setup(
...
@@ -71,11 +74,11 @@ setup(
author_email
=
'matthijs@fb.com'
,
author_email
=
'matthijs@fb.com'
,
license
=
'MIT'
,
license
=
'MIT'
,
keywords
=
'search nearest neighbors'
,
keywords
=
'search nearest neighbors'
,
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
,
)
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment