phpsci/phpsci-carray

Compilation error

Closed this issue · 0 comments

Compiling on Ubuntu 20.04, I get the following error at the make test step:

/bin/bash /home/maestro/phpsci-carray/libtool --mode=compile cc  -I. -I/home/maestro/phpsci-carray -DPHP_ATOM_INC -I/home/maestro/phpsci-carray/include -I/home/maestro/phpsci-carray/main -I/home/maestro/phpsci-carray -I/usr/include/php/20200930 -I/usr/include/php/20200930/main -I/usr/include/php/20200930/TSRM -I/usr/include/php/20200930/Zend -I/usr/include/php/20200930/ext -I/usr/include/php/20200930/ext/date/lib -I/usr/include/  -DHAVE_CONFIG_H  -g -O2   -c /home/maestro/phpsci-carray/phpsci.c -o phpsci.lo 
libtool: compile:  cc -I. -I/home/maestro/phpsci-carray -DPHP_ATOM_INC -I/home/maestro/phpsci-carray/include -I/home/maestro/phpsci-carray/main -I/home/maestro/phpsci-carray -I/usr/include/php/20200930 -I/usr/include/php/20200930/main -I/usr/include/php/20200930/TSRM -I/usr/include/php/20200930/Zend -I/usr/include/php/20200930/ext -I/usr/include/php/20200930/ext/date/lib -I/usr/include/ -DHAVE_CONFIG_H -g -O2 -c /home/maestro/phpsci-carray/phpsci.c  -fPIC -DPIC -o .libs/phpsci.o
/home/maestro/phpsci-carray/phpsci.c: In function ‘ZVAL_TO_MEMORYPOINTER’:
/home/maestro/phpsci-carray/phpsci.c:111:76: warning: passing argument 2 of ‘zend_read_property’ from incompatible pointer type [-Wincompatible-pointer-types]
  111 | uid = (int)zval_get_long(zend_read_property(carray_sc_entry, obj, "uuid", sizeof("uuid") - 1, 1, &rv));
      |                                                              ^~~
      |                                                              |
      |                                                              zval * {aka struct _zval_struct *}

In file included from /usr/include/php/20200930/main/php.h:36,
                 from /home/maestro/phpsci-carray/phpsci.h:33,
                 from /home/maestro/phpsci-carray/phpsci.c:30:
/usr/include/php/20200930/Zend/zend_API.h:404:16: note: expected ‘zend_object *’ {aka ‘struct _zend_object *’} but argument is of type ‘zval *’ {aka ‘struct _zval_struct *’}
  404 | ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_bool silent, zval *rv);
      |                ^~~~~~~~~~~~~~~~~~
/home/maestro/phpsci-carray/phpsci.c: In function ‘MEMORYPOINTER_TO_ZVAL’:
/home/maestro/phpsci-carray/phpsci.c:184:48: warning: passing argument 2 of ‘zend_update_property_long’ from incompatible pointer type [-Wincompatible-pointer-types]
  184 |     zend_update_property_long(carray_sc_entry, a, "uuid", sizeof("uuid") - 1, ptr->uuid);
      |                                                ^
      |                                                |
      |                                                zval * {aka struct _zval_struct *}
In file included from /usr/include/php/20200930/main/php.h:36,
                 from /home/maestro/phpsci-carray/phpsci.h:33,
                 from /home/maestro/phpsci-carray/phpsci.c:30:
/usr/include/php/20200930/Zend/zend_API.h:387:79: note: expected ‘zend_object *’ {aka ‘struct _zend_object *’} but argument is of type ‘zval *’ {aka ‘struct _zval_struct *’}
  387 | d_update_property_long(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
      |                                                 ~~~~~~~~~~~~~^~~~~~

/home/maestro/phpsci-carray/phpsci.c:185:48: warning: passing argument 2 of ‘zend_update_property_long’ from incompatible pointer type [-Wincompatible-pointer-types]
  185 |     zend_update_property_long(carray_sc_entry, a, "ndim", sizeof("ndim") - 1, arr->ndim);
      |                                                ^
      |                                                |
      |                                                zval * {aka struct _zval_struct *}
In file included from /usr/include/php/20200930/main/php.h:36,
                 from /home/maestro/phpsci-carray/phpsci.h:33,
                 from /home/maestro/phpsci-carray/phpsci.c:30:
/usr/include/php/20200930/Zend/zend_API.h:387:79: note: expected ‘zend_object *’ {aka ‘struct _zend_object *’} but argument is of type ‘zval *’ {aka ‘struct _zval_struct *’}
  387 | d_update_property_long(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
      |                                                 ~~~~~~~~~~~~~^~~~~~

/home/maestro/phpsci-carray/phpsci.c: In function ‘RETURN_MEMORYPOINTER’:
/home/maestro/phpsci-carray/phpsci.c:200:48: warning: passing argument 2 of ‘zend_update_property_long’ from incompatible pointer type [-Wincompatible-pointer-types]
  200 |     zend_update_property_long(carray_sc_entry, return_value, "uuid", sizeof("uuid") - 1, ptr->uuid);
      |                                                ^~~~~~~~~~~~
      |                                                |
      |                                                zval * {aka struct _zval_struct *}
In file included from /usr/include/php/20200930/main/php.h:36,
                 from /home/maestro/phpsci-carray/phpsci.h:33,
                 from /home/maestro/phpsci-carray/phpsci.c:30:
/usr/include/php/20200930/Zend/zend_API.h:387:79: note: expected ‘zend_object *’ {aka ‘struct _zend_object *’} but argument is of type ‘zval *’ {aka ‘struct _zval_struct *’}
  387 | d_update_property_long(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
      |                                                 ~~~~~~~~~~~~~^~~~~~

/home/maestro/phpsci-carray/phpsci.c:201:48: warning: passing argument 2 of ‘zend_update_property_long’ from incompatible pointer type [-Wincompatible-pointer-types]
  201 |     zend_update_property_long(carray_sc_entry, return_value, "ndim", sizeof("ndim") - 1, arr->ndim);
      |                                                ^~~~~~~~~~~~
      |                                                |
      |                                                zval * {aka struct _zval_struct *}
In file included from /usr/include/php/20200930/main/php.h:36,
                 from /home/maestro/phpsci-carray/phpsci.h:33,
                 from /home/maestro/phpsci-carray/phpsci.c:30:
/usr/include/php/20200930/Zend/zend_API.h:387:79: note: expected ‘zend_object *’ {aka ‘struct _zend_object *’} but argument is of type ‘zval *’ {aka ‘struct _zval_struct *’}
  387 | d_update_property_long(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
      |                                                 ~~~~~~~~~~~~~^~~~~~

/home/maestro/phpsci-carray/phpsci.c: In function ‘RETURN_RUBIX_MEMORYPOINTER’:
/home/maestro/phpsci-carray/phpsci.c:209:48: warning: passing argument 2 of ‘zend_update_property_long’ from incompatible pointer type [-Wincompatible-pointer-types]
  209 |     zend_update_property_long(carray_sc_entry, return_value, "uuid", sizeof("uuid") - 1, ptr->uuid);
      |                                                ^~~~~~~~~~~~
      |                                                |
      |                                                zval * {aka struct _zval_struct *}
In file included from /usr/include/php/20200930/main/php.h:36,
                 from /home/maestro/phpsci-carray/phpsci.h:33,
                 from /home/maestro/phpsci-carray/phpsci.c:30:
/usr/include/php/20200930/Zend/zend_API.h:387:79: note: expected ‘zend_object *’ {aka ‘struct _zend_object *’} but argument is of type ‘zval *’ {aka ‘struct _zval_struct *’}
  387 | d_update_property_long(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
      |                                                 ~~~~~~~~~~~~~^~~~~~

/home/maestro/phpsci-carray/phpsci.c:210:48: warning: passing argument 2 of ‘zend_update_property_long’ from incompatible pointer type [-Wincompatible-pointer-types]
  210 |     zend_update_property_long(carray_sc_entry, return_value, "ndim", sizeof("ndim") - 1, arr->ndim);
      |                                                ^~~~~~~~~~~~
      |                                                |
      |                                                zval * {aka struct _zval_struct *}
In file included from /usr/include/php/20200930/main/php.h:36,
                 from /home/maestro/phpsci-carray/phpsci.h:33,
                 from /home/maestro/phpsci-carray/phpsci.c:30:
/usr/include/php/20200930/Zend/zend_API.h:387:79: note: expected ‘zend_object *’ {aka ‘struct _zend_object *’} but argument is of type ‘zval *’ {aka ‘struct _zval_struct *’}
  387 | d_update_property_long(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
      |                                                 ~~~~~~~~~~~~~^~~~~~

/home/maestro/phpsci-carray/phpsci.c: In function ‘zim_CArray___construct’:
/home/maestro/phpsci-carray/phpsci.c:252:48: warning: passing argument 2 of ‘zend_update_property_long’ from incompatible pointer type [-Wincompatible-pointer-types]
  252 |     zend_update_property_long(carray_sc_entry, obj, "uuid", sizeof("uuid") - 1, (int)ptr.uuid);
      |                                                ^~~
      |                                                |
      |                                                zval * {aka struct _zval_struct *}
In file included from /usr/include/php/20200930/main/php.h:36,
                 from /home/maestro/phpsci-carray/phpsci.h:33,
                 from /home/maestro/phpsci-carray/phpsci.c:30:
/usr/include/php/20200930/Zend/zend_API.h:387:79: note: expected ‘zend_object *’ {aka ‘struct _zend_object *’} but argument is of type ‘zval *’ {aka ‘struct _zval_struct *’}
  387 | d_update_property_long(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
      |                                                 ~~~~~~~~~~~~~^~~~~~

/home/maestro/phpsci-carray/phpsci.c:253:48: warning: passing argument 2 of ‘zend_update_property_long’ from incompatible pointer type [-Wincompatible-pointer-types]
  253 |     zend_update_property_long(carray_sc_entry, obj, "ndim", sizeof("ndim") - 1, (int)arr->ndim);
      |                                                ^~~
      |                                                |
      |                                                zval * {aka struct _zval_struct *}
In file included from /usr/include/php/20200930/main/php.h:36,
                 from /home/maestro/phpsci-carray/phpsci.h:33,
                 from /home/maestro/phpsci-carray/phpsci.c:30:
/usr/include/php/20200930/Zend/zend_API.h:387:79: note: expected ‘zend_object *’ {aka ‘struct _zend_object *’} but argument is of type ‘zval *’ {aka ‘struct _zval_struct *’}
  387 | d_update_property_long(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
      |                                                 ~~~~~~~~~~~~~^~~~~~

/home/maestro/phpsci-carray/phpsci.c: In function ‘zim_CArray___set’:
/usr/include/php/20200930/Zend/zend_API.h:413:73: warning: passing argument 2 of ‘zend_update_property_long’ from incompatible pointer type [-Wincompatible-pointer-types]
  413 | This()       ((Z_TYPE_P(ZEND_THIS) == IS_OBJECT) ? ZEND_THIS : NULL)
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
      |                                                              |
      |                                                              zval * {aka struct _zval_struct *}

/home/maestro/phpsci-carray/phpsci.c:284:52: note: in expansion of macro ‘getThis’
  284 |         zend_update_property_long(carray_sc_entry, getThis(), "uuid", sizeof("uuid") - 1, zval_get_long(value));
      |                                                    ^~~~~~~
/usr/include/php/20200930/Zend/zend_API.h:387:79: note: expected ‘zend_object *’ {aka ‘struct _zend_object *’} but argument is of type ‘zval *’ {aka ‘struct _zval_struct *’}
  387 | d_update_property_long(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
      |                                                 ~~~~~~~~~~~~~^~~~~~

/usr/include/php/20200930/Zend/zend_API.h:413:73: warning: passing argument 2 of ‘zend_update_property_long’ from incompatible pointer type [-Wincompatible-pointer-types]
  413 | This()       ((Z_TYPE_P(ZEND_THIS) == IS_OBJECT) ? ZEND_THIS : NULL)
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
      |                                                              |
      |                                                              zval * {aka struct _zval_struct *}

/home/maestro/phpsci-carray/phpsci.c:288:52: note: in expansion of macro ‘getThis’
  288 |         zend_update_property_long(carray_sc_entry, getThis(), "ndim", sizeof("ndim") - 1, zval_get_long(value));
      |                                                    ^~~~~~~
/usr/include/php/20200930/Zend/zend_API.h:387:79: note: expected ‘zend_object *’ {aka ‘struct _zend_object *’} but argument is of type ‘zval *’ {aka ‘struct _zval_struct *’}
  387 | d_update_property_long(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
      |                                                 ~~~~~~~~~~~~~^~~~~~

/home/maestro/phpsci-carray/phpsci.c: At top level:
/home/maestro/phpsci-carray/phpsci.c:3038:49: error: expected ‘;’, ‘,’ or ‘)’ before ‘TSRMLS_DC’
 3038 | int carray_compare(zval *object1, zval *object2 TSRMLS_DC) /* {{{ */
      |                                                 ^~~~~~~~~
/home/maestro/phpsci-carray/phpsci.c:3055:40: error: expected ‘;’, ‘,’ or ‘)’ before ‘TSRMLS_DC’
 3055 | carray_count(zval *object, long *count TSRMLS_DC) {
      |                                        ^~~~~~~~~
/home/maestro/phpsci-carray/phpsci.c: In function ‘zm_startup_carray’:
/home/maestro/phpsci-carray/phpsci.c:3113:27: error: ‘zend_object_handlers’ {aka ‘struct _zend_object_handlers’} has no member named ‘compare_objects’
 3113 |     carray_object_handlers.compare_objects = carray_compare;
      |                           ^
/home/maestro/phpsci-carray/phpsci.c:3113:46: error: ‘carray_compare’ undeclared (first use in this function); did you mean ‘carray_cast’?
 3113 |     carray_object_handlers.compare_objects = carray_compare;
      |                                              ^~~~~~~~~~~~~~
      |                                              carray_cast
/home/maestro/phpsci-carray/phpsci.c:3113:46: note: each undeclared identifier is reported only once for each function it appears in
/home/maestro/phpsci-carray/phpsci.c:3114:45: error: ‘carray_count’ undeclared (first use in this function); did you mean ‘carray_cast’?
 3114 |     carray_object_handlers.count_elements = carray_count;
      |                                             ^~~~~~~~~~~~
      |                                             carray_cast
make: *** [Makefile:194: phpsci.lo] Ошибка 1

I have installed the following php extensions:

sudo apt-get install libblas-dev libatlas-base-dev liblapacke-dev php7.2-dev

What am I doing wrong? Thanks in advance.