NArray install fail with DevKit on Win

Hi All

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

C:\>ruby --version
ruby 1.9.2p180 (2011-02-18) [i386-mingw32]

C:\>gem --version
1.6.2

C:\>

···

--
Posted via http://www.ruby-forum.com/.

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>ruby --version
ruby 1.9.2p180 (2011-02-18 revision 30907) [i386-mingw32]

C:\Users\Jon\Downloads\temp>gem --version
1.6.2

C:\Users\Jon\Downloads\temp>gem fetch narray
Fetching: narray-0.5.9.9.gem (100%)
Downloaded narray-0.5.9.9

C:\Users\Jon\Downloads\temp>gem unpack narray-0.5.9.9.gem
Unpacked gem: 'C:/Users/Jon/Downloads/temp/narray-0.5.9.9'

C:\Users\Jon\Downloads\temp>cd narray-0.5.9.9

# comment out the following lines in src\extconf.rb

C:\Users\Jon\Downloads\temp\narray-0.5.9.9>gem spec
..\narray-0.5.9.9.gem > narray.gemspec

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

C:\Users\Jon\Documents>irb
irb(main):001:0> require 'narray_ext'
=> true
irb(main):002:0> require 'narray'
=> true
irb(main):003:0> $LOADED_FEATURES.select {|i| i =~ /n(array|matrix)/}
=> ["C:/ruby192/lib/ruby/gems/1.9.1/gems/narray-0.5.9.9/nmatrix.rb",
"C:/ruby192/lib/ruby/gems/1.9.1/gems/narray-0.5.9.9/narray_ext.rb",
"C:/ruby192/lib/ruby/gems/1.9.1/gems/narray-0.5.9.9/narray.so"]

···

--
Posted via http://www.ruby-forum.com/\.

Hi,

I want to have a global unique Logger object.

Is there any other way than having an inherited class with the singleton mixin ?

require 'logger'
require 'singleton'

module Utils
  class ApplicationLogger < Logger
    include Singleton
    
    def initialize
      
      super(STDOUT)
      
    end
    
  end
end

Jon Forums wrote in post #989207:

# comment out the following lines in src\extconf.rb
narray/extconf.rb at master · masa16/narray · GitHub

Jon,
this worked like a charm!
Thanks alot!

Chris

···

--
Posted via http://www.ruby-forum.com/\.

Chris Lervag wrote in post #989743:

Jon Forums wrote in post #989207:

# comment out the following lines in src\extconf.rb
https://github.com/masa16/narray/blob/master/extconf.rb#L55-66

Jon,
this worked like a charm!
Thanks alot!

Chris

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?

Thanks,
Armin

···

--
Posted via http://www.ruby-forum.com/\.

Armin Armbruster wrote in post #1018513:

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:

···

--
Luis Lavena

--
Posted via http://www.ruby-forum.com/\.

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).

Thanks,
Armin

====================================
gcc -shared -s -o rb_gsl.so alf.o array.o array_complex.o blas.o blas1.o
blas2.o blas3.o block.o bspline.o bundle.o cdf.
o cheb.o combination.o common.o complex.o const.o const_additional.o
cqp.o deriv.o dht.o diff.o dirac.o eigen.o error.o
fcmp.o fft.o fit.o fresnel.o function.o geometry.o graph.o gsl.o
gsl_narray.o histogram.o histogram2d.o histogram3d.o hi
stogram3d_source.o histogram_find.o histogram_oper.o ieee.o
integration.o interp.o jacobi.o linalg.o linalg_complex.o ma
th.o matrix.o matrix_complex.o matrix_double.o matrix_int.o min.o
monte.o multifit.o multimin.o multimin_fsdf.o multiroo
ts.o multiset.o ndlinear.o nmf.o nmf_wrap.o ntuple.o odeiv.o ool.o
oper_complex_source.o permutation.o poly.o poly2.o qr
ng.o randist.o rational.o rng.o root.o sf.o sf_airy.o sf_bessel.o
sf_clausen.o sf_coulomb.o sf_coupling.o sf_dawson.o sf
_debye.o sf_dilog.o sf_elementary.o sf_ellint.o sf_elljac.o sf_erfc.o
sf_exp.o sf_expint.o sf_fermi_dirac.o sf_gamma.o s
f_gegenbauer.o sf_hyperg.o sf_laguerre.o sf_lambert.o sf_legendre.o
sf_log.o sf_mathieu.o sf_power.o sf_psi.o sf_synchro
tron.o sf_transport.o sf_trigonometric.o sf_zeta.o signal.o siman.o
sort.o spline.o stats.o sum.o tamu_anova.o tensor.o
vector.o vector_complex.o vector_double.o vector_int.o wavelet.o -L.
-LC:/Ruby192/lib -LC:/Ruby192/lib/ruby/site_ruby/1.
9.1/i386-msvcrt -L.
-LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\tk\\lib
-LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\tcl\\lib
-LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\libyaml\\lib

-LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\pdcurses\\lib

-LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\openssl\\lib
-LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\zlib\\lib
-LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\iconv\\lib
-LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\gdbm\\lib
-LC:\\Users\\Luis\\Projects\\oss\\oneclick\\rubyinstaller\\sandbox\\
libffi\\lib -Wl,--enable-auto-image-base,--enable-auto-import
rb_gsl-i386-mingw32.def -L/c/gsl-1.14/lib -lgsl -lgslcbla
s -lm -lmsvcrt-ruby191 -lshell32 -lws2_32

Seems that rbconfig.rb is keeping all the PATH options used as LDFLAGS
when building Ruby itself.

I've create an issue to resolve at RubyInstaller:

Thank you.

···

--
Luis Lavena

--
Posted via http://www.ruby-forum.com/\.