0

我正在尝试安装 nmatrix gem。我安装了 gcc 编译器:

C:\dev\DNA>gcc --version
gcc (GCC) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.

然后我在安装时出现以下错误:

C:\dev\DNA>gem install nmatrix
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing nmatrix:
    ERROR: Failed to build gem native extension.

C:/Ruby21/bin/ruby.exe extconf.rb
using C++ standard... c++11
g++ reports version... 4.7.2
checking for rb_array_const_ptr() in ruby.h... no
checking for FIX_CONST_VALUE_PTR in ruby.h... no
checking for RARRAY_CONST_PTR in ruby.h... yes
checking for RARRAY_AREF in ruby.h... yes
creating nmatrix_config.h
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
generating nmatrix-i386-mingw32.def
compiling nmatrix.cpp
In file included from ./storage/storage.h:48:0,
             from util/io.h:38,
             from nmatrix.cpp:46:
./storage/common.h:155:3: error: 'u_int8_t' has not been declared
./storage/common.h:157:3: error: redefinition of 'VALUE       nm::ew_op_switch(LDType,
 RDType) [with nm::ewop_t op = (nm::ewop_t)3u; LDType = signed char; RDType    = in
t; VALUE = long unsigned int]'
./storage/common.h:155:3: error: 'VALUE nm::ew_op_switch(LDType, RDType)    [with n
m::ewop_t op = (nm::ewop_t)3u; LDType = signed char; RDType = int; VALUE =   long
unsigned int]' previously declared here
./storage/common.h:165:3: error: 'u_int8_t' has not been declared
 ./storage/common.h:167:3: error: redefinition of 'VALUE    nm::ew_op_switch(LDType,
 RDType) [with nm::ewop_t op = (nm::ewop_t)3u; LDType = float; RDType = int;   VAL
 UE = long unsigned int]'
 ./storage/common.h:165:3: error: 'VALUE nm::ew_op_switch(LDType, RDType) [with n
 m::ewop_t op = (nm::ewop_t)3u; LDType = float; RDType = int; VALUE = long unsign
 ed int]' previously declared here
 ./storage/common.h:170:3: error: 'u_int8_t' has not been declared
 ./storage/common.h:172:3: error: redefinition of 'VALUE    nm::ew_op_switch(LDType,
 RDType) [with nm::ewop_t op = (nm::ewop_t)3u; LDType = double; RDType =   int; VA
 LUE = long unsigned int]'
 ./storage/common.h:170:3: error: 'VALUE nm::ew_op_switch(LDType, RDType) [with n
m::ewop_t op = (nm::ewop_t)3u; LDType = double; RDType = int; VALUE = long   unsig
   ned int]' previously declared here
In file included from nmatrix.cpp:283:0:
ruby_nmatrix.c: In function 'VALUE nm_reshape_bang(VALUE, VALUE)':
ruby_nmatrix.c:1102:11: warning: unused variable 'elem' [-Wunused-variable]
ruby_nmatrix.c: In function 'VALUE nm_mset(int, VALUE*, VALUE)':
ruby_nmatrix.c:2013:109: warning: format '%lu' expects argument of type 'long un
signed int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat]
ruby_nmatrix.c: In function 'VALUE nm_xslice(int, VALUE*, void* (*)(const   STORAG
E*, SLICE*), void (*)(NMATRIX*), VALUE)':
ruby_nmatrix.c:2251:92: warning: format '%lu' expects argument of type 'long uns
igned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat]
ruby_nmatrix.c: In function 'SLICE* get_slice(size_t, int, VALUE*, size_t*)':
ruby_nmatrix.c:2729:106: warning: format '%lu' expects argument of type 'long un
signed int', but argument 3 has type 'size_t {aka unsigned int}' [-Wformat]
ruby_nmatrix.c:2729:106: warning: format '%lu' expects argument of type 'long un
signed int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat]
ruby_nmatrix.c: In function 'void* interpret_initial_value(VALUE, nm::dtype_t)':

ruby_nmatrix.c:2800:29: warning: comparison between signed and unsigned   integer
expressions [-Wsign-compare]
make: *** [nmatrix.o] Error 1

make failed, exit code 2

Gem files will remain installed in     C:/Ruby21/lib/ruby/gems/2.1.0/gems/nmatrix-0.
2.1 for inspection.
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/nma
trix-0.2.1/gem_make.out

试试这个图书馆真的很棒!任何想法如何使安装成功?谢谢

4

0 回答 0