Skip to content

Commit

Permalink
Merge pull request #10 from makosten/use_main_faiss_branch
Browse files Browse the repository at this point in the history
Fix Dynamic Library Reference
  • Loading branch information
andyalm authored Nov 6, 2024
2 parents 0306f49 + 4d8fe10 commit 90d79c2
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ENV MKLROOT=/opt/intel/mkl

# build faiss and the c api
RUN apt-get -y install git && \
git clone -b ${FAISS_VERSION} https://github.com/${GITHUB_ACCOUNT}/faiss.git /faiss && \
git clone --depth=1 -b ${FAISS_VERSION} https://github.com/${GITHUB_ACCOUNT}/faiss.git /faiss && \
cd /faiss && \
sed -i 's/faiss_c PRIVATE faiss/faiss_c PRIVATE faiss_avx2/g' c_api/CMakeLists.txt && \
cmake -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DFAISS_ENABLE_C_API=ON -DBUILD_SHARED_LIBS=ON -DFAISS_OPT_LEVEL=avx2 -B build . && \
Expand Down
Binary file modified FaissMask/runtimes/linux-x64/native/libfaiss_avx2.so
Binary file not shown.
Binary file modified FaissMask/runtimes/linux-x64/native/libfaiss_c.so
Binary file not shown.
Binary file modified FaissMask/runtimes/osx-arm64/native/libfaiss.dylib
Binary file not shown.
Binary file modified FaissMask/runtimes/osx-arm64/native/libfaiss_c.dylib
Binary file not shown.
4 changes: 2 additions & 2 deletions build-faiss-linux.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -e

FAISS_VERSION=${1:-vector_transform_c_api}
GITHUB_ACCOUNT=${2:-makosten}
FAISS_VERSION=${1:-main}
GITHUB_ACCOUNT=${2:-facebookresearch}
arch=amd64
rm -f FaissMask/runtimes/linux-x64/native/*
docker-compose build --build-arg arch=$arch --build-arg FAISS_VERSION=$FAISS_VERSION --build-arg GITHUB_ACCOUNT=$GITHUB_ACCOUNT
Expand Down
9 changes: 5 additions & 4 deletions build-faiss-macos.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash

BRANCH="vector_transform_c_api"
GITHUB_ACCOUNT="makosten"
BRANCH="main"
GITHUB_ACCOUNT="facebookresearch"

brew install libomp
brew install cmake
git clone --recursive --branch ${BRANCH} https://github.com/${GITHUB_ACCOUNT}/faiss.git libfaiss-src
git clone --depth=1 --recursive --branch ${BRANCH} https://github.com/${GITHUB_ACCOUNT}/faiss.git libfaiss-src
cd libfaiss-src
cmake -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -DOpenMP_libomp_LIBRARY="/opt/homebrew/opt/libomp/lib/libomp.dylib" -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DFAISS_ENABLE_C_API=ON -DBUILD_SHARED_LIBS=ON -B build .
cmake -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -DOpenMP_libomp_LIBRARY="/opt/homebrew/opt/libomp/lib/libomp.dylib" -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp /opt/homebrew/opt/libomp/lib/libomp.dylib -I /opt/homebrew/opt/libomp/include" -DOpenMP_CXX_LIB_NAMES="libomp" -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DFAISS_ENABLE_C_API=ON -DBUILD_SHARED_LIBS=ON -B build .
make -C build -j faiss
sudo make -C build install
install_name_tool -rpath "${PWD}"/build/faiss @loader_path ./build/c_api/libfaiss_c.dylib

arch=arm64
if [[ $(uname -m) == 'x86_64' ]]; then
Expand Down

0 comments on commit 90d79c2

Please sign in to comment.