RubixML/Tensor

make fails on Ubuntu 20, PHP 8.2

sneakyimp opened this issue · 5 comments

I have carefully followed the instructions for manually compiling the Tensor extension. make failed with output ending in the following errors:

/home/sneakyimp/biz/machine-learning/tensor/Tensor/ext/kernel/main.c: In function ‘zephir_function_exists’:
/home/sneakyimp/biz/machine-learning/tensor/Tensor/ext/kernel/main.c:285:101: warning: comparison between pointer and integer
  285 |  if (zend_hash_str_exists(CG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)) != NULL) {
      |                                                                                                     ^~
/home/sneakyimp/biz/machine-learning/tensor/Tensor/ext/kernel/main.c: In function ‘zephir_function_exists_ex’:
/home/sneakyimp/biz/machine-learning/tensor/Tensor/ext/kernel/main.c:301:76: warning: comparison between pointer and integer
  301 |  if (zend_hash_str_exists(CG(function_table), function_name, function_len) != NULL) {
      |                                                                            ^~
/home/sneakyimp/biz/machine-learning/tensor/Tensor/ext/kernel/main.c: In function ‘zephir_get_arg’:
/home/sneakyimp/biz/machine-learning/tensor/Tensor/ext/kernel/main.c:571:9: error: too many arguments to function ‘zend_forbid_dynamic_call’
  571 |     if (zend_forbid_dynamic_call("func_get_arg()") == FAILURE) {
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/php/20220829/main/php.h:35,
                 from /home/sneakyimp/biz/machine-learning/tensor/Tensor/ext/kernel/main.c:16:
/usr/include/php/20220829/Zend/zend_API.h:782:39: note: declared here
  782 | static zend_always_inline zend_result zend_forbid_dynamic_call(void)
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:213: kernel/main.lo] Error 1

I have also attempted to build the commit described by myfluxi in issue #33 and the make/compile succeeds but the resulting shared library has very strange behavior, segfaulting when certain comments are in place, and producing incorrect dimensions for a matrix multiplication operation.

any support for php 8.2 ?

any support for php 8.2 ?

It doesn't seem so. I've had no responses at all to my posts here in weeks.

Sorry fellas I haven't had alot of time lately. I'll take a look into this as soon as I can.

It looks as though Zephir does not support PHP 8.2 yet

https://github.com/zephir-lang/zephir/releases/tag/0.16.3

Having that said, if you have a fix @sneakyimp can you submit a PR?

Otherwise, you could try the latest code on master, I recompiled the extension with the latest (0.16.3) version of Zephir. Maybe it'll work. If not, we can wait until Zephir offers PHP 8.2 support.

Ok this should be fixed in version 3.0.3 on PECL and on the latest master branch

https://pecl.php.net/package/Tensor/3.0.3