【问题标题】:io_splice for OSX EL Capitan errorOSX EL Capitan 错误的 io_splice
【发布时间】:2015-11-18 14:53:59
【问题描述】:

我正在尝试在 OS X 中安装 gem!。我认为问题在于文件与С.的连接级别。

需要'mkmf'

$CPPFLAGS

have_func('splice', %w(fcntl.h)) 或 abort 'splice(2) not defined'

have_func('tee', %w(fcntl.h)) 或 abort 'tee(2) not defined'

have_func('pipe2', %w(fcntl.h unistd.h))

have_func('rb_thread_blocking_region')

have_func('rb_thread_call_without_gvl')

have_macro('F_GETPIPE_SZ',%w(fcntl.h))

have_macro('F_SETPIPE_SZ', %w(fcntl.h))

create_makefile('io_splice_ext')

gem install io_splice

错误!

Building native extensions.  This could take a while...
ERROR:  Error installing io_splice:
    ERROR: Failed to build gem native extension.
    /Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -r ./siteconf20151118-25778-1qyxgw.rb extconf.rb
checking for splice() in fcntl.h... no
splice(2) not defined
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.
Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/bin/ruby
extconf failed, exit code 1
Gem files will remain installed in /Users/parfenov/.rvm/gems/ruby-1.9.3-p551/gems/io_splice-4.4.0 for inspection.
Results logged to /Users/parfenov/.rvm/gems/ruby-1.9.3-p551/extensions/x86_64-darwin-14/1.9.1/io_splice-4.4.0/gem_make.out

mkmf.log

have_func: checking for splice() in fcntl.h... -------------------- no

"/usr/local/bin/gcc-4.9 -o conftest -I/Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/x86_64-darwin14.5.0 -I/Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/backward -I/Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_GNU_SOURCE=1  -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fno-common -pipe conftest.c  -L. -L/Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L.  -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib      -lruby.1.9.1  -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"/usr/local/bin/gcc-4.9 -o conftest -I/Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/x86_64-darwin14.5.0 -I/Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/backward -I/Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_GNU_SOURCE=1  -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fno-common -pipe conftest.c  -L. -L/Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L.  -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib      -lruby.1.9.1  -lpthread -ldl -lobjc "
conftest.c: In function 't':
conftest.c:6:53: error: 'splice' undeclared (first use in this function)
 int t() { void ((*volatile p)()); p = (void ((*)()))splice; return 0; }
                                                     ^
conftest.c:6:53: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:6:28: warning: variable 'p' set but not used [-Wunused-but-set-variable]
 int t() { void ((*volatile p)()); p = (void ((*)()))splice; return 0; }
                            ^
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <fcntl.h>
 4: 
 5: /*top*/
 6: int t() { void ((*volatile p)()); p = (void ((*)()))splice; return 0; }
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     printf("%p", &t);
11:   }
12: 
13:   return 0;
14: }
/* end */

"/usr/local/bin/gcc-4.9 -o conftest -I/Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/x86_64-darwin14.5.0 -I/Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1/ruby/backward -I/Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_GNU_SOURCE=1  -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fno-common -pipe conftest.c  -L. -L/Users/parfenov/.rvm/rubies/ruby-1.9.3-p551/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L.  -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib      -lruby.1.9.1  -lpthread -ldl -lobjc "
conftest.c: In function 't':
conftest.c:6:1: warning: implicit declaration of function 'splice' [-Wimplicit-function-declaration]
 int t() { splice(); return 0; }
 ^
Undefined symbols for architecture x86_64:
  "_splice", referenced from:
      _t in cc2dFoEe.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <fcntl.h>
 4: 
 5: /*top*/
 6: int t() { splice(); return 0; }
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     printf("%p", &t);
11:   }
12: 
13:   return 0;
14: }
/* end */

--------------------

红宝石 1.9.3

【问题讨论】:

标签: c++ ruby-on-rails ruby macos gem


【解决方案1】:

spliceLinux-only。还解释了herehere

【讨论】:

  • 以及如何欺骗rails,让他们认为这个宝石在那里,但实际上它不是?已成功捆绑
猜你喜欢
  • 2016-01-03
  • 2016-02-13
  • 2016-12-27
  • 1970-01-01
  • 2015-12-29
  • 2016-01-05
  • 2016-11-20
  • 1970-01-01
相关资源
最近更新 更多