diff --git a/F/Faiss/Faiss/build_tarballs.jl b/F/Faiss/Faiss/build_tarballs.jl index bca8fa27748..0b7d7956741 100644 --- a/F/Faiss/Faiss/build_tarballs.jl +++ b/F/Faiss/Faiss/build_tarballs.jl @@ -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", ) diff --git a/F/Faiss/Faiss_CUDA/build_tarballs.jl b/F/Faiss/Faiss_CUDA/build_tarballs.jl index d0fc49f2e45..f5c523d3fb7 100644 --- a/F/Faiss/Faiss_CUDA/build_tarballs.jl +++ b/F/Faiss/Faiss_CUDA/build_tarballs.jl @@ -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 diff --git a/F/Faiss/bundled/patches/faiss-cmake-mkl-optional.patch b/F/Faiss/bundled/patches/faiss-cmake-mkl-optional.patch new file mode 100644 index 00000000000..a61215b778e --- /dev/null +++ b/F/Faiss/bundled/patches/faiss-cmake-mkl-optional.patch @@ -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) + 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}) diff --git a/F/Faiss/common.jl b/F/Faiss/common.jl index d31a935b233..e6ae9f86c83 100644 --- a/F/Faiss/common.jl +++ b/F/Faiss/common.jl @@ -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 @@ -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 @@ -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[ @@ -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")), ]