簡體   English   中英

io_splice用於OSX EL Capitan錯誤

[英]io_splice for OSX EL Capitan error

我正在嘗試在OS X中安裝gem。 我認為問題出在文件與С的連接級別。

需要'mkmf'

$ CPPFLAGS <<'-D_GNU_SOURCE = 1'

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

have_func('tee',%w(fcntl.h))或中止'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

splice 僅適用於Linux 也在這里這里解釋。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM