Skip to content

Pecl update for php 8.3+ #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Kabingeran opened this issue Apr 5, 2024 · 9 comments
Closed

Pecl update for php 8.3+ #45

Kabingeran opened this issue Apr 5, 2024 · 9 comments

Comments

@Kabingeran
Copy link

Kabingeran commented Apr 5, 2024

Hi! Will pecl be added for php 8.3+?

@27pchrisl
Copy link
Contributor

If you need this and don't mind doing it manually, here's how you can build for PHP 8.3 on Ubuntu 22.04. All done in a Docker container.

The process uses the development branch of https://github.com/zephir-lang/zephir as that has recently got an update to support 8.3 but hasn't made a release yet.

docker run -it ubuntu:22.04 bash
apt update
apt install ca-certificates apt-transport-https software-properties-common lsb-release -y
add-apt-repository ppa:ondrej/php -y
apt install unzip make gcc gfortran php8.3-dev php8.3-mbstring libopenblas-dev liblapacke-dev re2c build-essential git -y
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
git clone https://github.com/RubixML/Tensor.git
pecl install zephir_parser
echo 'extension=zephir_parser.so' >> /etc/php/8.3/cli/php.ini
cd Tensor
/composer.phar require --dev phalcon/zephir:dev-development
./vendor/bin/zephir generate
./vendor/bin/zephir build
cp ext/modules/tensor.so /usr/lib/php/20230831/
echo 'extension=tensor.so' >> /etc/php/8.3/cli/php.ini
/composer.phar test
> phpunit
PHPUnit 9.6.19 by Sebastian Bergmann and contributors.

...............................................................  63 / 246 ( 25%)
............................................................... 126 / 246 ( 51%)
............................................................... 189 / 246 ( 76%)
.........................................................       246 / 246 (100%)

Time: 00:00.109, Memory: 6.00 MB

OK (246 tests, 270 assertions)

@Kabingeran
Copy link
Author

This is a bad solution. Why should I install all these dependencies? You need a one-line solution.

@vaawebdev-ozee
Copy link

Guys any news on supporting php 8.3?

@tacman
Copy link

tacman commented Mar 10, 2025

Can this issue be renamed to include PHP 8.4?

what level of effort is required for this? Is it something where you could post that need sponsors to reach a $xx limit to do it?

@27pchrisl
Copy link
Contributor

27pchrisl commented Mar 10, 2025

Updated build process for PHP 8.4.

It's the same situation as when this issue was originally raised, PHP 8.3 had shipped but Zephir 0.18 had not been released. Now PHP 8.4 is released and we are awaiting Zephir 0.19. So as before, this process uses the Zephir development branch (with a couple of tweaks).

Tensor could now update to Zephir 0.18 so that PHP 8.3 can be used without the process above.

docker run -it ubuntu:22.04 bash
apt update
apt install ca-certificates apt-transport-https software-properties-common lsb-release -y
add-apt-repository ppa:ondrej/php -y
DEBIAN_FRONTEND=noninteractive apt install unzip make gcc gfortran php8.4-dev php8.4-mbstring php8.4-xml libopenblas-dev liblapacke-dev re2c build-essential git -y
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
git clone https://github.com/RubixML/Tensor.git
pecl install zephir_parser
echo 'extension=zephir_parser.so' >> /etc/php/8.4/cli/php.ini
cd Tensor
/composer.phar require --dev phalcon/zephir:dev-development
./vendor/bin/zephir generate
./vendor/bin/zephir build
cp ext/modules/tensor.so /usr/lib/php/20240924/
echo 'extension=tensor.so' >> /etc/php/8.4/cli/php.ini
/composer.phar test
> phpunit
PHPUnit 9.6.22 by Sebastian Bergmann and contributors.

...............................................................  63 / 246 ( 25%)
............................................................... 126 / 246 ( 51%)
............................................................... 189 / 246 ( 76%)
.........................................................       246 / 246 (100%)

Time: 00:00.030, Memory: 6.00 MB

OK (246 tests, 270 assertions)

@tacman
Copy link

tacman commented Mar 10, 2025

FWIW, 8.4 is supported in the development branch, see link above.

I don't know enough about pecl and this extension to know if it's possible to use the development branch and create a new pecl release that supports 8.3 and 8.4.

@Kabingeran
Copy link
Author

Looks like it's outdated. Use rindow

@Kabingeran Kabingeran changed the title Pecl update for php 8.3.x Pecl update for php 8.3+ Mar 15, 2025
@andrewdalpino
Copy link
Member

I went ahead and pushed a new version of the extension to PECL that's compatible with PHP 8.3.

@tacman
Copy link

tacman commented Apr 4, 2025

I got this error:

sudo pecl install tensor
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading tensor-3.0.7.tgz ...
Starting to download tensor-3.0.7.tgz (117,451 bytes)
.........................done: 117,451 bytes
104 source files, building
running: phpize
Configuring for:
PHP Api Version:         20230831
Zend Module Api No:      20230831
Zend Extension Api No:   420230831
configure.ac:162: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:162: You should run autoupdate.
build/libtool.m4:100: AC_PROG_LIBTOOL is expanded from...
configure.ac:162: the top level
building in /tmp/pear/temp/pear-build-rootBb5k5f/tensor-3.0.7
running: /tmp/pear/temp/tensor/ext/configure --with-php-config=/usr/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20230831 -I/usr/include/php/20230831/main -I/usr/include/php/20230831/TSRM -I/usr/include/php/20230831/Zend -I/usr/include/php/20230831/ext -I/usr/include/php/20230831/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20230831
checking for PHP installed headers prefix... /usr/include/php/20230831
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking whether to enable tensor... yes, shared
checking for backtrace_symbols... yes
checking for cc options needed to detect all undeclared functions... none needed
checking whether HAVE_BUNDLED_PCRE is declared... no
checking whether HAVE_JSON is declared... yes
checking for ext/json/php_json.h... yes
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for file... file
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/bash /tmp/pear/temp/pear-build-rootBb5k5f/tensor-3.0.7/libtool --tag=CC --mode=compile cc -I. -I/tmp/pear/temp/tensor/ext -I/tmp/pear/temp/pear-build-rootBb5k5f/tensor-3.0.7/include -I/tmp/pear/temp/pear-build-rootBb5k5f/tensor-3.0.7/main -I/tmp/pear/temp/tensor/ext -I/usr/include/php/20230831 -I/usr/include/php/20230831/main -I/usr/include/php/20230831/TSRM -I/usr/include/php/20230831/Zend -I/usr/include/php/20230831/ext -I/usr/include/php/20230831/ext/date/lib  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE   -O3 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/tensor/ext/tensor.c -o tensor.lo  -MMD -MF tensor.dep -MT tensor.lo
libtool: compile:  cc -I. -I/tmp/pear/temp/tensor/ext -I/tmp/pear/temp/pear-build-rootBb5k5f/tensor-3.0.7/include -I/tmp/pear/temp/pear-build-rootBb5k5f/tensor-3.0.7/main -I/tmp/pear/temp/tensor/ext -I/usr/include/php/20230831 -I/usr/include/php/20230831/main -I/usr/include/php/20230831/TSRM -I/usr/include/php/20230831/Zend -I/usr/include/php/20230831/ext -I/usr/include/php/20230831/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -O3 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/tensor/ext/tensor.c -MMD -MF tensor.dep -MT tensor.lo  -fPIC -DPIC -o .libs/tensor.o
/tmp/pear/temp/tensor/ext/tensor.c:25:10: fatal error: cblas.h: No such file or directory
   25 | #include "cblas.h"
      |          ^~~~~~~~~
compilation terminated.
make: *** [Makefile:210: tensor.lo] Error 1
ERROR: `make' failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants