Faiss: failed in compiling the python interface

Created on 31 Oct 2019  路  2Comments  路  Source: facebookresearch/faiss

Summary


I failed to install faiss with conda, so I tried to build from source. I finished compiling the C++ core but failed to compile the python interface

Platform

OS: Ubuntu 16.04

Faiss version: master

Faiss compilation options:

Running on:

  • [ ] CPU
  • [X] GPU

Interface:

  • [ ] C++
  • [X] Python

Reproduction instructions

make py


(base) sizhangyu@sizhangyu-750-175se:~/packages/faiss$ make py
make -C python
make[1]: Entering directory '/home/sizhangyu/packages/faiss/python'
python -c++ -Doverride= -I../ -DSWIGWORDSIZE64 -DGPU_WRAPPER -o swigfaiss.cpp s
wigfaiss.swig
File "", line 1
++
^
SyntaxError: invalid syntax
Makefile:16: recipe for target 'swigfaiss.cpp' failed
make[1]: [swigfaiss.cpp] Error 1 (ignored)
g++ -std=c++11 -DFINTEGER=int -fopenmp -I/usr/local/cuda-10.1/include -fPIC -m64 -Wno-sign-compare -g -O3 -Wall -Wextra -mpopcnt -msse4 -I
-I../ -c swigfaiss.cpp -o swigfaiss.o
g++: error: swigfaiss.cpp: No such file or directory
g++: fatal error: no input files
compilation terminated.
Makefile:22: recipe for target 'swigfaiss.o' failed
make[1]: * [swigfaiss.o] Error 1
make[1]: Leaving directory '/home/sizhangyu/packages/faiss/python'
Makefile:83: recipe for target 'py' failed
make: *
[py] Error 2

Most helpful comment

I was getting the same error and it turned out I didn't have swig installed. So make sure you have swig installed first.Try sudo apt-get install swig. And then run ./configure again

All 2 comments

I was getting the same error and it turned out I didn't have swig installed. So make sure you have swig installed first.Try sudo apt-get install swig. And then run ./configure again

it works. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daniellevy picture daniellevy  路  3Comments

ilyakhov picture ilyakhov  路  3Comments

zjjott picture zjjott  路  3Comments

mylyu picture mylyu  路  3Comments

zoe-cheung picture zoe-cheung  路  3Comments