-
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 swig osx #3357
Closed
Closed
Fix swig osx #3357
Changes from 24 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
752f961
Revert "remove broken change"
junjieqi 9b6f341
fix osx swig
junjieqi 0da050e
remove unused change
junjieqi b1f5c17
fix sprintf
junjieqi 74ae852
revert
junjieqi 739e5a1
build_cmake
junjieqi 609fc2c
snprintf
junjieqi f77336d
revert
junjieqi c3b7b98
revert
junjieqi e3244ce
change to conda
junjieqi 38929fc
fix sprintf
junjieqi d5b7ab4
Merge branch 'main' into fix_swig_osx
junjieqi 6fa55b0
force generate SWIGTYPE_p_*_long
junjieqi 6c955e9
Merge branch 'main' into fix_swig_osx
junjieqi e3eb21c
revert some part
junjieqi 8b4ffc3
reconstructure
junjieqi 1b3bebc
Merge branch 'main' into fix_swig_osx
junjieqi deb576b
force long
junjieqi 47244ca
remove unused flag
junjieqi fa8626f
Merge branch 'main' into fix_swig_osx
junjieqi 736b4ee
convert int64 to long_long for osx
junjieqi a26c9c2
revert the comment
junjieqi f5e4649
use defined
junjieqi 7c5d14f
add __MACH__
junjieqi 32dd565
__APPLE__
junjieqi cf2d577
Merge branch 'main' into fix_swig_osx
junjieqi 6d45822
add DSWIGWORDSIZE64
junjieqi 7e4eeeb
Merge branch 'fix_swig_osx' of github.com:facebookresearch/faiss into…
junjieqi 12658da
Merge branch 'fix_swig_osx' of github.com:facebookresearch/faiss into…
junjieqi 83539de
Merge branch 'fix_swig_osx' of github.com:facebookresearch/faiss into…
junjieqi aab10ba
add size back
junjieqi bba54ac
remove osx for final check in
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,14 +1022,17 @@ PyObject *swig_ptr (PyObject *a) | |
return SWIG_NewPointerObj(data, SWIGTYPE_p_bool, 0); | ||
} | ||
if(PyArray_TYPE(ao) == NPY_UINT64) { | ||
#if (__SIZEOF_LONG__ == 8) | ||
// Convert npy64 either long or long long and it depends on how compiler define int64_t. | ||
// In the 64bit machine, typically the int64_t should be long but it is not hold for Apple osx. | ||
// In this case, we want to convert npy64 to long_Long in osx | ||
#if __SIZEOF_LONG__ == 8 && !(defined(__APPLE__) && defined(__MACH__)) | ||
return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_long, 0); | ||
#else | ||
return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_long_long, 0); | ||
#endif | ||
} | ||
if(PyArray_TYPE(ao) == NPY_INT64) { | ||
#if (__SIZEOF_LONG__ == 8) | ||
#if __SIZEOF_LONG__ == 8 && !(defined(__APPLE__) && defined(__MACH__)) | ||
return SWIG_NewPointerObj(data, SWIGTYPE_p_long, 0); | ||
#else | ||
return SWIG_NewPointerObj(data, SWIGTYPE_p_long_long, 0); | ||
|
@@ -1121,12 +1124,13 @@ int * cast_integer_to_int_ptr (int64_t x) { | |
void * cast_integer_to_void_ptr (int64_t x) { | ||
return (void*)x; | ||
} | ||
|
||
%} | ||
|
||
|
||
|
||
|
||
/* | ||
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. this is not necessary anymore I think |
||
Force OSX to generate SWIGTYPE_p_long since OSX will generate SWIGTYPE_p_long_long when it meets int64 by default | ||
*/ | ||
%types(unsigned long*); | ||
%types(long*); | ||
|
||
|
||
|
||
|
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.
Here it is probably enough to test on