Skip to content
Closed
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
752f961
Revert "remove broken change"
junjieqi Mar 27, 2024
9b6f341
fix osx swig
junjieqi Apr 9, 2024
0da050e
remove unused change
junjieqi Apr 9, 2024
b1f5c17
fix sprintf
junjieqi Apr 9, 2024
74ae852
revert
junjieqi Apr 9, 2024
739e5a1
build_cmake
junjieqi Apr 9, 2024
609fc2c
snprintf
junjieqi Apr 9, 2024
f77336d
revert
junjieqi Apr 9, 2024
c3b7b98
revert
junjieqi Apr 9, 2024
e3244ce
change to conda
junjieqi Apr 9, 2024
38929fc
fix sprintf
junjieqi Apr 11, 2024
d5b7ab4
Merge branch 'main' into fix_swig_osx
junjieqi Apr 11, 2024
6fa55b0
force generate SWIGTYPE_p_*_long
junjieqi Apr 11, 2024
6c955e9
Merge branch 'main' into fix_swig_osx
junjieqi Apr 11, 2024
e3eb21c
revert some part
junjieqi Apr 11, 2024
8b4ffc3
reconstructure
junjieqi Apr 12, 2024
1b3bebc
Merge branch 'main' into fix_swig_osx
junjieqi Apr 12, 2024
deb576b
force long
junjieqi Apr 12, 2024
47244ca
remove unused flag
junjieqi Apr 13, 2024
fa8626f
Merge branch 'main' into fix_swig_osx
junjieqi Apr 24, 2024
736b4ee
convert int64 to long_long for osx
junjieqi Apr 24, 2024
a26c9c2
revert the comment
junjieqi Apr 24, 2024
f5e4649
use defined
junjieqi Apr 24, 2024
7c5d14f
add __MACH__
junjieqi Apr 24, 2024
32dd565
__APPLE__
junjieqi Apr 25, 2024
cf2d577
Merge branch 'main' into fix_swig_osx
junjieqi Apr 25, 2024
6d45822
add DSWIGWORDSIZE64
junjieqi Apr 25, 2024
7e4eeeb
Merge branch 'fix_swig_osx' of github.com:facebookresearch/faiss into…
junjieqi Apr 25, 2024
12658da
Merge branch 'fix_swig_osx' of github.com:facebookresearch/faiss into…
junjieqi Apr 25, 2024
83539de
Merge branch 'fix_swig_osx' of github.com:facebookresearch/faiss into…
junjieqi Apr 25, 2024
aab10ba
add size back
junjieqi Apr 25, 2024
bba54ac
remove osx for final check in
junjieqi Apr 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions faiss/python/swigfaiss.swig
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
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__)
return SWIG_NewPointerObj(data, SWIGTYPE_p_long, 0);
#else
return SWIG_NewPointerObj(data, SWIGTYPE_p_long_long, 0);
Expand All @@ -1054,11 +1057,8 @@ struct PythonInterruptCallback: faiss::InterruptCallback {
}

};


%}


%init %{
/* needed, else crash at runtime */
import_array();
Expand Down Expand Up @@ -1121,15 +1121,8 @@ int * cast_integer_to_int_ptr (int64_t x) {
void * cast_integer_to_void_ptr (int64_t x) {
return (void*)x;
}

%}







%inline %{
void wait() {
// in gdb, use return to get out of this function
Expand Down