Skip to content
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

failure installing on MacOS X 10.6.3, libffi-x86_64/include/ffi.h: No such file or directory #51

Closed
stepheneb opened this issue Jul 9, 2010 · 5 comments

Comments

@stepheneb
Copy link
Contributor

I'm getting a failure trying to install ffi on a new MacOS X 10.6.3 system into the system ruby.

The compile process is looking for this folder: libffi-x86_64/include/ffi.h and not finding it.

Details about my system:

$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

$ file `which ruby`
/usr/bin/ruby: Mach-O universal binary with 3 architectures
/usr/bin/ruby (for architecture x86_64):    Mach-O 64-bit executable x86_64
/usr/bin/ruby (for architecture i386):  Mach-O executable i386
/usr/bin/ruby (for architecture ppc7400):   Mach-O executable ppc

The errors from the console:

$ sudo gem install ffi

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for ffi.h in /usr/local/include... no
checking for rb_thread_blocking_region()... no
checking for ruby_thread_has_gvl_p()... no
checking for ruby_native_thread_p()... no
checking for rb_thread_call_with_gvl()... no
creating extconf.h
creating Makefile

make
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/Library/Ruby/Gems/1.8/gems/ffi-0.6.3/ext/ffi_c/libffi/include -I/Library/Ruby/Gems/1.8/gems/ffi-0.6.3/ext/ffi_c -DRUBY_EXTCONF_H=\"extconf.h\"  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common   -c AbstractMemory.c
In file included from Types.h:76,
                 from AbstractMemory.h:37,
                 from AbstractMemory.c:36:
/Library/Ruby/Gems/1.8/gems/ffi-0.6.3/ext/ffi_c/libffi/include/ffi.h:4:39: error: libffi-x86_64/include/ffi.h: No such file or directory
In file included from Types.h:77,
                 from AbstractMemory.h:37,
                 from AbstractMemory.c:36:
Type.h:44: error: expected specifier-qualifier-list before ‘ffi_type’
In file included from AbstractMemory.c:38:
Function.h:52: error: expected specifier-qualifier-list before ‘ffi_type’
lipo: can't open input file: /var/tmp//cchsz0m5.out (No such file or directory)
make: *** [AbstractMemory.o] Error 1
@bpo
Copy link

bpo commented Aug 13, 2010

Make sure you have libffi installed. brew install libffi

@stepheneb
Copy link
Contributor Author

Still getting a similar error (this is now on 10.6.4)

$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

$ brew info libffi
libffi 3.0.8
http://sourceware.org/libffi/
Not installed
http://github.com/stepheneb/homebrew/commits/master/Library/Formula/libffi.rb

$ brew install libffi
==> Downloading ftp://sourceware.org/pub/libffi/libffi-3.0.8.tar.gz
######################################################################## 100.0%
==> Downloading patches
######################################################################## 100.0%
==> Patching
patching file include/Makefile.in
patching file libffi.pc.in
==> ./configure --prefix=/usr/local/Cellar/libffi/3.0.8 --disable-debug --disable-dependency-tracking
==> make install
/usr/local/Cellar/libffi/3.0.8: 11 files, 272K, built in 9 seconds

$ sudo gem install ffi
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing ffi:
    ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for ffi_call() in -lffi... no
checking for ffi_raw_call()... no
checking for rb_thread_blocking_region()... no
checking for ruby_thread_has_gvl_p()... no
checking for ruby_native_thread_p()... no
checking for rb_thread_call_with_gvl()... no
creating extconf.h
creating Makefile

make
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/Library/Ruby/Gems/1.8/gems/ffi-0.6.3/ext/ffi_c/libffi/include -I/Library/Ruby/Gems/1.8/gems/ffi-0.6.3/ext/ffi_c -DRUBY_EXTCONF_H=\"extconf.h\"  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common  -I/usr/local/Cellar/libffi/3.0.8/include    -c AbstractMemory.c
In file included from Types.h:76,
                 from AbstractMemory.h:37,
                 from AbstractMemory.c:36:
/Library/Ruby/Gems/1.8/gems/ffi-0.6.3/ext/ffi_c/libffi/include/ffi.h:4:39: error: libffi-x86_64/include/ffi.h: No such file or directory
In file included from Types.h:77,
                 from AbstractMemory.h:37,
                 from AbstractMemory.c:36:
Type.h:44: error: expected specifier-qualifier-list before ‘ffi_type’
In file included from AbstractMemory.c:38:
Function.h:52: error: expected specifier-qualifier-list before ‘ffi_type’
lipo: can't open input file: /var/tmp//ccfPTnCl.out (No such file or directory)
make: *** [AbstractMemory.o] Error 1


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/ffi-0.6.3 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/ffi-0.6.3/ext/ffi_c/gem_make.out

@stepheneb
Copy link
Contributor Author

I fixed this by patching homebrew so libffi is universal

See:
http://github.com/mxcl/homebrew/issuesearch?state=open&q=universal#issue/1673

@stepheneb
Copy link
Contributor Author

Actually this issue: http://github.com/mxcl/homebrew/issues/issue/2246

@ghost
Copy link

ghost commented Aug 21, 2010

Its great you got it working ... but the libffi bundled with the ffi gem should still build correctly (which it looks like it is not).

This issue was closed.
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

2 participants