Closed zackangelo closed 1 year ago
I can build faiss in ./vendor/faiss
manually and it works using this command:
LDFLAGS="-L/opt/homebrew/opt/llvm/lib" CPPFLAGS="-I/opt/homebrew/opt/llvm/include" CXX=/opt/homebrew/opt/llvm/bin/clang++ CC=/opt/homebrew/opt/llvm/bin/clang cmake -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -B build .
When I try to specify those same environment variables for make loadable
, it doesn't work.
Was able to get it to compile, but had to compile faiss separately (and comment out out the add_subdirectory
call).
I also had to change this line to omit the avx2
version of the faiss library:
https://github.com/asg017/sqlite-vss/blob/2d0dd01d3dfaf76a1bd4fe7225c4d71c8d011977/CMakeLists.txt#L52
I don't know anything about CMake, but it seems like hard coding an Intel-specific library name would cause problems on ARM macs?
Hey @zackangelo , apologies for that, I've been meaning to update the docs for compiling sqlite-vss
on a Mac M1. A few questions:
make loadable
?export CC="/opt/homebrew/opt/llvm/bin/clang"
export CXX="/opt/homebrew/opt/llvm/bin/clang++"
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
They are almost the same as the ones you list, but the LDFLAGS and CPPFLAGS are referencing libomp
instead of llvm
vector0.dylib
and vss0.dylib
extensions? You might have to curl
or wget
that file directly instead of downloading manually through the browser, to avoid CSP stuff. Those are pre-compiled on a M2 machine and I'm not sure if they'll work probably on an M1And re faiss_avx2
: that's odd, it seems to work on my M2. Not sure if the Rosetta in M2 is able to translate avx2 while M1 can't, I'm not familiar with that. If it doesn't work with the new env vars, try replacing that like with faiss
instead of faiss_avx2
and see if that works as expected
Thanks for the help! I'll try those env vars little later today.
I did try downloading the pre-compiled version, but the archive only contained vector0.dylib
, it was missing vss0.dylib
.
The latest "alpha' releases should have both vector0.dylib
and vss0.dylib
, you can try here with sqlite-vss-v0.1.1-alpha.13-loadable-macos-aarch64.tar.gz
https://github.com/asg017/sqlite-vss/releases/tag/v0.1.1-alpha.13
I'll be publishing v0.1.1
soon
Trying to compile from source on Mac OS X Ventura (M1), getting this error:
Any ideas? I've tried installing
libomp
using homebrew but that didn't seem to help.