Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions F/Faiss/Faiss/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ include(joinpath(@__DIR__, "..", "common.jl"))

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
julia_compat="1.6",
preferred_gcc_version=v"10", # Not using v"7", since OpenBLAS v0.3.29+ on PowerPC64LE requires libgfortran5, and not using v"8", and v"9" due to internal compiler errors on aarch64-linux-gnu
julia_compat="1.9",
preferred_gcc_version=v"7",
)
3 changes: 1 addition & 2 deletions F/Faiss/Faiss_CUDA/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ for platform in platforms

build_tarballs(ARGS, name, version, sources, script, [platform], products, [dependencies; cuda_deps];
lazy_artifacts=true,
julia_compat="1.6",
julia_compat="1.9",
preferred_gcc_version=v"7",
augment_platform_block=CUDA.augment,
skip_audit=true,
dont_dlopen=true)
end
# trigger yggy
27 changes: 27 additions & 0 deletions F/Faiss/bundled/patches/faiss-cmake-mkl-optional.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4fea46a..12f8aef5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,6 +59,7 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# Valid values are "generic", "avx2", "avx512", "sve".
option(FAISS_OPT_LEVEL "" "generic")
option(FAISS_ENABLE_GPU "Enable support for GPU indexes." ON)
+option(FAISS_ENABLE_MKL "Enable MKL." ON)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

option(FAISS_ENABLE_RAFT "Enable RAFT for GPU indexes." OFF)
option(FAISS_ENABLE_ROCM "Enable ROCm for GPU indexes." OFF)
option(FAISS_ENABLE_PYTHON "Build Python extension." ON)
diff --git a/faiss/CMakeLists.txt b/faiss/CMakeLists.txt
index 2871d974..6588b2d2 100644
--- a/faiss/CMakeLists.txt
+++ b/faiss/CMakeLists.txt
@@ -354,7 +354,9 @@ target_link_libraries(faiss_avx2 PRIVATE OpenMP::OpenMP_CXX)
target_link_libraries(faiss_avx512 PRIVATE OpenMP::OpenMP_CXX)
target_link_libraries(faiss_sve PRIVATE OpenMP::OpenMP_CXX)

-find_package(MKL)
+if(FAISS_ENABLE_MKL)
+ find_package(MKL)
+endif()
if(MKL_FOUND)
target_link_libraries(faiss PRIVATE ${MKL_LIBRARIES})
target_link_libraries(faiss_avx2 PRIVATE ${MKL_LIBRARIES})
32 changes: 10 additions & 22 deletions F/Faiss/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ apk del cmake

cd faiss

atomic_patch -p1 ../patches/faiss-cmake-mkl-optional.patch
atomic_patch -p1 ../patches/faiss-mingw32-cmake.patch
atomic_patch -p1 ../patches/faiss-mingw32-InvertedListsIOHook.patch
atomic_patch -p1 ../patches/faiss-mingw32.patch
Expand Down Expand Up @@ -41,14 +42,16 @@ if [[ $bb_full_target == *cuda* ]]; then
fi

cmake -B build \
-DBLA_VENDOR=libblastrampoline \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
-DFAISS_ENABLE_C_API=ON \
-DFAISS_ENABLE_GPU=OFF \
-DFAISS_ENABLE_MKL=OFF \
-DFAISS_ENABLE_PYTHON=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_SHARED_LIBS=ON \
-DFAISS_ENABLE_C_API=ON \
${cmake_extra_args[@]}
cmake --build build --parallel ${nproc}
cmake --install build
Expand All @@ -62,19 +65,7 @@ fi

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = supported_platforms()

mkl_platforms = Platform[
Platform("x86_64", "Linux"),
Platform("x86_64", "MacOS"),
Platform("x86_64", "Windows"),
]

openblas_platforms = filter(p -> p ∉ mkl_platforms, platforms)

platforms = expand_cxxstring_abis(platforms)
mkl_platforms = expand_cxxstring_abis(mkl_platforms)
openblas_platforms = expand_cxxstring_abis(openblas_platforms)
platforms = expand_cxxstring_abis(supported_platforms())

# The products that we will ensure are always built
products = Product[
Expand All @@ -90,9 +81,6 @@ dependencies = [
# systems), and libgomp from `CompilerSupportLibraries_jll` everywhere else.
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae"); platforms=filter(!Sys.isbsd, platforms)),
Dependency(PackageSpec(name="LLVMOpenMP_jll", uuid="1d63c593-3942-5779-bab2-d838dc0a180e"); platforms=filter(Sys.isbsd, platforms)),
Dependency("LAPACK_jll"; platforms = openblas_platforms),
Dependency("MKL_jll"; platforms = mkl_platforms),
BuildDependency("MKL_Headers_jll"; platforms = mkl_platforms),
Dependency("OpenBLAS32_jll"; platforms = openblas_platforms),
HostBuildDependency(PackageSpec("CMake_jll", v"3.28.1")),
Dependency("libblastrampoline_jll"; compat="5.4"),
HostBuildDependency(PackageSpec("CMake_jll", v"3.30.2")),
]