JoshCheek / seeing_is_believing

Displays the results of every line of code in your file
1.31k stars 54 forks source link

Unable to install seeing_is_believing on Apple M1 #169

Open chrisgeek opened 1 year ago

chrisgeek commented 1 year ago

When I run gem install seeing_is_believing, I get the error below

Function.c:867:17: error: call to undeclared function 'ffi_prep_closure'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    ffiStatus = ffi_prep_closure(code, &fnInfo->ffi_cif, callback_invoke, closure);

Ruby version: 3.0.2

svanderbleek commented 1 year ago

I'm also having problems on M2:

gem install seeing_is_believing
Building native extensions. This could take a while...
ERROR:  Error installing seeing_is_believing:
    ERROR: Failed to build gem native extension.

    current directory: /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c
/Users/svanderbleek/.asdf/installs/ruby/3.2.2/bin/ruby extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for shlwapi.h... no
checking for rb_thread_call_without_gvl()... yes
checking for ruby_native_thread_p()... yes
checking for ruby_thread_has_gvl_p()... yes
creating extconf.h
creating Makefile

current directory: /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c
make DESTDIR\= sitearchdir\=./.gem.20231108-16321-r1a3j sitelibdir\=./.gem.20231108-16321-r1a3j clean

current directory: /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c
make DESTDIR\= sitearchdir\=./.gem.20231108-16321-r1a3j sitelibdir\=./.gem.20231108-16321-r1a3j
Configuring libffi
clang: error: unsupported option '-print-multi-os-directory'
clang: error: no input files
cd "/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi-arm64-darwin23" && /Library/Developer/CommandLineTools/usr/bin/make
/Library/Developer/CommandLineTools/usr/bin/make 'AR_FLAGS=' 'CC_FOR_BUILD=' 'CFLAGS=-Wall -fexceptions' 'CXXFLAGS=-g -O2' 'CFLAGS_FOR_BUILD=' 'CFLAGS_FOR_TARGET=' 'INSTALL=/opt/homebrew/bin/ginstall -c' 'INSTALL_DATA=/opt/homebrew/bin/ginstall -c -m 644' 'INSTALL_PROGRAM=/opt/homebrew/bin/ginstall -c' 'INSTALL_SCRIPT=/opt/homebrew/bin/ginstall -c' 'JC1FLAGS=' 'LDFLAGS=' 'LIBCFLAGS=' 'LIBCFLAGS_FOR_TARGET=' 'MAKE=/Library/Developer/CommandLineTools/usr/bin/make' 'MAKEINFO=/bin/sh /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/missing 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=clang' 'CXX=g++' 'LD=ld' 'NM=/usr/bin/nm -B' 'RANLIB=ranlib' 'DESTDIR=' all-recursive
Making all in include
make[3]: Nothing to be done for `all'.
Making all in testsuite
make[3]: Nothing to be done for `all'.
Making all in man
make[3]: Nothing to be done for `all'.
/bin/sh ./libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi  -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src   -Wall -fexceptions -c -o src/prep_cif.lo /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/prep_cif.c
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src -Wall -fexceptions -c /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/prep_cif.c  -fno-common -DPIC -o src/.libs/prep_cif.o
/bin/sh ./libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi  -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src   -Wall -fexceptions -c -o src/types.lo /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/types.c
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src -Wall -fexceptions -c /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/types.c  -fno-common -DPIC -o src/.libs/types.o
/bin/sh ./libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi  -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src   -Wall -fexceptions -c -o src/raw_api.lo /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/raw_api.c
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src -Wall -fexceptions -c /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/raw_api.c  -fno-common -DPIC -o src/.libs/raw_api.o
/bin/sh ./libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi  -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src   -Wall -fexceptions -c -o src/java_raw_api.lo /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/java_raw_api.c
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src -Wall -fexceptions -c /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/java_raw_api.c  -fno-common -DPIC -o src/.libs/java_raw_api.o
/bin/sh ./libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi  -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src   -Wall -fexceptions -c -o src/closures.lo /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/closures.c
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src -Wall -fexceptions -c /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/closures.c  -fno-common -DPIC -o src/.libs/closures.o
/bin/sh ./libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi  -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src   -Wall -fexceptions -c -o src/arm/ffi.lo /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/arm/ffi.c
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src -Wall -fexceptions -c /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/arm/ffi.c  -fno-common -DPIC -o src/arm/.libs/ffi.o
/bin/sh ./libtool    --mode=compile clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi  -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src  -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src  -c -o src/arm/sysv.lo /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/arm/sysv.S
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src -I. -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/include -Iinclude -I/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src -c /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/src/arm/sysv.S  -fno-common -DPIC -o src/arm/.libs/sysv.o
/bin/sh ./libtool  --tag=CC   --mode=link clang  -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/arm/ffi.lo src/arm/sysv.lo 
libtool: link: ar cru .libs/libffi_convenience.a src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/arm/.libs/ffi.o src/arm/.libs/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" )
/bin/sh ./libtool  --tag=CC   --mode=link clang  -Wall -fexceptions -no-undefined -version-info `grep -v '^#' /Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi/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/arm/ffi.lo src/arm/sysv.lo 
libtool: link: clang -dynamiclib  -o .libs/libffi.7.dylib  src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/arm/.libs/ffi.o src/arm/.libs/sysv.o      -install_name  /usr/local/lib/libffi.7.dylib -compatibility_version 9 -current_version 9.0 
ld: Undefined symbols:
  _ffi_call, referenced from:
      _ffi_raw_call in raw_api.o
      _ffi_java_raw_call in java_raw_api.o
  _ffi_closure_trampoline_table_page, referenced from:
      _ffi_trampoline_table_alloc in closures.o
  _ffi_prep_cif_machdep, referenced from:
      _ffi_prep_cif_core in prep_cif.o
  _ffi_prep_cif_machdep_var, referenced from:
      _ffi_prep_cif_core in prep_cif.o
  _ffi_prep_closure_loc, referenced from:
      _ffi_prep_closure in prep_cif.o
      _ffi_prep_raw_closure_loc in raw_api.o
      _ffi_prep_java_raw_closure_loc in java_raw_api.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libffi.la] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** ["/Users/svanderbleek/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/ffi-1.11.3/ext/ffi_c/libffi-arm64-darwin23"/.libs/libffi_convenience.a] Error 2

make failed, exit code 2

but I can install ffi 1.16.3.

samholst commented 5 months ago

I cannot install as well with same error