Closed fislysandi closed 10 months ago
OS:
dump ` Building wheel for hnswlib (pyproject.toml) ... error error: subprocess-exited-with-error
./python_bindings/bindings.cpp: In function ‘std::vector<long unsigned int> get_input_ids_and_check_shapes(const pybind11::object&, size_t)’: ./python_bindings/bindings.cpp:121:58: warning: comparison of integer expressions of different signedness: ‘__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 121 | if (!((ids_numpy.ndim == 1 && ids_numpy.shape[0] == feature_rows) || ./python_bindings/bindings.cpp:125:41: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘pybind11::ssize_t’ {aka ‘long int’} [-Wformat=] 125 | "The input label shape %d does not match the input data vector shape %d", | ~^ | | | int | %ld 126 | ids_numpy.ndim, feature_rows); | ~~~~~~~~~~~~~~ | | | pybind11::ssize_t {aka long int} ./python_bindings/bindings.cpp:125:87: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=] 125 | "The input label shape %d does not match the input data vector shape %d", | ~^ | | | int | %ld 126 | ids_numpy.ndim, feature_rows); | ~~~~~~~~~~~~ | | | size_t {aka long unsigned int} In file included from /tmp/pip-build-env-_ahgfr6b/overlay/local/lib/python3.10/dist-packages/pybind11/include/pybind11/detail/../attr.h:13, from /tmp/pip-build-env-_ahgfr6b/overlay/local/lib/python3.10/dist-packages/pybind11/include/pybind11/detail/class.h:12, from /tmp/pip-build-env-_ahgfr6b/overlay/local/lib/python3.10/dist-packages/pybind11/include/pybind11/pybind11.h:13, from /tmp/pip-build-env-_ahgfr6b/overlay/local/lib/python3.10/dist-packages/pybind11/include/pybind11/functional.h:12, from ./python_bindings/bindings.cpp:2: ./python_bindings/bindings.cpp: In function ‘PyObject* PyInit_hnswlib()’: /tmp/pip-build-env-_ahgfr6b/overlay/local/lib/python3.10/dist-packages/pybind11/include/pybind11/detail/../detail/common.h:428:33: warning: ‘PyObject* pybind11_init()’ is deprecated: PYBIND11_PLUGIN is deprecated, use PYBIND11_MODULE [-Wdeprecated-declarations] 428 | return pybind11_init(); \ | ~~~~~~~~~~~~~^~ ./python_bindings/bindings.cpp:876:1: note: in expansion of macro ‘PYBIND11_PLUGIN’ 876 | PYBIND11_PLUGIN(hnswlib) { | ^~~~~~~~~~~~~~~ /tmp/pip-build-env-_ahgfr6b/overlay/local/lib/python3.10/dist-packages/pybind11/include/pybind11/detail/../detail/common.h:423:22: note: declared here 423 | static PyObject *pybind11_init(); \ | ^~~~~~~~~~~~~ ./python_bindings/bindings.cpp:876:1: note: in expansion of macro ‘PYBIND11_PLUGIN’ 876 | PYBIND11_PLUGIN(hnswlib) { | ^~~~~~~~~~~~~~~ ./python_bindings/bindings.cpp: In function ‘PyObject* pybind11_init()’: ./python_bindings/bindings.cpp:877:31: warning: ‘pybind11::module_::module_(const char*, const char*)’ is deprecated: Use PYBIND11_MODULE or module_::create_extension_module instead [-Wdeprecated-declarations] 877 | py::module m("hnswlib"); | ^ In file included from /tmp/pip-build-env-_ahgfr6b/overlay/local/lib/python3.10/dist-packages/pybind11/include/pybind11/functional.h:12, from ./python_bindings/bindings.cpp:2: /tmp/pip-build-env-_ahgfr6b/overlay/local/lib/python3.10/dist-packages/pybind11/include/pybind11/pybind11.h:1159:14: note: declared here 1159 | explicit module_(const char *name, const char *doc = nullptr) { | ^~~~~~~ ./python_bindings/bindings.cpp: In instantiation of ‘pybind11::object Index<dist_t, data_t>::knnQuery_return_numpy(pybind11::object, size_t, int, const std::function<bool(long unsigned int)>&) [with dist_t = float; data_t = float; size_t = long unsigned int]’: ./python_bindings/bindings.cpp:892:28: required from here ./python_bindings/bindings.cpp:619:22: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 619 | if (rows <= num_threads * 4) { | ~~~~~^~~~~~~~~~~~~~~~~~ ./python_bindings/bindings.cpp:647:28: warning: unused variable ‘data’ [-Wunused-variable] 647 | float* data = (float*)items.data(row); | ^~~~ ./python_bindings/bindings.cpp:667:22: warning: deleting ‘void*’ is undefined [-Wdelete-incomplete] 667 | delete[] f; | ^ ./python_bindings/bindings.cpp:670:22: warning: deleting ‘void*’ is undefined [-Wdelete-incomplete] 670 | delete[] f; | ^ ./python_bindings/bindings.cpp: In instantiation of ‘void Index<dist_t, data_t>::addItems(pybind11::object, pybind11::object, int, bool) [with dist_t = float; data_t = float]’: ./python_bindings/bindings.cpp:898:28: required from here ./python_bindings/bindings.cpp:257:22: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 257 | if (features != dim) | ~~~~~~~~~^~~~~~ ./python_bindings/bindings.cpp:261:18: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 261 | if (rows <= num_threads * 4) { | ~~~~~^~~~~~~~~~~~~~~~~~ ./python_bindings/bindings.cpp: In instantiation of ‘pybind11::object BFIndex<dist_t, data_t>::knnQuery_return_numpy(pybind11::object, size_t, const std::function<bool(long unsigned int)>&) [with dist_t = float; data_t = float; size_t = long unsigned int]’: ./python_bindings/bindings.cpp:960:44: required from here ./python_bindings/bindings.cpp:853:22: warning: deleting ‘void*’ is undefined [-Wdelete-incomplete] 853 | delete[] f; | ^ ./python_bindings/bindings.cpp:856:22: warning: deleting ‘void*’ is undefined [-Wdelete-incomplete] 856 | delete[] f; | ^ ./python_bindings/bindings.cpp: In instantiation of ‘void BFIndex<dist_t, data_t>::addItems(pybind11::object, pybind11::object) [with dist_t = float; data_t = float]’: ./python_bindings/bindings.cpp:961:44: required from here ./python_bindings/bindings.cpp:778:22: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 778 | if (features != dim) | ~~~~~~~~~^~~~~~ In file included from ./hnswlib/hnswlib.h:199, from ./python_bindings/bindings.cpp:6: ./hnswlib/hnswalg.h: In instantiation of ‘hnswlib::HierarchicalNSW<dist_t>::HierarchicalNSW(hnswlib::SpaceInterface<dist_t>*, size_t, size_t, size_t, size_t, bool) [with dist_t = float; size_t = long unsigned int]’: ./python_bindings/bindings.cpp:488:35: required from ‘static Index<float>* Index<dist_t, data_t>::createFromParams(pybind11::dict) [with dist_t = float; data_t = float]’ ./python_bindings/bindings.cpp:880:38: required from here ./hnswlib/hnswalg.h:42:29: warning: ‘hnswlib::HierarchicalNSW<float>::link_list_locks_’ will be initialized after [-Wreorder] 42 | std::vector<std::mutex> link_list_locks_; | ^~~~~~~~~~~~~~~~ ./hnswlib/hnswalg.h:39:37: warning: ‘std::vector<std::mutex> hnswlib::HierarchicalNSW<float>::label_op_locks_’ [-Wreorder] 39 | mutable std::vector<std::mutex> label_op_locks_; | ^~~~~~~~~~~~~~~ ./hnswlib/hnswalg.h:88:5: warning: when initialized here [-Wreorder] 88 | HierarchicalNSW( | ^~~~~~~~~~~~~~~ In file included from ./hnswlib/hnswlib.h:199, from ./python_bindings/bindings.cpp:6: ./hnswlib/hnswalg.h: In instantiation of ‘std::vector<data_t> hnswlib::HierarchicalNSW<dist_t>::getDataByLabel(hnswlib::labeltype) const [with data_t = float; dist_t = float; hnswlib::labeltype = long unsigned int]’: ./python_bindings/bindings.cpp:323:69: required from ‘std::vector<std::vector<data_t> > Index<dist_t, data_t>::getDataReturnList(pybind11::object) [with dist_t = float; data_t = float]’ ./python_bindings/bindings.cpp:903:49: required from here ./hnswlib/hnswalg.h:755:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 755 | for (int i = 0; i < dim; i++) { | ~~^~~~~ ./python_bindings/bindings.cpp: In instantiation of ‘pybind11::dict Index<dist_t, data_t>::getAnnData() const [with dist_t = float; data_t = float]’: ./python_bindings/bindings.cpp:467:27: required from ‘pybind11::dict Index<dist_t, data_t>::getIndexParams() const [with dist_t = float; data_t = float]’ ./python_bindings/bindings.cpp:945:57: required from here ./python_bindings/bindings.cpp:383:22: warning: deleting ‘void*’ is undefined [-Wdelete-incomplete] 383 | delete[] f; | ^ ./python_bindings/bindings.cpp:386:22: warning: deleting ‘void*’ is undefined [-Wdelete-incomplete] 386 | delete[] f; | ^ ./python_bindings/bindings.cpp:389:22: warning: deleting ‘void*’ is undefined [-Wdelete-incomplete] 389 | delete[] f; | ^ ./python_bindings/bindings.cpp:392:22: warning: deleting ‘void*’ is undefined [-Wdelete-incomplete] 392 | delete[] f; | ^ ./python_bindings/bindings.cpp:395:22: warning: deleting ‘void*’ is undefined [-Wdelete-incomplete] 395 | delete[] f; | ^ In file included from ./hnswlib/hnswlib.h:198, from ./python_bindings/bindings.cpp:6: ./hnswlib/bruteforce.h: In instantiation of ‘std::priority_queue<std::pair<dist_t, long unsigned int> > hnswlib::BruteforceSearch<dist_t>::searchKnn(const void*, size_t, hnswlib::BaseFilterFunctor*) const [with dist_t = float; typename std::vector<std::pair<dist_t, long unsigned int>, std::allocator<std::pair<dist_t, long unsigned int> > >::value_type = std::pair<float, long unsigned int>; size_t = long unsigned int]’: ./python_bindings/bindings.cpp:841:100: required from ‘pybind11::object BFIndex<dist_t, data_t>::knnQuery_return_numpy(pybind11::object, size_t, const std::function<bool(long unsigned int)>&) [with dist_t = float; data_t = float; size_t = long unsigned int]’ ./python_bindings/bindings.cpp:960:44: required from here ./hnswlib/bruteforce.h:105:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 105 | for (int i = 0; i < k; i++) { | ~~^~~ ./hnswlib/bruteforce.h:113:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const size_t’ {aka ‘const long unsigned int’} [-Wsign-compare] 113 | for (int i = k; i < cur_element_count; i++) { | ~~^~~~~~~~~~~~~~~~~~~ In file included from ./python_bindings/bindings.cpp:6: ./hnswlib/hnswlib.h: At global scope: ./hnswlib/hnswlib.h:80:13: warning: ‘bool AVX512Capable()’ defined but not used [-Wunused-function] 80 | static bool AVX512Capable() { | ^~~~~~~~~~~~~ x86_64-linux-gnu-gcc: fatal error: Killed signal terminated program cc1plus compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 [end of output]
`
SOLVED by Doing Apt install python3-hnswlib.
now it built successfully
OS:![WindowsTerminal_2TNmMHpJQg](https://github.com/nmslib/hnswlib/assets/45166203/da9231fa-de3a-4f3a-b8c9-83b5c95186e0)
dump ` Building wheel for hnswlib (pyproject.toml) ... error error: subprocess-exited-with-error
~~~`