I just attempted to install NArray on Ruby 1.9.2 on Win XP with DevKit
installed. It seems like the devkit installed successfully (I was able
to run the RDiscount test displayed on the devkit wiki).
Attempting to install narray however failed (pasting the command prompt
output below). When it comes to compiling Im basically lost as to
interpret what's going on, so if someone could bring some insight as to
what is happening here that would be appreciated. I guess it would be
nice to know if it is either something wrong with the narray gem or if
it is related to either my ruby/devkit install or if Im missing some
required libraries or whatever.
Thanks,
Chris
C:\>gem install narray --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing narray:
ERROR: Failed to build gem native extension.
C:/Ruby/bin/ruby.exe extconf.rb
checking for stdint.h... yes
checking for u_int8_t... no
checking for uint8_t... yes
checking for int16_t... yes
checking for int32_t... yes
checking for u_int32_t... no
checking for uint32_t... yes
creating narray_config.h
creating Makefile
make
Makefile:180: warning: overriding commands for target
`C:/Ruby/lib/ruby/gems/1.9
.1/gems/narray-0.5.9.9/.'
Makefile:178: warning: ignoring old commands for target
`C:/Ruby/lib/ruby/gems/1
.9.1/gems/narray-0.5.9.9/.'
gcc -I. -IC:/Ruby/include/ruby-1.9.1/i386-mingw32
-I/C/Ruby/include/ruby-1.9.1/r
uby/backward -I/C/Ruby/include/ruby-1.9.1 -I. -DHAVE_STDINT_H
-DHAVE_UINT8_T -DH
AVE_INT16_T -DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra
-Wno-unused-paramet
er -Wno-parentheses -Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializ
ers -Wno-long-long -o narray.o -c narray.c
narray.c: In function 'na_inspect':
narray.c:784:15: warning: initialization discards qualifiers from
pointer target
type
narray.c:785:15: warning: initialization discards qualifiers from
pointer target
type
gcc -I. -IC:/Ruby/include/ruby-1.9.1/i386-mingw32
-I/C/Ruby/include/ruby-1.9.1/r
uby/backward -I/C/Ruby/include/ruby-1.9.1 -I. -DHAVE_STDINT_H
-DHAVE_UINT8_T -DH
AVE_INT16_T -DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra
-Wno-unused-paramet
er -Wno-parentheses -Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializ
ers -Wno-long-long -o na_array.o -c na_array.c
gcc -I. -IC:/Ruby/include/ruby-1.9.1/i386-mingw32
-I/C/Ruby/include/ruby-1.9.1/r
uby/backward -I/C/Ruby/include/ruby-1.9.1 -I. -DHAVE_STDINT_H
-DHAVE_UINT8_T -DH
AVE_INT16_T -DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra
-Wno-unused-paramet
er -Wno-parentheses -Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializ
ers -Wno-long-long -o na_func.o -c na_func.c
gcc -I. -IC:/Ruby/include/ruby-1.9.1/i386-mingw32
-I/C/Ruby/include/ruby-1.9.1/r
uby/backward -I/C/Ruby/include/ruby-1.9.1 -I. -DHAVE_STDINT_H
-DHAVE_UINT8_T -DH
AVE_INT16_T -DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra
-Wno-unused-paramet
er -Wno-parentheses -Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializ
ers -Wno-long-long -o na_index.o -c na_index.c
gcc -I. -IC:/Ruby/include/ruby-1.9.1/i386-mingw32
-I/C/Ruby/include/ruby-1.9.1/r
uby/backward -I/C/Ruby/include/ruby-1.9.1 -I. -DHAVE_STDINT_H
-DHAVE_UINT8_T -DH
AVE_INT16_T -DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra
-Wno-unused-paramet
er -Wno-parentheses -Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializ
ers -Wno-long-long -o na_random.o -c na_random.c
na_random.c: In function 'RndI':
na_random.c:288:18: warning: comparison between signed and unsigned
integer expr
essions
na_random.c: In function 'RndL':
na_random.c:315:18: warning: comparison between signed and unsigned
integer expr
essions
C:/Ruby/bin/ruby -I. ./mkop.rb
gcc -I. -IC:/Ruby/include/ruby-1.9.1/i386-mingw32
-I/C/Ruby/include/ruby-1.9.1/r
uby/backward -I/C/Ruby/include/ruby-1.9.1 -I. -DHAVE_STDINT_H
-DHAVE_UINT8_T -DH
AVE_INT16_T -DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra
-Wno-unused-paramet
er -Wno-parentheses -Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializ
ers -Wno-long-long -o na_op.o -c na_op.c
C:/Ruby/bin/ruby -I. ./mkmath.rb
gcc -I. -IC:/Ruby/include/ruby-1.9.1/i386-mingw32
-I/C/Ruby/include/ruby-1.9.1/r
uby/backward -I/C/Ruby/include/ruby-1.9.1 -I. -DHAVE_STDINT_H
-DHAVE_UINT8_T -DH
AVE_INT16_T -DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra
-Wno-unused-paramet
er -Wno-parentheses -Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializ
ers -Wno-long-long -o na_math.o -c na_math.c
gcc -I. -IC:/Ruby/include/ruby-1.9.1/i386-mingw32
-I/C/Ruby/include/ruby-1.9.1/r
uby/backward -I/C/Ruby/include/ruby-1.9.1 -I. -DHAVE_STDINT_H
-DHAVE_UINT8_T -DH
AVE_INT16_T -DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra
-Wno-unused-paramet
er -Wno-parentheses -Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializ
ers -Wno-long-long -o na_linalg.o -c na_linalg.c
na_linalg.c: In function 'Init_na_linalg':
na_linalg.c:577:13: warning: comparison between signed and unsigned
integer expr
essions
na_linalg.c:577:32: warning: signed and unsigned type in conditional
expression
gcc -shared -s -o narray.so narray.o na_array.o na_func.o na_index.o
na_random.o
na_op.o na_math.o na_linalg.o -L. -LC:/Ruby/lib -L.
-Wl,--enable-auto-image-ba
se,--enable-auto-import ./narray.def,--out-implib=libnarray.a
-lmsvcrt-ruby191
-lshell32 -lws2_32
gcc.exe: ./narray.def,--out-implib=libnarray.a: No such file or
directory
make: *** [narray.so] Error 1
Gem files will remain installed in
C:/Ruby/lib/ruby/gems/1.9.1/gems/narray-0.5.9
.9 for inspection.
Results logged to
C:/Ruby/lib/ruby/gems/1.9.1/gems/narray-0.5.9.9/src/gem_make.o
ut
Attempting to install narray however failed (pasting the command prompt
output below). When it comes to compiling Im basically lost as to
interpret what's going on, so if someone could bring some insight as to
what is happening here that would be appreciated. I guess it would be
nice to know if it is either something wrong with the narray gem or if
it is related to either my ruby/devkit install or if Im missing some
required libraries or whatever.
See if this at least allows you to build and install it:
C:\Users\Jon\Downloads\temp\narray-0.5.9.9>gem build narray.gemspec
WARNING: no description specified
Successfully built RubyGem
Name: narray
Version: 0.5.9.9
File: narray-0.5.9.9.gem
C:\Users\Jon\Downloads\temp\narray-0.5.9.9>gem install
narray-0.5.9.9.gem
Building native extensions. This could take a while...
Successfully installed narray-0.5.9.9
1 gem installed
I just ran into the same problem and Jon's suggested work-around worked
for me as well. Thanks Jon.
I'm wondering if this could be corrected in the gem directly?
Also, I'm confused about the available gems:
*** REMOTE GEMS ***
narray (0.5.9.9, 0.5.9.7 x86-mingw32)
narray-ruby19 (0.5.9.7 x86-mingw32)
What's the difference between narray and narray-ruby19? Obviously narray
has a more recent update. For Ruby 1.9.2 are we supposed to use
narray-ruby19 or is narray (0.5.9.9) supposed to work for both Ruby 1.9
and 1.8?
I'm wondering if this could be corrected in the gem directly?
You should ask the gem author to release a newer version that corrects
the issue.
Also, I'm confused about the available gems:
*** REMOTE GEMS ***
narray (0.5.9.9, 0.5.9.7 x86-mingw32)
narray-ruby19 (0.5.9.7 x86-mingw32)
What's the difference between narray and narray-ruby19? Obviously narray
has a more recent update. For Ruby 1.9.2 are we supposed to use
narray-ruby19 or is narray (0.5.9.9) supposed to work for both Ruby 1.9
and 1.8?
narray x86-mingw32 gem includes binaries for Ruby 1.8.x
narray-ruby19 x86-mingw32 includes binaries for Ruby 1.9.x
Back in 2009, there was no mechanism or technique to bundle both
binaries in the same package.
Nowdays, depending on the complexity of the code, both could be merged
into a single one using the "fat binaries" approach.
You should be able to reach the author on his GitHub repository (using
GitHub issues)
You can suggest the usage of rake-compiler to achieve these fat
binaries:
In reply to Armin Armbruster sent as personal message:
Hi Luis,
thanks for your suggestions regarding the narray gem, and thanks for all
your work with rubyinstaller and devkit.
One comment:
I noticed that during linking, there are a lot of paths added that seem
to be coming from your local machine. I don't think it causes any
problems, but it still might be worthwhile checking (see below).