faiss 编译的坑


编译过程报错:

g++ -o demos/demo_ivfpq_indexing -fPIC -m64 -Wall -g -O3 -mavx -msse4 -mpopcnt -fopenmp -Wno-sign-compare -fopenmp demos/demo_ivfpq_indexing.cpp libfaiss.a -g -fPIC  -fopenmp /usr/lib64/libopenblas.so.0
In file included from demos/../IndexIVF.h:21:0,
                 from demos/../IndexIVFPQ.h:18,
                 from demos/demo_ivfpq_indexing.cpp:19:
demos/../Heap.h:190:9: warning: identifier ‘nullptr’ is a keyword in C++11 [-Wc++0x-compat]
         const typename C::T * x = nullptr,
         ^
demos/../Heap.h:190:35: error: ‘nullptr’ was not declared in this scope
         const typename C::T * x = nullptr,
                                   ^
demos/../Heap.h:191:38: error: ‘nullptr’ was not declared in this scope
         const typename C::TI * ids = nullptr,

看着编译的时候没有加上 -std=c++11

65 demos/demo_ivfpq_indexing: demos/demo_ivfpq_indexing.cpp $(LIBNAME).a
66         $(CXX) -o $@ $(CFLAGS) $< $(LIBNAME).a $(LDFLAGS) $(BLASLDFLAGS)

改为

65 demos/demo_ivfpq_indexing: demos/demo_ivfpq_indexing.cpp $(LIBNAME).a
 66         $(CXX) -o $@ $(CXXFLAGS) $< $(LIBNAME).a $(LDFLAGS) $(BLASLDFLAGS)

成功

你可能感兴趣的:(杂七杂八)