We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Compiling phalcon on Mac from /ext

Guys,

I use this to compile Phalcon in Ubuntu:

phpize .clean && phpize && ./configure CFLAGS="-O0 -g3" CC=gcc && make -j75 && sudo make install

However, it fails on Mac with:

duplicate symbol _phalcon_translate_adapter_object_handlers in:
    .libs/phalcon.o
    translate/adapter/.libs/nativearray.o
duplicate symbol _phalcon_translate_adapter_object_handlers in:
    .libs/phalcon.o
    translate/.libs/adapter.o
ld: 2 duplicate symbols for architecture x86_64
collect2: ld returned 1 exit status
make: *** [phalcon.la] Error 1

Can anyone tell me why?

Thanks!



51.4k
edited May '14

Hi,

Thanks for your email.

Yes, the problem still persists. But, I suspect that there's something in the Phalcon source code.

I'm trying to compile branch 1.3.0, commit ID 626f01b13d4dceeef0511e12fa832a12049a048b from ext/. If I run php gen-build.php and use /.install, the result is the same.

Unfortunately, I have no idea what compiler it is, as I am not on Mac. It's my colleague who's having that problem (I know next to nothing about Macs, anyway).

So, if you're on Mac, I wonder if you could try to compile it.. I'd be very grateful.

Regards, Temuri



98.9k

Try with:

phpize .clean && phpize && ./configure CFLAGS="-O2 -fvisibility=hidden" CC=gcc && make -j4 && sudo make install