Faiss: python3.5m error

Created on 10 Apr 2019  Β·  9Comments  Β·  Source: facebookresearch/faiss

checking build system type... Invalid configuration `/usr/include/python3.5m': machine `/usr/include/python3.5m' not recognized
configure: error: /bin/bash build-aux/config.sub /usr/include/python3.5m failed

with this command:

 ./configure --without-cuda --with-python /usr/include/python3.5m

Most helpful comment

@ironhide23586 That version of swig has trouble handling using directives. Please try with swig 3.0.12.

All 9 comments

You should put an = between --with-python and the value, i.e.

 ./configure --without-cuda --with-python=/usr/include/python3.5m

@beauby Got an error when make py:

                                       ^
swigfaiss.cpp:59985:15: error: β€˜temp’ was not declared in this scope
       idx_t * temp = reinterpret_cast< idx_t * >(argp4);
               ^
swigfaiss.cpp:59985:40: error: β€˜idx_t’ does not name a type
       idx_t * temp = reinterpret_cast< idx_t * >(argp4);
                                        ^
swigfaiss.cpp:59985:46: error: expected β€˜>’ before β€˜*’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp4);
                                              ^
swigfaiss.cpp:59985:46: error: expected β€˜(’ before β€˜*’ token
swigfaiss.cpp:59985:48: error: expected primary-expression before β€˜>’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp4);
                                                ^
swigfaiss.cpp:59985:56: error: expected β€˜)’ before β€˜;’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp4);
                                                        ^
swigfaiss.cpp:59986:7: error: β€˜arg4’ was not declared in this scope
       arg4 = *temp;
       ^
swigfaiss.cpp:59987:39: error: type β€˜<type error>’ argument given to β€˜delete’, expected pointer
       if (SWIG_IsNewObj(res4)) delete temp;
                                       ^
swigfaiss.cpp:59999:28: error: β€˜idx_t’ does not name a type
   arg6 = reinterpret_cast< idx_t * >(argp6);
                            ^
swigfaiss.cpp:59999:34: error: expected β€˜>’ before β€˜*’ token
   arg6 = reinterpret_cast< idx_t * >(argp6);
                                  ^
swigfaiss.cpp:59999:34: error: expected β€˜(’ before β€˜*’ token
swigfaiss.cpp:59999:36: error: expected primary-expression before β€˜>’ token
   arg6 = reinterpret_cast< idx_t * >(argp6);
                                    ^
swigfaiss.cpp:59999:44: error: expected β€˜)’ before β€˜;’ token
   arg6 = reinterpret_cast< idx_t * >(argp6);
                                            ^
swigfaiss.cpp:60003:50: error: β€˜arg2’ was not declared in this scope
       ((faiss::IndexBinary const *)arg1)->search(arg2,(uint8_t const *)arg3,arg4,arg5,arg6);
                                                  ^
swigfaiss.cpp:60003:77: error: β€˜arg4’ was not declared in this scope
       ((faiss::IndexBinary const *)arg1)->search(arg2,(uint8_t const *)arg3,arg4,arg5,arg6);
                                                                             ^
swigfaiss.cpp: In function β€˜PyObject* _wrap_IndexBinary_range_search(PyObject*, PyObject*)’:
swigfaiss.cpp:60026:3: error: β€˜idx_t’ was not declared in this scope
   idx_t arg2 ;
   ^
swigfaiss.cpp:60026:3: note: suggested alternative:
In file included from swigfaiss.cpp:3374:0:
../IVFlib.h:46:22: note:   β€˜faiss::ivflib::idx_t’
 typedef Index::idx_t idx_t;
                      ^
swigfaiss.cpp:60060:15: error: β€˜temp’ was not declared in this scope
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
               ^
swigfaiss.cpp:60060:40: error: β€˜idx_t’ does not name a type
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                        ^
swigfaiss.cpp:60060:46: error: expected β€˜>’ before β€˜*’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                              ^
swigfaiss.cpp:60060:46: error: expected β€˜(’ before β€˜*’ token
swigfaiss.cpp:60060:48: error: expected primary-expression before β€˜>’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                                ^
swigfaiss.cpp:60060:56: error: expected β€˜)’ before β€˜;’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                                        ^
swigfaiss.cpp:60061:7: error: β€˜arg2’ was not declared in this scope
       arg2 = *temp;
       ^
swigfaiss.cpp:60062:39: error: type β€˜<type error>’ argument given to β€˜delete’, expected pointer
       if (SWIG_IsNewObj(res2)) delete temp;
                                       ^
swigfaiss.cpp:60083:56: error: β€˜arg2’ was not declared in this scope
       ((faiss::IndexBinary const *)arg1)->range_search(arg2,(uint8_t const *)arg3,arg4,arg5);
                                                        ^
swigfaiss.cpp: In function β€˜PyObject* _wrap_IndexBinary_assign__SWIG_0(PyObject*, PyObject*)’:
swigfaiss.cpp:60106:3: error: β€˜idx_t’ was not declared in this scope
   idx_t arg2 ;
   ^
swigfaiss.cpp:60106:3: note: suggested alternative:
In file included from swigfaiss.cpp:3374:0:
../IVFlib.h:46:22: note:   β€˜faiss::ivflib::idx_t’
 typedef Index::idx_t idx_t;
                      ^
swigfaiss.cpp:60108:10: error: β€˜arg4’ was not declared in this scope
   idx_t *arg4 = (idx_t *) 0 ;
          ^
swigfaiss.cpp:60108:25: error: expected primary-expression before β€˜)’ token
   idx_t *arg4 = (idx_t *) 0 ;
                         ^
swigfaiss.cpp:60109:9: error: expected β€˜;’ before β€˜arg5’
   idx_t arg5 ;
         ^
swigfaiss.cpp:60140:15: error: β€˜temp’ was not declared in this scope
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
               ^
swigfaiss.cpp:60140:40: error: β€˜idx_t’ does not name a type
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                        ^
swigfaiss.cpp:60140:46: error: expected β€˜>’ before β€˜*’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                              ^
swigfaiss.cpp:60140:46: error: expected β€˜(’ before β€˜*’ token
swigfaiss.cpp:60140:48: error: expected primary-expression before β€˜>’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                                ^
swigfaiss.cpp:60140:56: error: expected β€˜)’ before β€˜;’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                                        ^
swigfaiss.cpp:60141:7: error: β€˜arg2’ was not declared in this scope
       arg2 = *temp;
       ^
swigfaiss.cpp:60142:39: error: type β€˜<type error>’ argument given to β€˜delete’, expected pointer
       if (SWIG_IsNewObj(res2)) delete temp;
                                       ^
swigfaiss.cpp:60154:28: error: β€˜idx_t’ does not name a type
   arg4 = reinterpret_cast< idx_t * >(argp4);
                            ^
swigfaiss.cpp:60154:34: error: expected β€˜>’ before β€˜*’ token
   arg4 = reinterpret_cast< idx_t * >(argp4);
                                  ^
swigfaiss.cpp:60154:34: error: expected β€˜(’ before β€˜*’ token
swigfaiss.cpp:60154:36: error: expected primary-expression before β€˜>’ token
   arg4 = reinterpret_cast< idx_t * >(argp4);
                                    ^
swigfaiss.cpp:60154:44: error: expected β€˜)’ before β€˜;’ token
   arg4 = reinterpret_cast< idx_t * >(argp4);
                                            ^
swigfaiss.cpp:60163:15: error: β€˜temp’ was not declared in this scope
       idx_t * temp = reinterpret_cast< idx_t * >(argp5);
               ^
swigfaiss.cpp:60163:40: error: β€˜idx_t’ does not name a type
       idx_t * temp = reinterpret_cast< idx_t * >(argp5);
                                        ^
swigfaiss.cpp:60163:46: error: expected β€˜>’ before β€˜*’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp5);
                                              ^
swigfaiss.cpp:60163:46: error: expected β€˜(’ before β€˜*’ token
swigfaiss.cpp:60163:48: error: expected primary-expression before β€˜>’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp5);
                                                ^
swigfaiss.cpp:60163:56: error: expected β€˜)’ before β€˜;’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp5);
                                                        ^
swigfaiss.cpp:60164:7: error: β€˜arg5’ was not declared in this scope
       arg5 = *temp;
       ^
swigfaiss.cpp:60165:39: error: type β€˜<type error>’ argument given to β€˜delete’, expected pointer
       if (SWIG_IsNewObj(res5)) delete temp;
                                       ^
swigfaiss.cpp:60171:22: error: β€˜arg2’ was not declared in this scope
       (arg1)->assign(arg2,(uint8_t const *)arg3,arg4,arg5);
                      ^
swigfaiss.cpp:60171:54: error: β€˜arg5’ was not declared in this scope
       (arg1)->assign(arg2,(uint8_t const *)arg3,arg4,arg5);
                                                      ^
swigfaiss.cpp: In function β€˜PyObject* _wrap_IndexBinary_assign__SWIG_1(PyObject*, PyObject*)’:
swigfaiss.cpp:60194:3: error: β€˜idx_t’ was not declared in this scope
   idx_t arg2 ;
   ^
swigfaiss.cpp:60194:3: note: suggested alternative:
In file included from swigfaiss.cpp:3374:0:
../IVFlib.h:46:22: note:   β€˜faiss::ivflib::idx_t’
 typedef Index::idx_t idx_t;
                      ^
swigfaiss.cpp:60196:10: error: β€˜arg4’ was not declared in this scope
   idx_t *arg4 = (idx_t *) 0 ;
          ^
swigfaiss.cpp:60196:25: error: expected primary-expression before β€˜)’ token
   idx_t *arg4 = (idx_t *) 0 ;
                         ^
swigfaiss.cpp:60224:15: error: β€˜temp’ was not declared in this scope
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
               ^
swigfaiss.cpp:60224:40: error: β€˜idx_t’ does not name a type
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                        ^
swigfaiss.cpp:60224:46: error: expected β€˜>’ before β€˜*’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                              ^
swigfaiss.cpp:60224:46: error: expected β€˜(’ before β€˜*’ token
swigfaiss.cpp:60224:48: error: expected primary-expression before β€˜>’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                                ^
swigfaiss.cpp:60224:56: error: expected β€˜)’ before β€˜;’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                                        ^
swigfaiss.cpp:60225:7: error: β€˜arg2’ was not declared in this scope
       arg2 = *temp;
       ^
swigfaiss.cpp:60226:39: error: type β€˜<type error>’ argument given to β€˜delete’, expected pointer
       if (SWIG_IsNewObj(res2)) delete temp;
                                       ^
swigfaiss.cpp:60238:28: error: β€˜idx_t’ does not name a type
   arg4 = reinterpret_cast< idx_t * >(argp4);
                            ^
swigfaiss.cpp:60238:34: error: expected β€˜>’ before β€˜*’ token
   arg4 = reinterpret_cast< idx_t * >(argp4);
                                  ^
swigfaiss.cpp:60238:34: error: expected β€˜(’ before β€˜*’ token
swigfaiss.cpp:60238:36: error: expected primary-expression before β€˜>’ token
   arg4 = reinterpret_cast< idx_t * >(argp4);
                                    ^
swigfaiss.cpp:60238:44: error: expected β€˜)’ before β€˜;’ token
   arg4 = reinterpret_cast< idx_t * >(argp4);
                                            ^
swigfaiss.cpp:60242:22: error: β€˜arg2’ was not declared in this scope
       (arg1)->assign(arg2,(uint8_t const *)arg3,arg4);
                      ^
swigfaiss.cpp: In function β€˜PyObject* _wrap_IndexBinary_reconstruct(PyObject*, PyObject*)’:
swigfaiss.cpp:60422:3: error: β€˜idx_t’ was not declared in this scope
   idx_t arg2 ;
   ^
swigfaiss.cpp:60422:3: note: suggested alternative:
In file included from swigfaiss.cpp:3374:0:
../IVFlib.h:46:22: note:   β€˜faiss::ivflib::idx_t’
 typedef Index::idx_t idx_t;
                      ^
swigfaiss.cpp:60448:15: error: β€˜temp’ was not declared in this scope
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
               ^
swigfaiss.cpp:60448:40: error: β€˜idx_t’ does not name a type
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                        ^
swigfaiss.cpp:60448:46: error: expected β€˜>’ before β€˜*’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                              ^
swigfaiss.cpp:60448:46: error: expected β€˜(’ before β€˜*’ token
swigfaiss.cpp:60448:48: error: expected primary-expression before β€˜>’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                                ^
swigfaiss.cpp:60448:56: error: expected β€˜)’ before β€˜;’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                                        ^
swigfaiss.cpp:60449:7: error: β€˜arg2’ was not declared in this scope
       arg2 = *temp;
       ^
swigfaiss.cpp:60450:39: error: type β€˜<type error>’ argument given to β€˜delete’, expected pointer
       if (SWIG_IsNewObj(res2)) delete temp;
                                       ^
swigfaiss.cpp:60461:55: error: β€˜arg2’ was not declared in this scope
       ((faiss::IndexBinary const *)arg1)->reconstruct(arg2,arg3);
                                                       ^
swigfaiss.cpp: In function β€˜PyObject* _wrap_IndexBinary_reconstruct_n(PyObject*, PyObject*)’:
swigfaiss.cpp:60484:3: error: β€˜idx_t’ was not declared in this scope
   idx_t arg2 ;
   ^
swigfaiss.cpp:60484:3: note: suggested alternative:
In file included from swigfaiss.cpp:3374:0:
../IVFlib.h:46:22: note:   β€˜faiss::ivflib::idx_t’
 typedef Index::idx_t idx_t;
                      ^
swigfaiss.cpp:60485:9: error: expected β€˜;’ before β€˜arg3’
   idx_t arg3 ;
         ^
swigfaiss.cpp:60514:15: error: β€˜temp’ was not declared in this scope
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
               ^
swigfaiss.cpp:60514:40: error: β€˜idx_t’ does not name a type
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                        ^
swigfaiss.cpp:60514:46: error: expected β€˜>’ before β€˜*’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                              ^
swigfaiss.cpp:60514:46: error: expected β€˜(’ before β€˜*’ token
swigfaiss.cpp:60514:48: error: expected primary-expression before β€˜>’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                                ^
swigfaiss.cpp:60514:56: error: expected β€˜)’ before β€˜;’ token
       idx_t * temp = reinterpret_cast< idx_t * >(argp2);
                                                        ^
swigfaiss.cpp:60515:7: error: β€˜arg2’ was not declared in this scope
       arg2 = *temp;

Even I'm facing the same issue :|

What version of swig do you have installed? (swig -version)

On Wed 17 Apr 2019 at 10:36, Souham Biswas notifications@github.com wrote:

Even I'm facing the same issue :|

β€”
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/facebookresearch/faiss/issues/781#issuecomment-483991578,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACHPYhrT8K1ulftN9alSzHzpToGbjCxXks5vhtz4gaJpZM4cmxbs
.

>

Lucas Hosseini
lucas.[email protected]

I'm using swig 3.0.8.

@ironhide23586 That version of swig has trouble handling using directives. Please try with swig 3.0.12.

Thanks @beauby that solved it! :)

I got the same error even after changing swig version to 3.0.12 with compiling, the below code solved my issue,
sudo apt-get remove swig
which was swig=3.0.8

I have tried the version of swig 3.0.8、3.0.12、4.0.0, but got the same error when make py.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

0DF0Arc picture 0DF0Arc  Β·  3Comments

mylyu picture mylyu  Β·  3Comments

minjiaz picture minjiaz  Β·  3Comments

brunodoamaral picture brunodoamaral  Β·  3Comments

danny1984 picture danny1984  Β·  3Comments