Unable to import faiss in python in AIX (#4602)

Summary:
Closes https://github.com/facebookresearch/faiss/issues/4601.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4602

Reviewed By: mnorris11, subhadeepkaran

Differential Revision: D84095719

Pulled By: junjieqi

fbshipit-source-id: 4e9a381ee863b8ef71552ac2f312d48b4146d058
This commit is contained in:
KV2773
2025-10-07 17:34:42 -07:00
committed by meta-codesync[bot]
parent 4fab13c9c6
commit 7f7b518df5
+6 -3
View File
@@ -22,7 +22,10 @@ shutil.copyfile("gpu_wrappers.py", "faiss/gpu_wrappers.py")
shutil.copyfile("extra_wrappers.py", "faiss/extra_wrappers.py")
shutil.copyfile("array_conversions.py", "faiss/array_conversions.py")
ext = ".pyd" if platform.system() == "Windows" else ".so"
if platform.system() != "AIX":
ext = ".pyd" if platform.system() == "Windows" else ".so"
else:
ext = ".a"
prefix = "Release/" * (platform.system() == "Windows")
swigfaiss_generic_lib = f"{prefix}_swigfaiss{ext}"
@@ -43,7 +46,7 @@ found_faiss_example_external_module_lib = os.path.exists(
faiss_example_external_module_lib
)
if(platform.system() != "AIX"):
if platform.system() != "AIX":
assert (
found_swigfaiss_generic
or found_swigfaiss_avx2
@@ -118,7 +121,7 @@ setup(
install_requires=["numpy", "packaging"],
packages=["faiss", "faiss.contrib", "faiss.contrib.torch"],
package_data={
"faiss": ["*.so", "*.pyd"],
"faiss": ["*.so", "*.pyd", "*.a"],
},
zip_safe=False,
)