Skip to content

faiss 1.7.4 fails to build with swig 4.2.0 #3239

@pushkarnk

Description

@pushkarnk

Summary

The Ubuntu and Debian packages of faiss (1.7.4) are failing to build from source when swig 4.2.0 is used. I haven't yet tried a build with swig 4.1.0, but I am pretty sure only swig changed between passing and failing builds.

Platform

Ubuntu/Debian Linux (development release).

Faiss version: release 1.7.4

Installed from: Building from source

Faiss compilation options:

Running on:

  • CPU
  • GPU

Interface:

  • [] C++
  • Python

Reproduction instructions

Its my guess that swig 4.2.0 does not generate a couple of Python bindings required by faiss. I see these error messages:

/<<PKGBUILDDIR>>/build/faiss/python/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx: In function ‘PyObject* swig_ptr(PyObject*)’:
/<<PKGBUILDDIR>>/build/faiss/python/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx:4939:41: error: ‘SWIGTYPE_p_unsigned_long_long’ was not declared in this scope; did you mean ‘SWIGTYPE_p_unsigned_long’?
 4939 | return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_long_long, 0);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/build/faiss/python/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx:1136:94: note: in definition of macro ‘SWIG_NewPointerObj’
 1136 | #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
      | ^~~~
/<<PKGBUILDDIR>>/build/faiss/python/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx:4946:41: error: ‘SWIGTYPE_p_long_long’ was not declared in this scope; did you mean ‘SWIGTYPE_p_long’?
 4946 | return SWIG_NewPointerObj(data, SWIGTYPE_p_long_long, 0);
      | ^~~~~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/build/faiss/python/CMakeFiles/swigfaiss.dir/swigfaissPYTHON_wrap.cxx:1136:94: note: in definition of macro ‘SWIG_NewPointerObj’
 1136 | #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
      | ^~~~
[ 92%] Building CXX object c_api/CMakeFiles/faiss_c.dir/utils/distances_c.cpp.o
[ 92%] Building CXX object tests/CMakeFiles/faiss_test.dir/test_pq_encoding.cpp.o

This was also reported by #3235.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions