io_splice for OSX EL Capitan错误

时间:2015-11-18 14:54:00

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

我正在尝试在OS X中安装gem!我认为问题出在将文件连接到С。

的程度
  

需要'mkmf'

     

$ CPPFLAGS<< '-D_GNU_SOURCE = 1'

     

have_func('splice',%w(fcntl.h))或中止'splice(2)未定义'

     

have_func('tee',%w(fcntl.h))或中止'tee(2)未定义'

     

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 */

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

ruby​​ 1.9.3

1 个答案:

答案 0 :(得分:0)

spliceLinux-only。还解释了herehere