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

Failing to find ffi.h on RHEL4 build #50

Closed
kimptoc opened this issue May 9, 2012 · 9 comments
Closed

Failing to find ffi.h on RHEL4 build #50

kimptoc opened this issue May 9, 2012 · 9 comments

Comments

@kimptoc
Copy link

kimptoc commented May 9, 2012

Hi,

Given my lack of success with a windows install of node-ffi, I am trying the manual option - grabbed the node-ffi code and trying to build with node-gyp, but it seems to be failing to find ffi.h, from within ffi.h ...

[kimptonc@bxtv470717 rbranson-node-ffi-b902704]$ ./node_modules/node-gyp/bin/node-gyp.js configure build
info it worked if it ends with ok
spawn python [ '/home/kimptonc/.node-gyp/0.6.17/tools/gyp_addon',
  'binding.gyp',
  '-I/home/kimptonc/node/rbranson-node-ffi-b902704/build/config.gypi',
  '-f',
  'make' ]
spawn make [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/home/kimptonc/node/rbranson-node-ffi-b902704/build'
  ACTION libffi_test .
make[1]: Entering directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi'
  TOUCH Release/obj.target/libffi.stamp.node
  CXX(target) Release/obj.target/ffi_bindings/src/ffi.o
In file included from ../src/ffi.cc:1:
../src/ffi.h:14:17: warning: ffi.h: No such file or directory
../src/ffi.h:107: error: ISO C++ forbids declaration of 'ffi_cif' with no type
../src/ffi.h:107: error: expected ';' before '*' token
../src/ffi.h:137: error: ISO C++ forbids declaration of 'ffi_cif' with no type
../src/ffi.h:137: error: expected ';' before '*' token
../src/ffi.h:163: error: 'ffi_cif' has not been declared
../src/ffi.cc: In static member function 'static void FFI::InitializeBindings(v8::Handle<v8::Object>)':
../src/ffi.cc:31: error: 'ffi_type' was not declared in this scope
../src/ffi.cc:68: error: 'ffi_type_void' was not declared in this scope
../src/ffi.cc:69: error: 'ffi_type_uint8' was not declared in this scope
../src/ffi.cc:70: error: 'ffi_type_sint8' was not declared in this scope
../src/ffi.cc:72: error: 'ffi_type_uint16' was not declared in this scope
../src/ffi.cc:73: error: 'ffi_type_sint16' was not declared in this scope
../src/ffi.cc:74: error: 'ffi_type_uint32' was not declared in this scope
../src/ffi.cc:75: error: 'ffi_type_sint32' was not declared in this scope
../src/ffi.cc:76: error: 'ffi_type_uint64' was not declared in this scope
../src/ffi.cc:77: error: 'ffi_type_sint64' was not declared in this scope
../src/ffi.cc:78: error: 'ffi_type_uchar' was not declared in this scope
../src/ffi.cc:79: error: 'ffi_type_schar' was not declared in this scope
../src/ffi.cc:80: error: 'ffi_type_ushort' was not declared in this scope
../src/ffi.cc:81: error: 'ffi_type_sshort' was not declared in this scope
../src/ffi.cc:82: error: 'ffi_type_uint' was not declared in this scope
../src/ffi.cc:83: error: 'ffi_type_sint' was not declared in this scope
../src/ffi.cc:84: error: 'ffi_type_float' was not declared in this scope
../src/ffi.cc:85: error: 'ffi_type_double' was not declared in this scope
../src/ffi.cc:86: error: 'ffi_type_pointer' was not declared in this scope
../src/ffi.cc:101: error: 'ffi_type_ulong' was not declared in this scope
../src/ffi.cc:102: error: 'ffi_type_slong' was not declared in this scope
../src/ffi.cc: In static member function 'static v8::Handle<v8::Value> FFI::FFIPrepCif(const v8::Arguments&)':
../src/ffi.cc:142: error: 'ffi_status' was not declared in this scope
../src/ffi.cc:142: error: expected `;' before 'status'
../src/ffi.cc:153: error: 'ffi_cif' was not declared in this scope
../src/ffi.cc:155: error: 'status' was not declared in this scope
../src/ffi.cc:156: error: expected primary-expression before ')' token
../src/ffi.cc:157: error: 'FFI_DEFAULT_ABI' was not declared in this scope
../src/ffi.cc:159: error: 'ffi_type' was not declared in this scope
../src/ffi.cc:159: error: expected primary-expression before ')' token
../src/ffi.cc:160: error: expected primary-expression before ')' token
../src/ffi.cc:160: error: 'ffi_prep_cif' was not declared in this scope
../src/ffi.cc:162: error: 'FFI_OK' was not declared in this scope
make: *** [Release/obj.target/ffi_bindings/src/ffi.o] Error 1
make: Leaving directory `/home/kimptonc/node/rbranson-node-ffi-b902704/build'
ERR! Error: `make` failed with exit code: 2
    at ChildProcess.onExit (/home/kimptonc/node/rbranson-node-ffi-b902704/node_modules/node-gyp/lib/build.js:209:23)
    at ChildProcess.emit (events.js:70:17)
    at maybeExit (child_process.js:362:16)
    at Process.onexit (child_process.js:398:5)
ERR! not ok
@TooTallNate
Copy link
Member

Hmm, seems strange. It looks like the bundled libffi isn't getting compiled for some reason:

  ACTION libffi_test .
make[1]: Entering directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi'

I'm not exactly sure what could cause that. What happens if you follow the "build manually" instruction in the README?

@TooTallNate
Copy link
Member

err, these older README instructions rather...

@kimptoc
Copy link
Author

kimptoc commented May 11, 2012

Thanks - but still fails on the last step. The build of the static lib seems to work, although I cant seem to find it afterwards...


[kimptonc@bxtv470717 rbranson-node-ffi-b902704]$ pushd deps/libffi
~/node/rbranson-node-ffi-b902704/deps/libffi ~/node/rbranson-node-ffi-b902704
[kimptonc@bxtv470717 libffi]$ ./configure --enable-static --disable-shared && make
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
continue configure in default builddir "./x86_64-unknown-linux-gnu"
....exec /bin/sh .././configure "--srcdir=.." "--enable-builddir=x86_64-unknown-linux-gnu" "linux
gnu"
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gsed... sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
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 gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 98304
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
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 for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
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... no
checking whether to build static libraries... yes
checking for C compiler vendor... gnu
checking whether C compiler accepts -malign-double... no
checking whether C compiler accepts -fstrict-aliasing... yes
checking whether C compiler accepts -ffast-math... yes
checking for gcc architecture flag...
checking for x86 cpuid 0 output... b:756e6547:6c65746e:49656e69
checking for x86 cpuid 1 output... 206c2:31200800:29ee3ff:bfebfbff
checking whether C compiler accepts -march=pentiumpro... no
checking whether C compiler accepts -mcpu=pentiumpro... no
checking whether C compiler accepts -mpentiumpro... yes
checking for gcc architecture flag... -mpentiumpro
checking whether C compiler accepts -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro... yes
checking CFLAGS for maximum warnings... -Wall
checking whether to enable maintainer-specific portions of Makefiles... no
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for mmap... yes
checking for sys/mman.h... (cached) yes
checking for mmap... (cached) yes
checking whether read-only mmap of a plain file works... yes
checking whether mmap from /dev/zero works... yes
checking for MAP_ANON(YMOUS)... yes
checking whether mmap with MAP_ANON(YMOUS) works... yes
checking for ANSI C header files... (cached) yes
checking for memcpy... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking size of double... 8
checking size of long double... 16
checking whether byte ordering is bigendian... no
checking assembler .cfi pseudo-op support... yes
checking assembler supports pc related relocs... yes
checking assembler .ascii pseudo-op support... yes
checking assembler .string pseudo-op support... yes
checking assembler supports unwind section type... yes
checking whether .eh_frame section should be read-only... yes
checking for __attribute__((visibility("hidden")))... yes
configure: creating ./config.status
config.status: creating include/Makefile
config.status: creating include/ffi.h
config.status: creating Makefile
config.status: creating testsuite/Makefile
config.status: creating man/Makefile
config.status: creating libffi.pc
config.status: creating fficonfig.h
config.status: linking ../src/x86/ffitarget.h to include/ffitarget.h
config.status: executing buildir commands
config.status: create top_srcdir/Makefile guessed from local Makefile
config.status: build in x86_64-unknown-linux-gnu (HOST=)
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing include commands
config.status: executing src commands
MAKE x86_64-unknown-linux-gnu : 0 * all-all
make[1]: Entering directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi/x86_64-unknown-linux-gnu'
make "AR_FLAGS=" "CC_FOR_BUILD=" "CFLAGS=-O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions" "CXXFLAGS=" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "JC1FLAGS=" "LDFLAGS=" "LIBCFLAGS=" "LIBCFLAGS_FOR_TARGET=" "MAKE=make" "MAKEINFO=/bin/sh /home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi/missing --run makeinfo " "PICFLAG=" "PICFLAG_FOR_TARGET=" "RUNTESTFLAGS=" "SHELL=/bin/sh" "exec_prefix=/usr/local" "infodir=/usr/local/share/info" "libdir=/usr/local/lib" "mandir=/usr/local/share/man" "prefix=/usr/local" "AR=ar" "AS=as" "CC=gcc" "CXX=g++" "LD=/usr/bin/ld -m elf_x86_64" "NM=/usr/bin/nm -B" "RANLIB=ranlib" "DESTDIR=" all-recursive
make[2]: Entering directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi/x86_64-unknown-linux-gnu'
Making all in include
make[3]: Entering directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi/x86_64-unknown-linux-gnu/include'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi/x86_64-unknown-linux-gnu/include'
Making all in testsuite
make[3]: Entering directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi/x86_64-unknown-linux-gnu/testsuite'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi/x86_64-unknown-linux-gnu/testsuite'
Making all in man
make[3]: Entering directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi/x86_64-unknown-linux-gnu/man'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi/x86_64-unknown-linux-gnu/man'
make[3]: Entering directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi/x86_64-unknown-linux-gnu'
depbase=`echo src/prep_cif.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
        /bin/sh ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src -DFFI_BUILDING  -g  -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/prep_cif.lo -MD -MP -MF $depbase.Tpo -c -o src/prep_cif.lo ../src/prep_cif.c &&\
        mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/prep_cif.lo -MD -MP -MF src/.deps/prep_cif.Tpo -c ../src/prep_cif.c -o src/prep_cif.o
depbase=`echo src/types.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
        /bin/sh ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src -DFFI_BUILDING  -g  -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/types.lo -MD -MP -MF $depbase.Tpo -c -o src/types.lo ../src/types.c &&\
        mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/types.lo -MD -MP -MF src/.deps/types.Tpo -c ../src/types.c -o src/types.o
depbase=`echo src/raw_api.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
        /bin/sh ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src -DFFI_BUILDING  -g  -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/raw_api.lo -MD -MP -MF $depbase.Tpo -c -o src/raw_api.lo ../src/raw_api.c &&\
        mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/raw_api.lo -MD -MP -MF src/.deps/raw_api.Tpo -c ../src/raw_api.c -o src/raw_api.o
depbase=`echo src/java_raw_api.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
        /bin/sh ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src -DFFI_BUILDING  -g  -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/java_raw_api.lo -MD -MP -MF $depbase.Tpo -c -o src/java_raw_api.lo ../src/java_raw_api.c &&\
        mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/java_raw_api.lo -MD -MP -MF src/.deps/java_raw_api.Tpo -c ../src/java_raw_api.c -o src/java_raw_api.o
depbase=`echo src/closures.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
        /bin/sh ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src -DFFI_BUILDING  -g  -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/closures.lo -MD -MP -MF $depbase.Tpo -c -o src/closures.lo ../src/closures.c &&\
        mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/closures.lo -MD -MP -MF src/.deps/closures.Tpo -c ../src/closures.c -o src/closures.o
depbase=`echo src/x86/ffi64.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
        /bin/sh ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src -DFFI_BUILDING  -g  -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/x86/ffi64.lo -MD -MP -MF $depbase.Tpo -c -o src/x86/ffi64.lo ../src/x86/ffi64.c &&\
        mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/x86/ffi64.lo -MD -MP -MF src/x86/.deps/ffi64.Tpo -c ../src/x86/ffi64.c -o src/x86/ffi64.o
depbase=`echo src/x86/unix64.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
        /bin/sh ./libtool   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src -DFFI_BUILDING  -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g  -MT src/x86/unix64.lo -MD -MP -MF $depbase.Tpo -c -o src/x86/unix64.lo ../src/x86/unix64.S &&\
        mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -DFFI_BUILDING -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g -MT src/x86/unix64.lo -MD -MP -MF src/x86/.deps/unix64.Tpo -c ../src/x86/unix64.S -o src/x86/unix64.o
depbase=`echo src/x86/ffi.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
        /bin/sh ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src -DFFI_BUILDING  -g  -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/x86/ffi.lo -MD -MP -MF $depbase.Tpo -c -o src/x86/ffi.lo ../src/x86/ffi.c &&\
        mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -MT src/x86/ffi.lo -MD -MP -MF src/x86/.deps/ffi.Tpo -c ../src/x86/ffi.c -o src/x86/ffi.o
depbase=`echo src/x86/sysv.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
        /bin/sh ./libtool   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src -DFFI_BUILDING  -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g  -MT src/x86/sysv.lo -MD -MP -MF $depbase.Tpo -c -o src/x86/sysv.lo ../src/x86/sysv.S &&\
        mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -DFFI_BUILDING -I. -I../include -Iinclude -I../src -DFFI_BUILDING -g -MT src/x86/sysv.lo -MD -MP -MF src/x86/.deps/sysv.Tpo -c ../src/x86/sysv.S -o src/x86/sysv.o
/bin/sh ./libtool --tag=CC   --mode=link gcc -g  -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions -version-info `grep -v '^#' ../libtool-version`    -o libffi.la -rpath /usr/local/lib src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo                        src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo src/x86/sysv.lo
libtool: link: ar cru .libs/libffi.a  src/prep_cif.o src/types.o src/raw_api.o src/java_raw_api.o src/closures.o src/x86/ffi64.o src/x86/unix64.o src/x86/ffi.o src/x86/sysv.o
libtool: link: ranlib .libs/libffi.a
libtool: link: ( cd ".libs" && rm -f "libffi.la" && ln -s "../libffi.la" "libffi.la" )
/bin/sh ./libtool --tag=CC   --mode=link gcc -g  -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -mpentiumpro -Wall -fexceptions   -o libffi_convenience.la  src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo                        src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo src/x86/sysv.lo
libtool: link: ar cru .libs/libffi_convenience.a  src/prep_cif.o src/types.o src/raw_api.o src/java_raw_api.o src/closures.o src/x86/ffi64.o src/x86/unix64.o src/x86/ffi.o src/x86/sysv.o
libtool: link: ranlib .libs/libffi_convenience.a
libtool: link: ( cd ".libs" && rm -f "libffi_convenience.la" && ln -s "../libffi_convenience.la" "libffi_convenience.la" )
make[3]: Leaving directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi/x86_64-unknown-linux-gnu'
make[2]: Leaving directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi/x86_64-unknown-linux-gnu'
make[1]: Leaving directory `/home/kimptonc/node/rbranson-node-ffi-b902704/deps/libffi/x86_64-unknown-linux-gnu'


[kimptonc@bxtv470717 libffi]$ popd
~/node/rbranson-node-ffi-b902704


[kimptonc@bxtv470717 rbranson-node-ffi-b902704]$ node -v
v0.6.17

[kimptonc@bxtv470717 rbranson-node-ffi-b902704]$ ./node_modules/.bin/node-gyp configure
info it worked if it ends with ok
spawn python [ '/home/kimptonc/.node-gyp/0.6.17/tools/gyp_addon',
  'binding.gyp',
  '-I/home/kimptonc/node/rbranson-node-ffi-b902704/build/config.gypi',
  '-f',
  'make' ]
info done ok

[kimptonc@bxtv470717 rbranson-node-ffi-b902704]$ ./node_modules/.bin/node-gyp build
info it worked if it ends with ok
spawn make [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/home/kimptonc/node/rbranson-node-ffi-b902704/build'
  CXX(target) Release/obj.target/ffi_bindings/src/ffi.o
In file included from ../src/ffi.cc:1:
../src/ffi.h:14:17: warning: ffi.h: No such file or directory
../src/ffi.h:107: error: ISO C++ forbids declaration of 'ffi_cif' with no type
../src/ffi.h:107: error: expected ';' before '*' token
../src/ffi.h:137: error: ISO C++ forbids declaration of 'ffi_cif' with no type
../src/ffi.h:137: error: expected ';' before '*' token
../src/ffi.h:163: error: 'ffi_cif' has not been declared
../src/ffi.cc: In static member function 'static void FFI::InitializeBindings(v8::Handle<v8::Object>)':
../src/ffi.cc:31: error: 'ffi_type' was not declared in this scope
../src/ffi.cc:68: error: 'ffi_type_void' was not declared in this scope
../src/ffi.cc:69: error: 'ffi_type_uint8' was not declared in this scope
../src/ffi.cc:70: error: 'ffi_type_sint8' was not declared in this scope
../src/ffi.cc:72: error: 'ffi_type_uint16' was not declared in this scope
../src/ffi.cc:73: error: 'ffi_type_sint16' was not declared in this scope
../src/ffi.cc:74: error: 'ffi_type_uint32' was not declared in this scope
../src/ffi.cc:75: error: 'ffi_type_sint32' was not declared in this scope
../src/ffi.cc:76: error: 'ffi_type_uint64' was not declared in this scope
../src/ffi.cc:77: error: 'ffi_type_sint64' was not declared in this scope
../src/ffi.cc:78: error: 'ffi_type_uchar' was not declared in this scope
../src/ffi.cc:79: error: 'ffi_type_schar' was not declared in this scope
../src/ffi.cc:80: error: 'ffi_type_ushort' was not declared in this scope
../src/ffi.cc:81: error: 'ffi_type_sshort' was not declared in this scope
../src/ffi.cc:82: error: 'ffi_type_uint' was not declared in this scope
../src/ffi.cc:83: error: 'ffi_type_sint' was not declared in this scope
../src/ffi.cc:84: error: 'ffi_type_float' was not declared in this scope
../src/ffi.cc:85: error: 'ffi_type_double' was not declared in this scope
../src/ffi.cc:86: error: 'ffi_type_pointer' was not declared in this scope
../src/ffi.cc:101: error: 'ffi_type_ulong' was not declared in this scope
../src/ffi.cc:102: error: 'ffi_type_slong' was not declared in this scope
../src/ffi.cc: In static member function 'static v8::Handle<v8::Value> FFI::FFIPrepCif(const v8::Arguments&)':
../src/ffi.cc:142: error: 'ffi_status' was not declared in this scope
../src/ffi.cc:142: error: expected `;' before 'status'
../src/ffi.cc:153: error: 'ffi_cif' was not declared in this scope
../src/ffi.cc:155: error: 'status' was not declared in this scope
../src/ffi.cc:156: error: expected primary-expression before ')' token
../src/ffi.cc:157: error: 'FFI_DEFAULT_ABI' was not declared in this scope
../src/ffi.cc:159: error: 'ffi_type' was not declared in this scope
../src/ffi.cc:159: error: expected primary-expression before ')' token
../src/ffi.cc:160: error: expected primary-expression before ')' token
../src/ffi.cc:160: error: 'ffi_prep_cif' was not declared in this scope
../src/ffi.cc:162: error: 'FFI_OK' was not declared in this scope
make: *** [Release/obj.target/ffi_bindings/src/ffi.o] Error 1
make: Leaving directory `/home/kimptonc/node/rbranson-node-ffi-b902704/build'
ERR! Error: `make` failed with exit code: 2
    at ChildProcess.onExit (/home/kimptonc/node/rbranson-node-ffi-b902704/node_modules/node-gyp/lib/build.js:209:23)
    at ChildProcess.emit (events.js:70:17)
    at maybeExit (child_process.js:362:16)
    at Process.onexit (child_process.js:398:5)
ERR! not ok

@TooTallNate
Copy link
Member

node-ffi is looking for deps/libffi/.libs/libffi.a to be present, so make sure that's getting built

@TooTallNate
Copy link
Member

Also, make sure deps/libffi/include/ffi.h exists, since it seems to be not finding that either...

@kimptoc
Copy link
Author

kimptoc commented May 14, 2012

Many Thanks - I had "ar" aliased to something else - oops.

I now have libffi.a built but its now failing on the node-gyp build. Looks like the node-gyp configure command cleans out the ffi.h produced earlier (in ./deps/libffi/x86_64-unknown-linux-gnu/include/ffi.h). But even if I skip the configure command, it still seems to not use that one anyway.

I have tried the npm install again (with ar unaliased, but it fails in the same way).

Any thoughts on what this might be?

Cheers,
Chris

[kimptonc@bxtv470717 rbranson-node-ffi-b902704]$ ./node_modules/node-gyp/bin/node-gyp.js build
info it worked if it ends with ok
spawn make [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/home/kimptonc/node/rbranson-node-ffi-b902704/build'
  CXX(target) Release/obj.target/ffi_bindings/src/ffi.o
In file included from ../src/ffi.cc:1:
../src/ffi.h:14:17: warning: ffi.h: No such file or directory
../src/ffi.h:107: error: ISO C++ forbids declaration of 'ffi_cif' with no type
../src/ffi.h:107: error: expected ';' before '*' token
../src/ffi.h:137: error: ISO C++ forbids declaration of 'ffi_cif' with no type
../src/ffi.h:137: error: expected ';' before '*' token
../src/ffi.h:163: error: 'ffi_cif' has not been declared
../src/ffi.cc: In static member function 'static void FFI::InitializeBindings(v8::Handle<v8::Object>)':
../src/ffi.cc:31: error: 'ffi_type' was not declared in this scope
../src/ffi.cc:68: error: 'ffi_type_void' was not declared in this scope
../src/ffi.cc:69: error: 'ffi_type_uint8' was not declared in this scope
../src/ffi.cc:70: error: 'ffi_type_sint8' was not declared in this scope
../src/ffi.cc:72: error: 'ffi_type_uint16' was not declared in this scope
../src/ffi.cc:73: error: 'ffi_type_sint16' was not declared in this scope
../src/ffi.cc:74: error: 'ffi_type_uint32' was not declared in this scope
../src/ffi.cc:75: error: 'ffi_type_sint32' was not declared in this scope
../src/ffi.cc:76: error: 'ffi_type_uint64' was not declared in this scope
../src/ffi.cc:77: error: 'ffi_type_sint64' was not declared in this scope
../src/ffi.cc:78: error: 'ffi_type_uchar' was not declared in this scope
../src/ffi.cc:79: error: 'ffi_type_schar' was not declared in this scope
../src/ffi.cc:80: error: 'ffi_type_ushort' was not declared in this scope
../src/ffi.cc:81: error: 'ffi_type_sshort' was not declared in this scope
../src/ffi.cc:82: error: 'ffi_type_uint' was not declared in this scope
../src/ffi.cc:83: error: 'ffi_type_sint' was not declared in this scope
../src/ffi.cc:84: error: 'ffi_type_float' was not declared in this scope
../src/ffi.cc:85: error: 'ffi_type_double' was not declared in this scope
../src/ffi.cc:86: error: 'ffi_type_pointer' was not declared in this scope
../src/ffi.cc:101: error: 'ffi_type_ulong' was not declared in this scope
../src/ffi.cc:102: error: 'ffi_type_slong' was not declared in this scope
../src/ffi.cc: In static member function 'static v8::Handle<v8::Value> FFI::FFIPrepCif(const v8::Arguments&)':
../src/ffi.cc:142: error: 'ffi_status' was not declared in this scope
../src/ffi.cc:142: error: expected `;' before 'status'
../src/ffi.cc:153: error: 'ffi_cif' was not declared in this scope
../src/ffi.cc:155: error: 'status' was not declared in this scope
../src/ffi.cc:156: error: expected primary-expression before ')' token
../src/ffi.cc:157: error: 'FFI_DEFAULT_ABI' was not declared in this scope
../src/ffi.cc:159: error: 'ffi_type' was not declared in this scope
../src/ffi.cc:159: error: expected primary-expression before ')' token
../src/ffi.cc:160: error: expected primary-expression before ')' token
../src/ffi.cc:160: error: 'ffi_prep_cif' was not declared in this scope
../src/ffi.cc:162: error: 'FFI_OK' was not declared in this scope
make: *** [Release/obj.target/ffi_bindings/src/ffi.o] Error 1
make: Leaving directory `/home/kimptonc/node/rbranson-node-ffi-b902704/build'
ERR! Error: `make` failed with exit code: 2
    at ChildProcess.onExit (/home/kimptonc/node/rbranson-node-ffi-b902704/node_modules/node-gyp/lib/build.js:209:23)
    at ChildProcess.emit (events.js:70:17)
    at maybeExit (child_process.js:362:16)
    at Process.onexit (child_process.js:398:5)
ERR! not ok

@TooTallNate
Copy link
Member

Can you try invoking node-gyp with -v to see the build command being used?

@TooTallNate
Copy link
Member

Well, I'm gonna close this since it seems to be a problem with your setup.

But perhaps try out the v1.0.0-alpha release. It seemed to build correctly on all the platforms I tested except Windows:

$ npm install ffi

@kimptoc
Copy link
Author

kimptoc commented May 30, 2012

Hi - thanks for the update. Not had a chance to try either of your suggestions. Hopefully next week will be a good week for that :)

Many thanks for the help.

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