php-zmq icon indicating copy to clipboard operation
php-zmq copied to clipboard

zmq.so for arm64 on mac silicon m1

Open StormCh opened this issue 3 years ago • 2 comments
trafficstars

Building zmq.so on mac m1 was successful, but php does not accept zmq.so:

Warning: PHP Startup: Unable to load dynamic library 'zmq.so' tried: '/Applications/MAMP/bin/php/php8.0.8/lib/php/extensions/no-debug-non-zts-20200930/zmq.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

StormCh avatar Apr 08 '22 07:04 StormCh

phpize && ./configure Configuring for: PHP Api Version: 20200930 Zend Module Api No: 20200930 Zend Extension Api No: 420200930 configure.ac:18: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead build/php.m4:2072: PHP_CONFIG_NICE is expanded from... configure.ac:18: the top level configure.ac:161: warning: The macroAC_LANG_C' is obsolete. configure.ac:161: You should run autoupdate. ./lib/autoconf/c.m4:72: AC_LANG_C is expanded from... build/libtool.m4:2728: _LT_AC_LANG_C_CONFIG is expanded from... build/libtool.m4:2727: AC_LIBTOOL_LANG_C_CONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: The macro AC_LANG_C' is obsolete. configure.ac:161: You should run autoupdate. ./lib/autoconf/c.m4:72: AC_LANG_C is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... build/libtool.m4:561: _LT_AC_LOCK is expanded from... build/libtool.m4:1185: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from... build/libtool.m4:2728: _LT_AC_LANG_C_CONFIG is expanded from... build/libtool.m4:2727: AC_LIBTOOL_LANG_C_CONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: The macro AC_TRY_LINK' is obsolete. configure.ac:161: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... build/libtool.m4:561: _LT_AC_LOCK is expanded from... build/libtool.m4:1185: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from... build/libtool.m4:2728: _LT_AC_LANG_C_CONFIG is expanded from... build/libtool.m4:2727: AC_LIBTOOL_LANG_C_CONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: `$CC' does not support `-c -o', so `make -j' may be unsafe build/libtool.m4:1185: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from... build/libtool.m4:2728: _LT_AC_LANG_C_CONFIG is expanded from... build/libtool.m4:2727: AC_LIBTOOL_LANG_C_CONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: `$CC' does not support `-c -o', so `make -j' may be unsafe build/libtool.m4:1185: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from... build/libtool.m4:2728: _LT_AC_LANG_C_CONFIG is expanded from... build/libtool.m4:2727: AC_LIBTOOL_LANG_C_CONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: output file `$ofile' does not exist build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: output file `$ofile' does not exist build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: output file `$ofile' does not look like a libtool script build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: output file `$ofile' does not look like a libtool script build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: using `LTCC=$LTCC', extracted from `$ofile' build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: using `LTCC=$LTCC', extracted from `$ofile' build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: back quotes and double quotes must not be escaped in: tag name "$tagname" already exists build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: The macro AC_LANG_CPLUSPLUS' is obsolete. configure.ac:161: You should run autoupdate. ./lib/autoconf/c.m4:262: AC_LANG_CPLUSPLUS is expanded from... build/libtool.m4:2810: _LT_AC_LANG_CXX_CONFIG is expanded from... build/libtool.m4:2809: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from... build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: \$CC' does not support `-c -o', so `make -j' may be unsafe build/libtool.m4:1185: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from... build/libtool.m4:2810: _LT_AC_LANG_CXX_CONFIG is expanded from... build/libtool.m4:2809: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from... build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: `$CC' does not support `-c -o', so `make -j' may be unsafe build/libtool.m4:1185: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from... build/libtool.m4:2810: _LT_AC_LANG_CXX_CONFIG is expanded from... build/libtool.m4:2809: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from... build/libtool.m4:1918: _LT_AC_TAGCONFIG is expanded from... build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from... build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from... build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from... configure.ac:161: the top level 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/local/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 -R... no checking if compiler supports -Wl,-rpath,... yes checking build system type... x86_64-apple-darwin21.4.0 checking host system type... x86_64-apple-darwin21.4.0 checking target system type... x86_64-apple-darwin21.4.0 checking for PHP prefix... /Applications/MAMP/bin/php/php8.0.8 checking for PHP includes... -I/Applications/MAMP/bin/php/php8.0.8/include/php -I/Applications/MAMP/bin/php/php8.0.8/include/php/main -I/Applications/MAMP/bin/php/php8.0.8/include/php/TSRM -I/Applications/MAMP/bin/php/php8.0.8/include/php/Zend -I/Applications/MAMP/bin/php/php8.0.8/include/php/ext -I/Applications/MAMP/bin/php/php8.0.8/include/php/ext/date/lib checking for PHP extension directory... /Applications/MAMP/bin/php/php8.0.8/lib/php/extensions/no-debug-non-zts-20200930 checking for PHP installed headers prefix... /Applications/MAMP/bin/php/php8.0.8/include/php checking if debug is enabled... no checking if zts is enabled... no checking for gawk... no checking for nawk... no checking for awk... awk checking if awk is broken... no checking whether to enable 0MQ support... yes, shared checking whether to enable CZMQ support... no checking for pkg-config... /usr/local/bin/pkg-config checking libzmq installation... found version 4.3.4, under /usr/local/Cellar/zeromq/4.3.4 checking for zmq_socket_monitor in -lzmq... yes checking for zmq_proxy_steerable in -lzmq... yes checking for zmq_z85_decode in -lzmq... yes checking for zmq_curve_keypair in -lzmq... yes checking for zmq_ctx_get in -lzmq... yes checking for zmq_unbind in -lzmq... yes checking for zmq_disconnect in -lzmq... yes 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 stdint.h... (cached) yes checking for time.h... yes checking for sys/time.h... yes checking for mach/mach_time.h... yes checking for library containing clock_gettime... none required checking for clock_gettime... yes checking for gettimeofday... yes checking for mach_absolute_time... yes checking for a sed that does not truncate output... /usr/bin/sed checking for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognize dependent libraries... pass_all checking for dlfcn.h... yes checking the maximum length of command line arguments... 786432 checking command to parse /usr/bin/nm -B output from cc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking for dsymutil... dsymutil checking for nmedit... nmedit checking for -single_module linker flag... yes checking for -exported_symbols_list linker flag... yes checking if cc supports -fno-rtti -fno-exceptions... yes checking for cc option to produce PIC... -fno-common checking if cc PIC flag -fno-common works... yes checking if cc static flag -static works... no checking if cc supports -c -o file.o... yes checking whether the cc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin21.4.0 dyld 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

creating libtool appending configuration tag "CXX" to libtool configure: patching config.h.in configure: creating ./config.status config.status: creating config.h config.status: config.h is unchanged`

StormCh avatar Apr 08 '22 08:04 StormCh

`make && make install /bin/sh /Users/xxx/php-zmq/libtool --mode=install cp ./zmq.la /Users/xxx/php-zmq/modules cp ./.libs/zmq.so /Users/xxx/php-zmq/modules/zmq.so cp ./.libs/zmq.lai /Users/xxx/php-zmq/modules/zmq.la

Libraries have been installed in: /Users/xxx/php-zmq/modules

If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following:

  • add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable during execution

See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages.

Build complete. Don't forget to run 'make test'.

Installing shared extensions: /Applications/MAMP/bin/php/php8.0.8/lib/php/extensions/no-debug-non-zts-20200930/`

StormCh avatar Apr 08 '22 08:04 StormCh