-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix faiss swig build with version > 4.2.x #3315
Closed
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
a4b50e3
change cmake
junjieqi 1fcb3de
Fix faiss swig build with version > 4.2.x
junjieqi f235edb
<Replace this line with a title. Use 1 line only, 67 chars or less>
junjieqi a3498c0
add debug output
junjieqi 673f48a
remove broken change
junjieqi 8de8d7e
add gcc version
junjieqi c89a574
Merge branch 'main' into fix-swig
junjieqi 6598d49
try to fix test
junjieqi 961713a
remove debug info
junjieqi 8a17e06
add long long marco
junjieqi bd04ec6
Merge branch 'main' into fix-swig
junjieqi c1c8ee3
try sizeof_long
junjieqi 9ce9a67
_LONG_WIDTH__
junjieqi 50144f5
try another macro
junjieqi 4432541
use size_of_long
junjieqi 449964e
use size_of_long
junjieqi 19b73ef
use __wordsize
junjieqi cb243fc
fix typo
junjieqi 4a95427
use __SIZEOF_LONG__
junjieqi 6b16647
use __SIZEOF_LONG__
junjieqi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1022,17 +1022,17 @@ PyObject *swig_ptr (PyObject *a) | |
return SWIG_NewPointerObj(data, SWIGTYPE_p_bool, 0); | ||
} | ||
if(PyArray_TYPE(ao) == NPY_UINT64) { | ||
#ifdef SWIGWORDSIZE64 | ||
return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_long, 0); | ||
#else | ||
#if (__WORDSIZE == 32) | ||
return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_long_long, 0); | ||
#else | ||
return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_long, 0); | ||
#endif | ||
} | ||
if(PyArray_TYPE(ao) == NPY_INT64) { | ||
#ifdef SWIGWORDSIZE64 | ||
return SWIG_NewPointerObj(data, SWIGTYPE_p_long, 0); | ||
#if (__WORDSIZE == 32) | ||
return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_long_long, 0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please check on |
||
#else | ||
return SWIG_NewPointerObj(data, SWIGTYPE_p_long_long, 0); | ||
return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_long, 0); | ||
#endif | ||
} | ||
PyErr_SetString(PyExc_ValueError, "did not recognize array type"); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will probably fail on windows and / or mac because sizeof(long) = 4 on these platforms. So there should be a way to differentiate between them.