ubuntu 源码编译安装 faiss
# 安装依赖
apt update
apt install build-essential libopenblas-dev liblapack-dev libopencv-dev
# clone
git clone https://github.com/facebookresearch/faiss.git
cd faiss
./configure
make -j32
make install
使用示例:
#include <faiss/IndexFlat.h>
#include <faiss/IndexIVFFlat.h>
faiss::IndexFlatL2 index(dimension);
faiss::IndexIVFFlat quantizer(&index, dimension, num_centroids, faiss::METRIC_L2);