bxlab / bx-python

Tools for manipulating biological data, particularly multiple sequence alignments
MIT License
145 stars 53 forks source link

0.12.0: Fails to build: error: incompatible integer to pointer conversion assigning to 'void **' from 'int' #99

Open yurivict opened 2 months ago

yurivict commented 2 months ago
/usr/local/lib/python3.11/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
   17 | #warning "Using deprecated NumPy API, disable it with " \
      |  ^
lib/bx/arrays/array_tree.c:4772:13: warning: call to undeclared function 'PyDataType_ELSIZE'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 4772 |   __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
      |             ^
lib/bx/arrays/array_tree.c:4806:13: warning: call to undeclared function 'PyDataType_ALIGNMENT'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 4806 |   __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
      |             ^
lib/bx/arrays/array_tree.c:4844:15: warning: call to undeclared function 'PyDataType_FIELDS'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 4844 |   __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
      |               ^
lib/bx/arrays/array_tree.c:4844:13: error: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
 4844 |   __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
      |             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/bx/arrays/array_tree.c:4886:15: warning: call to undeclared function 'PyDataType_NAMES'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 4886 |   __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
      |               ^
lib/bx/arrays/array_tree.c:4886:13: error: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
 4886 |   __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
      |             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/bx/arrays/array_tree.c:4924:13: warning: call to undeclared function 'PyDataType_SUBARRAY'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 4924 |   __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
      |             ^
lib/bx/arrays/array_tree.c:4924:11: error: incompatible integer to pointer conversion assigning to 'PyArray_ArrayDescr *' (aka 'struct _arr_descr *') from 'int' [-Wint-conversion]
 4924 |   __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
      |           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/bx/arrays/array_tree.c:4958:13: warning: call to undeclared function 'PyDataType_FLAGS'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 4958 |   __pyx_r = PyDataType_FLAGS(__pyx_v_self);
      |             ^
lib/bx/arrays/array_tree.c:4992:13: warning: call to undeclared function 'PyArray_MultiIter_NUMITER'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 4992 |   __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
      |             ^
lib/bx/arrays/array_tree.c:5026:13: warning: call to undeclared function 'PyArray_MultiIter_SIZE'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 5026 |   __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
      |             ^
lib/bx/arrays/array_tree.c:5060:13: warning: call to undeclared function 'PyArray_MultiIter_INDEX'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 5060 |   __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
      |             ^
lib/bx/arrays/array_tree.c:5094:13: warning: call to undeclared function 'PyArray_MultiIter_NDIM'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 5094 |   __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
      |             ^
lib/bx/arrays/array_tree.c:5128:13: warning: call to undeclared function 'PyArray_MultiIter_DIMS'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 5128 |   __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
      |             ^
lib/bx/arrays/array_tree.c:5128:11: error: incompatible integer to pointer conversion assigning to 'npy_intp *' (aka 'long *') from 'int' [-Wint-conversion]
 5128 |   __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
      |           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/bx/arrays/array_tree.c:5162:13: warning: call to undeclared function 'PyArray_MultiIter_ITERS'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 5162 |   __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
      |             ^
lib/bx/arrays/array_tree.c:5162:11: error: incompatible integer to pointer conversion assigning to 'void **' from 'int' [-Wint-conversion]
 5162 |   __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
      |           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 warnings and 5 errors generated.

FreeBSD 14.0 Python-3.11

nsoranzo commented 2 months ago

Thanks for reporting the issue. Can you also let us know the numpy version and which compiler and version you are using?

The bx_python-0.12.0.tar.gz sdist from PyPI contains C files built with Cython and numpy 2.0, so it should be possible to install it with numpy >=1.25 (the oldest numpy release to support Python 3.9). If you are using an older numpy, gcc will consider -Wimplicit-function-declaration and -Wint-conversion as warnings and not errors and install bx-python 0.12.0 fine, so I suppose you are using clang as compiler. A workaround for your case should be to unpack the bx_python-0.12.0.tar.gz sdist, then:

$ cd bx_python-0.12.0/
$ python3 setup.py build_ext --force
$ python3 -m pip install .