$ git clone https://github.com/facebookresearch/faiss.git
$ cd faiss
$ cp example_makefiles/makefile.inc.Mac.brew makefile.inc
$ brew install llvm
$ brew install swig
$ make
/usr/local/opt/llvm/bin/clang++ -o tests/demo_ivfpq_indexing -fPIC -m64 -Wall -g -O3 -msse4 -mpopcnt -fopenmp -Wno-sign-compare -Dnullptr=NULL -I/usr/local/opt/llvm/include -Doverride= tests/demo_ivfpq_indexing.cpp libfaiss.a -g -fPIC -fopenmp -L/usr/local/opt/llvm/lib -framework Accelerate
ld: warning: could not create compact unwind for __ZN5faiss9matrix_qrEiiPf: dwarf uses DW_CFA_GNU_args_size
ld: warning: could not create compact unwind for __ZN5faiss9PCAMatrix10prepare_AbEv: dwarf uses DW_CFA_GNU_args_size
ld: warning: could not create compact unwind for __ZNK5faiss11IndexShards6searchElPKflPfPl: dwarf uses DW_CFA_GNU_args_size
Undefined symbols for architecture x86_64:
"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const", referenced from:
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libfaiss.a(VectorTransform.o)
faiss::PolysemousTraining::optimize_reproduce_distances(faiss::ProductQuantizer&) const in libfaiss.a(PolysemousTraining.o)
faiss::PolysemousTraining::optimize_ranking(faiss::ProductQuantizer&, unsigned long, float const*) const in libfaiss.a(PolysemousTraining.o)
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libfaiss.a(MetaIndexes.o)
"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const", referenced from:
faiss::PolysemousTraining::optimize_reproduce_distances(faiss::ProductQuantizer&) const in libfaiss.a(PolysemousTraining.o)
faiss::PolysemousTraining::optimize_ranking(faiss::ProductQuantizer&, unsigned long, float const*) const in libfaiss.a(PolysemousTraining.o)
"std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::str() const", referenced from:
faiss::IndexIVFPQ::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFPQR::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFFlat::set_typename() in libfaiss.a(IndexIVF.o)
faiss::IndexFlat::set_typename() in libfaiss.a(IndexFlat.o)
faiss::IndexRefineFlat::set_typename() in libfaiss.a(IndexFlat.o)
faiss::IndexPQ::set_typename() in libfaiss.a(IndexPQ.o)
faiss::MultiIndexQuantizer::set_typename() in libfaiss.a(IndexPQ.o)
...
"std::allocator<char>::allocator()", referenced from:
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(index_io.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(IndexIVF.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(IndexFlat.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(VectorTransform.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(IndexPQ.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(IndexLSH.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(MetaIndexes.o)
...
"std::allocator<char>::~allocator()", referenced from:
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(index_io.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(IndexIVF.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(IndexFlat.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(VectorTransform.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(IndexPQ.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(IndexLSH.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(MetaIndexes.o)
...
"std::ostream::operator<<(int)", referenced from:
faiss::IndexLSH::set_typename() in libfaiss.a(IndexLSH.o)
"std::ostream::operator<<(unsigned long)", referenced from:
faiss::IndexIVFPQ::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFPQR::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFFlat::set_typename() in libfaiss.a(IndexIVF.o)
faiss::IndexPQ::set_typename() in libfaiss.a(IndexPQ.o)
faiss::MultiIndexQuantizer::set_typename() in libfaiss.a(IndexPQ.o)
"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*)", referenced from:
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, char const*) in libfaiss.a(VectorTransform.o)
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, char const*) in libfaiss.a(MetaIndexes.o)
"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*, unsigned long)", referenced from:
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libfaiss.a(VectorTransform.o)
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libfaiss.a(MetaIndexes.o)
"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libfaiss.a(VectorTransform.o)
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libfaiss.a(MetaIndexes.o)
"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long)", referenced from:
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libfaiss.a(VectorTransform.o)
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libfaiss.a(MetaIndexes.o)
"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)", referenced from:
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, char const*) in libfaiss.a(VectorTransform.o)
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, char const*) in libfaiss.a(MetaIndexes.o)
"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(index_io.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(IndexIVF.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(IndexFlat.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(VectorTransform.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(IndexPQ.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(IndexLSH.o)
faiss::Index::Index(long, faiss::MetricType) in libfaiss.a(MetaIndexes.o)
...
"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
__ZNK5faiss5Index12get_typenameB5cxx11Ev in libfaiss.a(IndexIVFPQ.o)
__ZNK5faiss5Index12get_typenameB5cxx11Ev in libfaiss.a(index_io.o)
faiss::Index::Index(faiss::Index const&) in libfaiss.a(index_io.o)
faiss::PolysemousTraining::PolysemousTraining(faiss::PolysemousTraining const&) in libfaiss.a(index_io.o)
__ZNK5faiss5Index12get_typenameB5cxx11Ev in libfaiss.a(Index.o)
__ZNK5faiss5Index12get_typenameB5cxx11Ev in libfaiss.a(IndexIVF.o)
__ZNK5faiss5Index12get_typenameB5cxx11Ev in libfaiss.a(IndexFlat.o)
...
"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()", referenced from:
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libfaiss.a(VectorTransform.o)
faiss::PolysemousTraining::PolysemousTraining() in libfaiss.a(PolysemousTraining.o)
faiss::PolysemousTraining::PolysemousTraining() in libfaiss.a(PolysemousTraining.o)
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libfaiss.a(MetaIndexes.o)
"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()", referenced from:
faiss::IndexIVFPQ::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFPQR::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::PolysemousTraining::~PolysemousTraining() in libfaiss.a(IndexIVFPQ.o)
faiss::Index::~Index() in libfaiss.a(index_io.o)
faiss::IndexIVFFlat::set_typename() in libfaiss.a(IndexIVF.o)
faiss::Index::~Index() in libfaiss.a(IndexIVF.o)
faiss::IndexFlat::set_typename() in libfaiss.a(IndexFlat.o)
...
"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)", referenced from:
faiss::IndexIVFPQ::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFPQR::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFFlat::set_typename() in libfaiss.a(IndexIVF.o)
faiss::IndexFlat::set_typename() in libfaiss.a(IndexFlat.o)
faiss::IndexRefineFlat::set_typename() in libfaiss.a(IndexFlat.o)
faiss::IndexPreTransform::set_typename() in libfaiss.a(VectorTransform.o)
faiss::IndexPQ::set_typename() in libfaiss.a(IndexPQ.o)
...
"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
faiss::Index::operator=(faiss::Index const&) in libfaiss.a(index_io.o)
"std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)", referenced from:
faiss::IndexIVFPQ::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFPQR::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFFlat::set_typename() in libfaiss.a(IndexIVF.o)
faiss::IndexFlat::set_typename() in libfaiss.a(IndexFlat.o)
faiss::IndexRefineFlat::set_typename() in libfaiss.a(IndexFlat.o)
faiss::IndexPQ::set_typename() in libfaiss.a(IndexPQ.o)
faiss::MultiIndexQuantizer::set_typename() in libfaiss.a(IndexPQ.o)
...
"std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()", referenced from:
faiss::IndexIVFPQ::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFPQR::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFFlat::set_typename() in libfaiss.a(IndexIVF.o)
faiss::IndexFlat::set_typename() in libfaiss.a(IndexFlat.o)
faiss::IndexRefineFlat::set_typename() in libfaiss.a(IndexFlat.o)
faiss::IndexPQ::set_typename() in libfaiss.a(IndexPQ.o)
faiss::MultiIndexQuantizer::set_typename() in libfaiss.a(IndexPQ.o)
...
"std::__throw_length_error(char const*)", referenced from:
std::vector<std::vector<unsigned char, std::allocator<unsigned char> >, std::allocator<std::vector<unsigned char, std::allocator<unsigned char> > > >::_M_check_len(unsigned long, char const*) const in libfaiss.a(IndexIVFPQ.o)
std::vector<long, std::allocator<long> >::_M_check_len(unsigned long, char const*) const in libfaiss.a(IndexIVFPQ.o)
std::vector<unsigned char, std::allocator<unsigned char> >::_M_check_len(unsigned long, char const*) const in libfaiss.a(IndexIVFPQ.o)
std::vector<float, std::allocator<float> >::_M_check_len(unsigned long, char const*) const in libfaiss.a(IndexIVFPQ.o)
std::vector<float const*, std::allocator<float const*> >::_M_check_len(unsigned long, char const*) const in libfaiss.a(IndexIVFPQ.o)
std::vector<float, std::allocator<float> >::_M_check_len(unsigned long, char const*) const in libfaiss.a(index_io.o)
std::vector<int, std::allocator<int> >::_M_check_len(unsigned long, char const*) const in libfaiss.a(index_io.o)
...
"std::basic_ostream<char, std::char_traits<char> >& std::operator<<<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from:
faiss::IndexIVFPQ::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFPQR::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFFlat::set_typename() in libfaiss.a(IndexIVF.o)
faiss::IndexFlat::set_typename() in libfaiss.a(IndexFlat.o)
faiss::IndexRefineFlat::set_typename() in libfaiss.a(IndexFlat.o)
faiss::IndexPQ::set_typename() in libfaiss.a(IndexPQ.o)
faiss::MultiIndexQuantizer::set_typename() in libfaiss.a(IndexPQ.o)
...
"std::basic_ostream<char, std::char_traits<char> >& std::operator<<<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char)", referenced from:
faiss::IndexRefineFlat::set_typename() in libfaiss.a(IndexFlat.o)
"std::basic_ostream<char, std::char_traits<char> >& std::operator<<<char, std::char_traits<char>, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
faiss::IndexIVFPQ::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFPQR::set_typename() in libfaiss.a(IndexIVFPQ.o)
faiss::IndexIVFFlat::set_typename() in libfaiss.a(IndexIVF.o)
faiss::IndexRefineFlat::set_typename() in libfaiss.a(IndexFlat.o)
ld: symbol(s) not found for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [tests/demo_ivfpq_indexing] Error 1