jbboehr / php-mustache

Mustache PHP Extension
MIT License
56 stars 22 forks source link

Error compiling on OS X #5

Closed mbfisher closed 10 years ago

mbfisher commented 10 years ago

I'm getting an error when compiling on OS X. I'm not a C developer so I have no idea where to start debugging this; looking for some advice! Installation output below.

M

➜  builds  git clone git://github.com/jbboehr/php-mustache.git 
Cloning into 'php-mustache'...
remote: Reusing existing pack: 1585, done.
remote: Total 1585 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (1585/1585), 2.35 MiB | 1.00 MiB/s, done.
Resolving deltas: 100% (864/864), done.
Checking connectivity... done.
Checking out files: 100% (186/186), done.
➜  builds  cd php-mustache 
➜  php-mustache git:(master) git submodule update --init --recursive
Submodule 'mustache' (git://github.com/jbboehr/libmustache.git) registered for path 'mustache'
Submodule 'spec' (git://github.com/jbboehr/mustache-spec.git) registered for path 'spec'
Cloning into 'mustache'...
remote: Reusing existing pack: 666, done.
remote: Total 666 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (666/666), 217.23 KiB | 0 bytes/s, done.
Resolving deltas: 100% (411/411), done.
Checking connectivity... done.
Submodule path 'mustache': checked out '862d858f771deddb80ba6b581a968da490a1abcb'
Submodule 'spec' (git://github.com/jbboehr/mustache-spec.git) registered for path 'spec'
Cloning into 'spec'...
remote: Reusing existing pack: 632, done.
remote: Counting objects: 29, done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 661 (delta 3), reused 28 (delta 3)
Receiving objects: 100% (661/661), 171.22 KiB | 0 bytes/s, done.
Resolving deltas: 100% (311/311), done.
Checking connectivity... done.
Submodule path 'mustache/spec': checked out 'b96be9fd4c6d6984828d93169fe7e86d8a8aec2f'
Cloning into 'spec'...
remote: Reusing existing pack: 632, done.
remote: Counting objects: 29, done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 661 (delta 3), reused 28 (delta 3)
Receiving objects: 100% (661/661), 171.22 KiB | 0 bytes/s, done.
Resolving deltas: 100% (311/311), done.
Checking connectivity... done.
Submodule path 'spec': checked out '72233f3ffda9e33915fd3022d0a9ebbcce265acd'
➜  php-mustache git:(master) phpize
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212
➜  php-mustache git:(master) ./configure --enable-mustache
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 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 we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
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-darwin12.4.0
checking host system type... x86_64-apple-darwin12.4.0
checking target system type... x86_64-apple-darwin12.4.0
checking for PHP prefix... /usr/local/Cellar/php55/5.5.12
checking for PHP includes... -I/usr/local/Cellar/php55/5.5.12/include/php -I/usr/local/Cellar/php55/5.5.12/include/php/main -I/usr/local/Cellar/php55/5.5.12/include/php/TSRM -I/usr/local/Cellar/php55/5.5.12/include/php/Zend -I/usr/local/Cellar/php55/5.5.12/include/php/ext -I/usr/local/Cellar/php55/5.5.12/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/Cellar/php55/5.5.12/lib/php/extensions/no-debug-non-zts-20121212
checking for PHP installed headers prefix... /usr/local/Cellar/php55/5.5.12/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=gnu++11... yes
checking whether to enable mustache support... yes, shared
checking whether tcmalloc support is present and requested... no
checking libmustache location... yes, shared
checking for libmustache files... found source in ./mustache/src
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm 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 (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin12.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
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common
checking if g++ PIC flag -fno-common works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin12.4.0 dyld
(cached) (cached) checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating config.h
➜  php-mustache git:(master) make
/bin/sh /Users/mif08/builds/php-mustache/libtool --mode=compile g++  -I. -I/Users/mif08/builds/php-mustache -DPHP_ATOM_INC -I/Users/mif08/builds/php-mustache/include -I/Users/mif08/builds/php-mustache/main -I/Users/mif08/builds/php-mustache -I/usr/local/Cellar/php55/5.5.12/include/php -I/usr/local/Cellar/php55/5.5.12/include/php/main -I/usr/local/Cellar/php55/5.5.12/include/php/TSRM -I/usr/local/Cellar/php55/5.5.12/include/php/Zend -I/usr/local/Cellar/php55/5.5.12/include/php/ext -I/usr/local/Cellar/php55/5.5.12/include/php/ext/date/lib -I/Users/mif08/builds/php-mustache/mustache/src  -DHAVE_CONFIG_H  -g -O2 -std=gnu++11   -c /Users/mif08/builds/php-mustache/php_mustache.cpp -o php_mustache.lo 
mkdir .libs
 g++ -I. -I/Users/mif08/builds/php-mustache -DPHP_ATOM_INC -I/Users/mif08/builds/php-mustache/include -I/Users/mif08/builds/php-mustache/main -I/Users/mif08/builds/php-mustache -I/usr/local/Cellar/php55/5.5.12/include/php -I/usr/local/Cellar/php55/5.5.12/include/php/main -I/usr/local/Cellar/php55/5.5.12/include/php/TSRM -I/usr/local/Cellar/php55/5.5.12/include/php/Zend -I/usr/local/Cellar/php55/5.5.12/include/php/ext -I/usr/local/Cellar/php55/5.5.12/include/php/ext/date/lib -I/Users/mif08/builds/php-mustache/mustache/src -DHAVE_CONFIG_H -g -O2 -std=gnu++11 -c /Users/mif08/builds/php-mustache/php_mustache.cpp  -fno-common -DPIC -o .libs/php_mustache.o
In file included from /Users/mif08/builds/php-mustache/php_mustache.cpp:2:
In file included from ./php_mustache.hpp:5:
In file included from ./php_mustache.h:24:
In file included from /usr/local/Cellar/php55/5.5.12/include/php/main/php.h:34:
In file included from /usr/local/Cellar/php55/5.5.12/include/php/Zend/zend.h:286:
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:266:2: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
        register ulong hash = 5381;
        ^~~~~~~~~
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:353:2: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
        ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_update(ht, idx, pData, nDataSize, pDest));
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:348:2: note: expanded from macro 'ZEND_HANDLE_NUMERIC'
        ZEND_HANDLE_NUMERIC_EX(key, length, idx, return func);                                  \
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:311:2: note: expanded from macro 'ZEND_HANDLE_NUMERIC_EX'
        register const char *tmp = key;                                                                                 \
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:360:2: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
        ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_del(ht, idx));
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:348:2: note: expanded from macro 'ZEND_HANDLE_NUMERIC'
        ZEND_HANDLE_NUMERIC_EX(key, length, idx, return func);                                  \
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:311:2: note: expanded from macro 'ZEND_HANDLE_NUMERIC_EX'
        register const char *tmp = key;                                                                                 \
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:367:2: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
        ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_find(ht, idx, pData));
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:348:2: note: expanded from macro 'ZEND_HANDLE_NUMERIC'
        ZEND_HANDLE_NUMERIC_EX(key, length, idx, return func);                                  \
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:311:2: note: expanded from macro 'ZEND_HANDLE_NUMERIC_EX'
        register const char *tmp = key;                                                                                 \
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:374:2: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
        ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_exists(ht, idx));
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:348:2: note: expanded from macro 'ZEND_HANDLE_NUMERIC'
        ZEND_HANDLE_NUMERIC_EX(key, length, idx, return func);                                  \
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:311:2: note: expanded from macro 'ZEND_HANDLE_NUMERIC_EX'
        register const char *tmp = key;                                                                                 \
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:380:2: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
        ZEND_HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_update_current_key_ex(ht, HASH_KEY_IS_LONG, NULL, 0, idx, mode, pos));
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:348:2: note: expanded from macro 'ZEND_HANDLE_NUMERIC'
        ZEND_HANDLE_NUMERIC_EX(key, length, idx, return func);                                  \
        ^
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_hash.h:311:2: note: expanded from macro 'ZEND_HANDLE_NUMERIC_EX'
        register const char *tmp = key;                                                                                 \
        ^
In file included from /Users/mif08/builds/php-mustache/php_mustache.cpp:2:
In file included from ./php_mustache.hpp:5:
In file included from ./php_mustache.h:24:
In file included from /usr/local/Cellar/php55/5.5.12/include/php/main/php.h:34:
In file included from /usr/local/Cellar/php55/5.5.12/include/php/Zend/zend.h:840:
/usr/local/Cellar/php55/5.5.12/include/php/Zend/zend_operators.h:307:2: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
        register const unsigned char *e;
        ^~~~~~~~~
In file included from /Users/mif08/builds/php-mustache/php_mustache.cpp:2:
In file included from ./php_mustache.hpp:12:
In file included from /Users/mif08/builds/php-mustache/mustache/src/mustache.hpp:16:
/Users/mif08/builds/php-mustache/mustache/src/compiler.hpp:319:15: warning: assigning field to itself [-Wself-assign-field]
    this->pos = pos;
              ^
In file included from /Users/mif08/builds/php-mustache/php_mustache.cpp:2:
In file included from ./php_mustache.hpp:12:
In file included from /Users/mif08/builds/php-mustache/mustache/src/mustache.hpp:17:
/Users/mif08/builds/php-mustache/mustache/src/data.hpp:16:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
         ^
8 warnings and 1 error generated.
make: *** [php_mustache.lo] Error 1
jbboehr commented 10 years ago

Can you try

git pull
git submodule update --init --recursive
phpize
./configure
make && make test
mbfisher commented 10 years ago

Sorry for the very very slow reply!

That's done the trick, thank you.

M