0

I am trying to install the nmatrix gem. i have the gcc compiler installed:

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

then I have the following error on install:

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

Would be really great to try out this library! Any ideas how to make the install succesful? thanks

Thrabbit
  • 193
  • 2
  • 12
  • Hi @Thrabbit. There's a pull request in right now for fixing Windows compilation. In short, you might try checking out this person's branch: https://github.com/SciRuby/nmatrix/pull/494. We'll try to get it merged ASAP and release a new gem version. – Translunar Apr 04 '16 at 15:19
  • @Dr.JohnnyMohawk. Thanks, looking forward to the merge – Thrabbit Apr 04 '16 at 21:21
  • Okay, we've merged the patch, but we can't do a release yet for various reasons. I suggest cloning from github and installing the gem that way instead for now. – Translunar Apr 06 '16 at 14:42
  • @Dr.JohnnyMohawk. Hello, using the gem specific_install, i am running the command: gem specific_install -l https://github.com/SciRuby/nmatrix.git , this installs the gem but the error shows up exactly same as before (starting with 'u_int8_int' has not been declared). Am I cloning from the wrong source? thanks again. – Thrabbit Apr 06 '16 at 17:54
  • I've never used `specific_install`. I usually just do a `git clone`, then cd into the directory and do `bundle exec rake -T` for a list of rake tasks you can run (which include installing). – Translunar Apr 06 '16 at 19:36
  • @Dr.JohnnyMohawk. The compilation did work the way you suggested. Thanks – Thrabbit Apr 07 '16 at 16:05
  • @Dr.JohnnyMohawk. UPDATE. Compilation works fine, but when I try to use the gem, I get in the console: C:/Ruby21/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/depend encies.rb:247:in `require': 126: The specified module could not be found. - C: /Ruby21/lib/ruby/gems/2.1.0/bundler/gems/extensions/x86-mingw32/2.1.0/nmatrix-92 da6e583808/nmatrix.so (LoadError) ****** Any ideas how this can be fixed? thx – Thrabbit Apr 07 '16 at 19:07
  • Why don't you open an issue in the tracker and include all the steps you've taken? This will make it easier for people to help you. – Translunar Apr 07 '16 at 20:20

0 Answers0