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

Missing library for installation, issue with OS X?

When I type

sudo ./install

in Terminal on OS X, I get the following error saying I am missing the libintl.h library.

/Users/xxx/cphalcon/build/64bits/phalcon.c:108409:10: fatal error: 'libintl.h' file not found

(HASH)include libintl.h

4 warnings and 1 error generated.

make: *** [phalcon.lo] Error 1

Relevant Stack Overflow: https://stackoverflow.com/questions/11370684/what-is-libintl-h-and-where-can-i-get-it Quote from best answer: "Since you're using Mac OS X, a Google search for "libintl.h OSX" shows a lot of people having similar problems."

When I try to install the relevant Debian package as shown below, brew cannot find the library. I can't use apt-get or yum because I am on OS X.

xxx-air:~ xxx$ brew install libc6-dev

Error: No available formula for libc6-dev

One comment from Stack Overflow says: "When packages are looking for this file, install or build the GNU gettext package. This packages "installs" ${prefix}/include/libintl.h, among other things." And another contributor follows up: "Possibly helpful since OP is on OS X, though doesn't specify if he is using Homebrew: I've seen some builds fail to find libintl despite gettext being installed -- I had to brew link gettext to resolve it."

What am I missing here?

Thanks,

Joe



24.4k
Accepted
answer

brew sucks, only the Ruby fans use it. Use MacPorts. Install gettext and php55-gettext and you'll be fine.

sudo port install gettext
sudo port install php55-gettext

Thanks for your help! I installed MacPorts and with it installed gettext and php55-gettext as you said. That all worked very nicely.

I am still getting the same error when I try to install Phalcon PHP though. I wonder if this libintl.h file is really in gettext? Or am I not linking to it correctly?

Thank you,

Joe

edited Jul '14

This is what I see when I do a locate libintl:

/opt/local/include/libintl.h
/opt/local/lib/libintl.8.dylib
/opt/local/lib/libintl.a
/opt/local/lib/libintl.dylib
/opt/local/lib/libintl.la
/opt/local/share/awk/libintl.awk
/opt/local/share/gettext/intl/libintl.rc
/opt/local/share/gettext/libintl.jar
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/games/ltris/files/patch-libintl.diff
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/perl/p5-libintl-perl
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/perl/p5-libintl-perl/Portfile
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/sysutils/apt/files/use-libintl.diff

And this is my PATH:

PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/share/phalcon-tools:/usr/local/bin

Are you using gcc? Check if you have gcc48 installed and libgcc with port installed | grep gcc.

edited Jul '14

I did not have gcc48 installed, so I installed it. "port installed | grep gcc" now produces:

xxx-air:build xxx$ port installed | grep gcc

gcc48 @4.8.2_2+universal (active)

gcc_select @0.1_8 (active)

libgcc @4.8.2_2+universal (active)

Now when I run "sudo ./install" I get:

:25792:no such instruction: `vcvtsi2sdq %rdx, %xmm0,%xmm0'

25793:no such instruction: `vmovsd %xmm0, (%rsi)'

26418:no such instruction: `vcvtsi2sd %edx, %xmm0,%xmm0'

26421:no such instruction: `vmulsd LC3037(%rip), %xmm0,%xmm0'

26422:no such instruction: `vmovsd %xmm0, (%rax)'

44027:no such instruction: `vmovsd (%rax), %xmm0'

44030:no such instruction: `vcvttsd2siq %xmm0, %rax'

make: *** [phalcon.lo] Error 1

https://pastebin.com/raw.php?i=t60utUuU

Thank you for your help, any ideas on where to go from here? This appears to be related: https://github.com/phalcon/cphalcon/issues/2233

Locate libintl produces:

/opt/local/include/libintl.h

/opt/local/lib/libintl.8.dylib

/opt/local/lib/libintl.a

/opt/local/lib/libintl.dylib

/opt/local/share/gettext/intl/libintl.rc

/opt/local/share/gettext/libintl.jar

/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/games/ltris/files/patch-libintl.diff

/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/perl/p5-libintl-perl

/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/perl/p5-libintl-perl/Portfile

/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/sysutils/apt/files/use-libintl.diff

/usr/local/MacGPG2/lib/libintl.8.dylib

/usr/local/MacGPG2/lib/libintl.dylib

edited Jul '14

Now can be a phpize problem. Please check the php, phpize and php55-config versions. Use which php to see the PHP you are using. Your /usr/bin/php should be a symlink to opt/local/bin/php55 and so phpize and php-config. The last ones are used to configure and compile every extension. If you type ls -al /usr/bin/ | grep php you should see:

lrwxr-xr-x     1 root   wheel        20 Jul  5 13:52 php -> /opt/local/bin/php55
lrwxr-xr-x     1 root   wheel        27 Jul 20 15:33 php-config -> /opt/local/bin/php-config55
lrwxr-xr-x     1 root   wheel        23 Jun 27  2013 phpize -> /opt/local/bin/phpize55


47.7k
edited Jul '14

I don't use mac-ports. So for anyone that has osx and their own custom MAMP stack (not the proprietry product) using /usr/local/:

cd /usr/local/src
wget https://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.2.tar.xz
tar -zxvf gettext-0.19.2.tar.xz
cd gettext-0.19.2/
./configure
make
sudo make install

Be sure that you may need to use a different version than the one used in the example above.

I think first you can locate your libintl.h file in your system, generally speaking, you can find it by locate libintl.h After you find your source file, say <path>/libintl.h, you can simply make a link to /usr/local/include, which is a default search path for #include statement Good Luck