Building ruby/gsl

640 views
Skip to first unread message

Badal

unread,
Dec 16, 2010, 8:24:29 AM12/16/10
to RubyInstaller
Windows XP and ruby 1.9.2. Devkit 4.5.1

I successfully compiled gsl itself.

But trying to install ruby/gsl,
- with 'gem install gsl', it fails directly and strangely saves
sources in gems/narray-0.5.9.9/src, sources which have nothing to do
with the real gem sources !!!
- loading the real sources, and using setup.rb, il fails also, this
time in a regular way.

Has anybody installed ruby/gsl under windows ?
_md

Luis Lavena

unread,
Dec 16, 2010, 8:31:53 AM12/16/10
to rubyin...@googlegroups.com

Please provide complete output you're getting in the console, if not,
is hard for us to deduce what is going on and is will require we try
to replicate all your steps.

Also, look at mkmf.log left in the gem directory.

I'm not familiar with ruby-gsl so can't comment on they gem and what
is doing, so please provide the more details as possible, include
where you installed gsl and if you provided it to the gem installation
process (gem install -- --with-gsl-dir or something like that)

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Badal

unread,
Dec 16, 2010, 9:10:46 AM12/16/10
to RubyInstaller
>>> First try
>>> Console output:

C:\gsl-1.14\rb-gsl-1.14.5>gem install gsl -- --with-gsl-dir=C:
\gsl-1.14
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing gsl:
ERROR: Failed to build gem native extension.

C:/Ruby192/bin/ruby.exe extconf.rb --with-gsl-dir=C:\gsl-1.14
checking for stdint.h... *** 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
--without-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=C:/Ruby192/bin/ruby
C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed
to genera
te an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:834:in `block in
have_header'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in
checking_for'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2
levels) in postp
one'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in
postpone'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:833:in `have_header'
from extconf.rb:87:in `<main>'


Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/
narray-0.
5.9.9 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/narray-0.5.9.9/
src/gem_mak
e.out

>>> In ....\narray-0.5.9.9/src/gem_make.out (strange place), same text.

>>> Second method

C:\gsl-1.14\rb-gsl-1.14.5>C:\Devkit\devkitvars.bat
Adding the DevKit to PATH...

C:\gsl-1.14\rb-gsl-1.14.5>bash
bash-3.1$ ruby setup.rb config
---> lib
---> lib/gsl
<--- lib/gsl
---> lib/ool
<--- lib/ool
<--- lib
---> ext
c:/Ruby192/bin/ruby.exe C:/gsl-1.14/rb-gsl-1.14.5/ext/extconf.rb
checking gsl version... 1.14
checking gsl cflags... -I/usr/local/include
checking for main() in -lcblas... no
checking gsl libs... -L/usr/local/lib -lgsl -lgslcblas -lm
checking for round()... no
checking for rngextra/rngextra.h... no
checking for qrngextra/qrngextra.h... no
checking for ool/ool_version.h... no
checking for tensor/tensor.h... no
checking for jacobi.h... no
checking for gsl/gsl_cqp.h... no
checking for gsl/gsl_multimin_fsdf.h... no
checking for gsl_poly_solve_quartic() in -lgsl... no
checking for gsl_eigen_francis() in -lgsl... no
checking for ndlinear/gsl_multifit_ndlinear.h... no
checking for alf/alf.h... no
checking rb-gsl version...1.14.5
checking ruby version... 1.9.2
checking for graph... no
checking for narray.h... yes
checking for main() in -lnarray... no
checking for tamu_anova/tamu_anova.h... no
checking for main() in -ltamuanova... no
creating Makefile

>>> I understand I have to provide a path to config. How ?

_md

Badal

unread,
Dec 16, 2010, 9:15:25 AM12/16/10
to RubyInstaller
Added :

All these not found files are there in c:\gsl-1.14.
_md

Luis Lavena

unread,
Dec 16, 2010, 9:17:14 AM12/16/10
to rubyin...@googlegroups.com
On Thu, Dec 16, 2010 at 11:10 AM, Badal <mic...@demazure.com> wrote:
>>>> First try
>>>> Console output:
>
> C:\gsl-1.14\rb-gsl-1.14.5>gem install gsl -- --with-gsl-dir=C:
> \gsl-1.14

Do you have configured/compiled gsl in that folder?

This is the output of mkmf.log, and is clearly not finding any library
information.

>>>> I understand I have to provide a path to config. How ?
>

I will recommend you don't use setup.rb, as that will install things
in your site_ruby folder, which will be hard then to track.

The idea is you get things installed thru the gem using the options
that extconf indicates to you:

--with-opt-dir
--without-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=C:/Ruby192/bin/ruby

It is clear it doesn't support --with-gsl-dir, so please try:

--with-opt-dir=C:/gsl-1.14

as long that folder contains the compiled binaries of gsl (include
folder with headers and lib folder with libraries)

Badal

unread,
Dec 16, 2010, 9:37:03 AM12/16/10
to RubyInstaller
> It is clear it doesn't support --with-gsl-dir, so please try:
>
> --with-opt-dir=C:/gsl-1.14
>
Yes ! Now it "works", but complains not finding 'libnarray.a'.

As can be deduced from the strange mkmf.log message, I guess this gem
is a twisted descendant of the 'narray' gem and needs both the gsl
library and the compiled narray : there is 'libnarray.a' in C:
\Ruby192\lib\ruby\gems\1.9.1\gems\narray-ruby19-0.5.9.7-x86-
mingw32\lib.

I think I can solve it myself now. Anyhow, I'll report for the record.

Thanks once more, Luis !

_md

Luis Lavena

unread,
Dec 16, 2010, 9:40:04 AM12/16/10
to rubyin...@googlegroups.com
On Thu, Dec 16, 2010 at 11:37 AM, Badal <mic...@demazure.com> wrote:
>> It is clear it doesn't support --with-gsl-dir, so please try:
>>
>> --with-opt-dir=C:/gsl-1.14
>>
> Yes ! Now it "works", but complains not finding 'libnarray.a'.
>
> As can be deduced from the strange mkmf.log message, I guess this gem
> is a twisted descendant of the 'narray'  gem and needs both the gsl
> library and the compiled narray : there is 'libnarray.a' in C:
> \Ruby192\lib\ruby\gems\1.9.1\gems\narray-ruby19-0.5.9.7-x86-
> mingw32\lib.
>

I think you should approach the gem author and ask about the
requirements, as is not clear looking at the documentation;

http://rb-gsl.rubyforge.org/

What is need. *that* is one of the biggest problems Ruby users on
Windows face. Users in other platforms do find the same, but they just
simply remain silent :P

Badal

unread,
Dec 16, 2010, 10:34:32 AM12/16/10
to RubyInstaller
>
> What is need. *that* is one of the biggest problems Ruby users on
> Windows face. Users in other platforms do find the same, but they just
> simply remain silent :P
>

I posted a bug on rubyforge.

_md

Badal

unread,
Dec 16, 2010, 12:02:32 PM12/16/10
to RubyInstaller

I tried on Ubuntu Lucid with libgsl...-dev: just "gem install gsl" and
it works.
So it's a Windows question. I'll mail to the Japanese author.
_md

Badal

unread,
Dec 16, 2010, 12:03:28 PM12/16/10
to RubyInstaller

Luis Lavena

unread,
Dec 16, 2010, 12:22:03 PM12/16/10
to rubyin...@googlegroups.com
On Thu, Dec 16, 2010 at 2:02 PM, Badal <mic...@demazure.com> wrote:
>
> I tried on Ubuntu Lucid with libgsl...-dev: just "gem install gsl" and
> it works.

As you mention, you installed libgsl :)

Badal

unread,
Dec 19, 2010, 1:33:29 PM12/19/10
to RubyInstaller

State of the problem as of today :

The same thing happens when building 'narray' alone (which is the
first dependency for ruby/gsl), either with 'gem install' or 'setup'.

I am discussing by mail with Yoshiki Tsunesada (ruby/gsl's author) and
will report here if and when solved.

_md

Badal

unread,
Dec 20, 2010, 2:29:16 AM12/20/10
to RubyInstaller


On 16 déc, 18:22, Luis Lavena <luislav...@gmail.com> wrote:
> As you mention, you installed libgsl :)
>
I did install gsl.1-14 with headers.

I double checked with the compiled gsl-dev-win32 from

http://code.google.com/p/oscats/downloads/detail?name=gsl-1.14-dev-win32.zip&can=2&q=

and got the same error in the compilation of narray ::

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 n
a_linalg.o -L. -LC:/Ruby192/lib -Lc:\gsl-1.14-dev/lib -L. -Wl,--
enable-auto-image-base,--enable-aut
o-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

I wait for Yoshiki's answer and will report.
_md
_md

Badal

unread,
Dec 21, 2010, 12:04:42 PM12/21/10
to RubyInstaller
Trying again to install narray :

Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Michel>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:/Ruby192/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:/Ruby192/lib/
ruby/gems/1.9.1/gems/narray-0.5.9.9/.'
Makefile:178: warning: ignoring old commands for target `C:/Ruby192/
lib/ruby/gems/1.9.1/gems/narray-0.5.9.9/.'
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/
include/ruby-1.9.1/ruby/backward -I/C/Ruby192/include/
ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_UINT8_T -DHAVE_INT16_T -
DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra -Wno-unuse
d-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
missing-field-initializers -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:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/
include/ruby-1.9.1/ruby/backward -I/C/Ruby192/include/
ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_UINT8_T -DHAVE_INT16_T -
DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra -Wno-unuse
d-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
missing-field-initializers -Wno-long-long -o na_array
.o -c na_array.c
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/
include/ruby-1.9.1/ruby/backward -I/C/Ruby192/include/
ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_UINT8_T -DHAVE_INT16_T -
DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra -Wno-unuse
d-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
missing-field-initializers -Wno-long-long -o na_func.
o -c na_func.c
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/
include/ruby-1.9.1/ruby/backward -I/C/Ruby192/include/
ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_UINT8_T -DHAVE_INT16_T -
DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra -Wno-unuse
d-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
missing-field-initializers -Wno-long-long -o na_index
.o -c na_index.c
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/
include/ruby-1.9.1/ruby/backward -I/C/Ruby192/include/
ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_UINT8_T -DHAVE_INT16_T -
DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra -Wno-unuse
d-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
missing-field-initializers -Wno-long-long -o na_rando
m.o -c na_random.c
na_random.c: In function 'RndI':
na_random.c:288:18: warning: comparison between signed and unsigned
integer expressions
na_random.c: In function 'RndL':
na_random.c:315:18: warning: comparison between signed and unsigned
integer expressions
C:/Ruby192/bin/ruby -I. ./mkop.rb
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/
include/ruby-1.9.1/ruby/backward -I/C/Ruby192/include/
ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_UINT8_T -DHAVE_INT16_T -
DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra -Wno-unuse
d-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
missing-field-initializers -Wno-long-long -o na_op.o
-c na_op.c
C:/Ruby192/bin/ruby -I. ./mkmath.rb
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/
include/ruby-1.9.1/ruby/backward -I/C/Ruby192/include/
ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_UINT8_T -DHAVE_INT16_T -
DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra -Wno-unuse
d-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
missing-field-initializers -Wno-long-long -o na_math.
o -c na_math.c
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/
include/ruby-1.9.1/ruby/backward -I/C/Ruby192/include/
ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_UINT8_T -DHAVE_INT16_T -
DHAVE_INT32_T -DHAVE_UINT32_T -O3 -g -Wextra -Wno-unuse
d-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
missing-field-initializers -Wno-long-long -o na_linal
g.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 expressions
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:/
Ruby192/lib -L. -Wl,--enable-auto-image-base,--enable-auto-import ./
narray.def,--out-implib=libnarray.a -lmsvcrt-ruby1
91 -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:/Ruby192/lib/ruby/gems/1.9.1/gems/
narray-0.5.9.9 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/narray-0.5.9.9/
src/gem_make.out

------------ "No such file or directory", but content of lib is ----

C:\Ruby192\lib\ruby\gems\1.9.1\gems\narray-0.5.9.9\lib>dir

16/12/2010 16:08 <REP> .
16/12/2010 16:08 <REP> ..
21/11/2010 14:53 88 040 libnarray.a
21/11/2010 14:53 5 130 narray.h
21/11/2010 14:53 147 456 narray.so
21/11/2010 14:53 122 narray_config.h
21/11/2010 14:53 4 804 narray_ext.rb
21/11/2010 14:53 5 468 nmatrix.rb
6 fichier(s) 251 020 octets
2 Rép(s) 79 777 415 168 octets libres

--- Moreover, exactly the same content in the compiled C:\Ruby192\lib
\ruby\gems\1.9.1\gems\narray-ruby19-0.5.9.7-x86-mingw32\lib whixk
works

-------------
gem_make.out is a copy of the console output, but mkmf.log says
something else

------------- mkmf.log begins here --------------

have_header: checking for stdint.h... -------------------- yes

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -O3 -g -Wextra -Wno-unused-parameter -Wno-
parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-
initializers -Wno-long-long conftest.c -L. -LC:/Ruby192/lib -L. -
lmsvcrt-ruby191-static -lshell32 -lws2_32 "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"gcc -E -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/
include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -
I. -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-
arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long
conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <stdint.h>
/* end */

--------------------

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -O3 -g -Wextra -Wno-unused-parameter -Wno-
parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-
initializers -Wno-long-long conftest.c -L. -LC:/Ruby192/lib -L. -
lmsvcrt-ruby191-static -lshell32 -lws2_32 "
conftest.c: In function 't':
conftest.c:8:13: error: 'u_int8_t' undeclared (first use in this
function)
conftest.c:8:13: note: each undeclared identifier is reported only
once for each function it appears in
conftest.c:8:22: error: expected ';' before 'a'
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <ruby.h>
6: #include <stdint.h>
7: int main() { return 0; }
8: int t() { u_int8_t a; return 0; }
/* end */

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -O3 -g -Wextra -Wno-unused-parameter -Wno-
parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-
initializers -Wno-long-long conftest.c -L. -LC:/Ruby192/lib -L. -
lmsvcrt-ruby191-static -lshell32 -lws2_32 "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <ruby.h>
6: #include <stdint.h>
7: int main() { return 0; }
8: int t() { uint8_t a; return 0; }
/* end */

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -O3 -g -Wextra -Wno-unused-parameter -Wno-
parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-
initializers -Wno-long-long conftest.c -L. -LC:/Ruby192/lib -L. -
lmsvcrt-ruby191-static -lshell32 -lws2_32 "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <ruby.h>
6: #include <stdint.h>
7: int main() { return 0; }
8: int t() { int16_t a; return 0; }
/* end */

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -O3 -g -Wextra -Wno-unused-parameter -Wno-
parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-
initializers -Wno-long-long conftest.c -L. -LC:/Ruby192/lib -L. -
lmsvcrt-ruby191-static -lshell32 -lws2_32 "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <ruby.h>
6: #include <stdint.h>
7: int main() { return 0; }
8: int t() { int32_t a; return 0; }
/* end */

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -O3 -g -Wextra -Wno-unused-parameter -Wno-
parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-
initializers -Wno-long-long conftest.c -L. -LC:/Ruby192/lib -L. -
lmsvcrt-ruby191-static -lshell32 -lws2_32 "
conftest.c: In function 't':
conftest.c:8:13: error: 'u_int32_t' undeclared (first use in this
function)
conftest.c:8:13: note: each undeclared identifier is reported only
once for each function it appears in
conftest.c:8:23: error: expected ';' before 'a'
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <ruby.h>
6: #include <stdint.h>
7: int main() { return 0; }
8: int t() { u_int32_t a; return 0; }
/* end */

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -O3 -g -Wextra -Wno-unused-parameter -Wno-
parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-
initializers -Wno-long-long conftest.c -L. -LC:/Ruby192/lib -L. -
lmsvcrt-ruby191-static -lshell32 -lws2_32 "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <ruby.h>
6: #include <stdint.h>
7: int main() { return 0; }
8: int t() { uint32_t a; return 0; }
/* end */

----------- end of mkmf.log

>>>> Is there something useful in the reported error : conftest.c:8:23 error ?

_md

Jon

unread,
Dec 21, 2010, 12:41:01 PM12/21/10
to rubyin...@googlegroups.com
> 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:/
> Ruby192/lib -L. -Wl,--enable-auto-image-base,--enable-auto-import ./
> narray.def,--out-implib=libnarray.a -lmsvcrt-ruby1
> 91 -lshell32 -lws2_32
> gcc.exe: ./narray.def,--out-implib=libnarray.a: No such file or
> directory
> make: *** [narray.so] Error 1

The Makefile generated from extconf.rb appears broken; search in your C:/Ruby192/lib/ruby/gems/1.9.1/gems/narray-0.5.9.9/Makefile for the line starting with 'dldflags'. The source of the problem is in the extconf.rb file, likely in this area https://github.com/masa16/narray/blob/master/extconf.rb#L55-65

FWIW, when I mod the old Makefile's 'dldflags' line to look like

dldflags = -Wl,--enable-auto-image-base,--enable-auto-import,--out-implib=libnarray.a $(DEFFILE)

...and run

\DevKit\devkitvars.bat
make clean
make

...I get

...
compiling na_op.c
compiling na_math.c
compiling na_linalg.c


na_linalg.c: In function 'Init_na_linalg':
na_linalg.c:577:13: warning: comparison between signed and unsigned integer expressions
na_linalg.c:577:32: warning: signed and unsigned type in conditional expression

linking shared-object narray.so
Creating library file: libnarray.a

Badal

unread,
Dec 21, 2010, 1:36:08 PM12/21/10
to RubyInstaller
> The Makefile generated from extconf.rb appears broken; search in your C:/Ruby192/lib/ruby/gems/1.9.1/gems/narray-0.5.9.9/Makefile for the line starting with 'dldflags'.  The source of the problem is in the extconf.rb file, likely in this areahttps://github.com/masa16/narray/blob/master/extconf.rb#L55-65
>
> FWIW, when I mod the old Makefile's 'dldflags' line to look like
>
> dldflags =  -Wl,--enable-auto-image-base,--enable-auto-import,--out-implib=libnarray.a $(DEFFILE)

This is the corresponding line in the source loaded by ruby/gsl :

dldflags = -Wl,--enable-auto-image-base,--enable-auto-import $
(DEFFILE),--out-implib=libnarray.a

When I modify it like you do :

> ...and run
>
> \DevKit\devkitvars.bat
> make clean
> make
>
> ...I get
...
> Creating library file: libnarray.a

Yes, works for me too.

Which means the narray source loaded by ruby/gsl is wrong.

Thanks you very much !!!
_md

Luis Lavena

unread,
Dec 21, 2010, 1:43:18 PM12/21/10
to rubyin...@googlegroups.com
On Tue, Dec 21, 2010 at 3:36 PM, Badal <mic...@demazure.com> wrote:
>
> This is the corresponding line in the source loaded by ruby/gsl :
>
>  dldflags =  -Wl,--enable-auto-image-base,--enable-auto-import $
> (DEFFILE),--out-implib=libnarray.a
>

Can you verify that dldflags is not altered in the extconf.rb? Most of
the times flags are entered there that are affecting extension
generation.

Jon

unread,
Dec 21, 2010, 1:43:51 PM12/21/10
to rubyin...@googlegroups.com
> Yes, works for me too.
>
> Which means the narray source loaded by ruby/gsl is wrong.
>
> Thanks you very much !!!
> _md

Glad the hack worked and I'd urge you to let the gem author know the issue. If you're not comfortable submitting a patch via a pull-request, maybe a quick email pointing back to this thread.

Jon

---
http://jonforums.github.com/

Badal

unread,
Dec 21, 2010, 2:18:22 PM12/21/10
to RubyInstaller


On 21 déc, 19:43, Jon <jon.for...@gmail.com> wrote:
> Glad the hack worked and I'd urge you to let the gem author know the issue. If you're not comfortable submitting a patch via a pull-request, maybe a quick email pointing back to this thread.
>
I wrote to Yoshiki (author of ruby/gsl). I'll wait for his answer and
if necessary report directly to narray's author. I moreover suspect
the plain narray-0.5.9.9 not to be 1.9 compatible, as there exists a
compiled narray-ruby19-0.5.9.7-x86-mingw32.

_md

Badal

unread,
Dec 21, 2010, 2:25:37 PM12/21/10
to RubyInstaller


On 21 déc, 19:43, Luis Lavena <luislav...@gmail.com> wrote:
> Can you verify that dldflags is not altered in the extconf.rb? Most of
> the times flags are entered there that are affecting extension
> generation.
>
Well, that most likely the culprit :

if /cygwin|mingw/ =~ RUBY_PLATFORM
if RUBY_VERSION > '1.8.0'
$DLDFLAGS << ",--out-implib=libnarray.a"
elsif RUBY_VERSION > '1.8'
CONFIG["DLDFLAGS"] << ",--out-implib=libnarray.a"
system("touch libnarray.a")
else
CONFIG["DLDFLAGS"] << " --output-lib libnarray.a"
end
end

This if/elsif similar tests look quite strange (and do produce the
wrong line), but I am not at ease there.
_md

Luis Lavena

unread,
Dec 21, 2010, 2:29:39 PM12/21/10
to rubyin...@googlegroups.com

Seems that narray is not prepared for 1.9, specially 1.9.2, as the
whole DLDFLAGS is a bit different.

sgwong

unread,
Dec 22, 2010, 8:53:36 AM12/22/10
to RubyInstaller
I tried making the changes on the DLDFLAGS and successfully to install
ruby/gsl on my windows with ruby version 1.9.2
running some ruby gls test file without any error and it seems to be
working fine.

this is just 1 of the test...
C:\Ruby192\lib\ruby\gems\1.9.1\gems\gsl-1.14.5\tests>ruby fit.rb
PASS: norris gsl_fit_linear c0 (-0.262323073774026694 observed vs
-0.262323 expected)
PASS: norris gsl_fit_linear c1 (1.00211681802045449 observed vs
1.00212 expected)
PASS: norris gsl_fit_linear cov00 (0.0542043302231074164 observed vs
0.0542043 expected)
PASS: norris gsl_fit_linear cov01 (-7.74327536315658985e-05 observed
vs -7.74328e-05 expected)
PASS: norris gsl_fit_linear cov11 (1.84725330722603265e-07 observed vs
1.84725e-07 expected)
PASS: norris gsl_fit_linear sumsq (26.6173985294228892 observed vs
26.6174 expected)
PASS: norris gsl_fit_wlinear c0 (-0.262323073774026694 observed vs
-0.262323 expected)
PASS: norris gsl_fit_wlinear c1 (1.00211681802045449 observed vs
1.00212 expected)
PASS: norris gsl_fit_wlinear cov00 (0.0692384428759428572 observed vs
0.0692384 expected)
PASS: norris gsl_fit_wlinear cov01 (-9.89095016390515168e-05 observed
vs -9.89095e-05 expected)
PASS: norris gsl_fit_wlinear cov11 (2.35960747164147719e-07 observed
vs 2.35961e-07 expected)
PASS: norris gsl_fit_wlinear sumsq (26.6173985294228892 observed vs
26.6174 expected)
PASS: noint1 gsl_fit_mul c1 (2.07438016528925617 observed vs 2.07438
expected)
PASS: noint1 gsl_fit_mul cov11 (0.000273205382146028252 observed vs
0.000273205 expected)
PASS: noint1 gsl_fit_mul sumsq (127.272727272727266 observed vs
127.273 expected)
PASS: noint1 gsl_fit_wmul c1 (2.07438016528925617 observed vs 2.07438
expected)
PASS: noint1 gsl_fit_wmul cov11 (2.14661371686165065e-05 observed vs
2.14661e-05 expected)
PASS: noint1 gsl_fit_wmul sumsq (127.272727272727266 observed vs
127.273 expected)
PASS: noint2 gsl_fit_mul c1 (0.727272727272727293 observed vs 0.727273
expected)
PASS: noint2 gsl_fit_mul cov11 (0.00177095631641086188 observed vs
0.00177096 expected)
PASS: noint2 gsl_fit_mul sumsq (0.272727272727272707 observed vs
0.272727 expected)
PASS: noint2 gsl_fit_wmul c1 (0.727272727272727293 observed vs
0.727273 expected)
PASS: noint2 gsl_fit_wmul cov11 (0.0129870129870129879 observed vs
0.012987 expected)
PASS: noint2 gsl_fit_wmul sumsq (0.272727272727272707 observed vs
0.272727 expected)

Badal

unread,
Dec 22, 2010, 9:59:22 AM12/22/10
to RubyInstaller
On 22 déc, 14:53, sgwong <sgwong...@gmail.com> wrote:
> I tried making the changes on the DLDFLAGS and successfully to install
> ruby/gsl on my windows with ruby version 1.9.2
> running some ruby gls test file without any error and it seems to be
> working fine.
>
If I understand you well, you loaded ruby/gsl source, ran configure
and changed the DLDFLAGS for ruby/gsl ?
_md

sgwong

unread,
Dec 22, 2010, 11:15:27 AM12/22/10
to RubyInstaller
The proper way should be update the update the extconf.rb and create a
new gem file. But I never create any gem before and lazy to read the
doc to create a new gem. I just do some hacking just to make sure I
able to install the narray gem.
First I create a modified makefile with appropriate changes call
Makefile1 in C:\Ruby192\lib\ruby\gems\1.9.1\gems\narray-0.5.9.9\src
Then I rename the make.exe in devkit to make1.exe and create a batch
file call make.bat with the following content:
"""
del Makefile
copy Makefile1 Makefile
c:\devkit451\bin\make1.exe
"""
Then just run gem install narray in C:\Ruby192\lib\ruby\gems\1.9.1\gems
\narray-0.5.9.9\src
Then it should be able to install narray correctly. After that, undo
the change to make1.exe and install gsl gem.
(at first I tried to modified the Makefile and install it but the gem
command will update the Makefile with extconf.rb from the gem)

Jon

unread,
Dec 22, 2010, 11:24:48 AM12/22/10
to rubyin...@googlegroups.com
> The proper way should be update the update the extconf.rb and create a
> new gem file.

Yes, please provide feedback directly to narray's gem author so that he can update the extconf.rb and push an updated gem to rubygems.org. His email's here https://github.com/masa16

The Makefile hack was nothing more than a quick test and I'd hate to see it be viewed as a fix :)

Jon

---
http://jonforums.github.com/

Badal

unread,
Dec 22, 2010, 3:38:19 PM12/22/10
to RubyInstaller
> Yes, please provide feedback directly to narray's gem author so that he can update the extconf.rb and push an updated gem to rubygems.org. His email's herehttps://github.com/masa16
> Jon

I send a mail to Tanaka, explaining our need, and asking for his help.
_md

sgwong

unread,
Dec 22, 2010, 9:12:26 PM12/22/10
to RubyInstaller
Submitted issue at:
https://github.com/masa16/narray/issues/issue/2

It is up to the developer to update the gem. I don't use narray gem,
just install it for fun.

Regards,
Shin Guey

On Dec 23, 12:24 am, Jon <jon.for...@gmail.com> wrote:
> > The proper way should be update the update the extconf.rb and create a
> > new gem file.
>
> Yes, please provide feedback directly to narray's gem author so that he can update the extconf.rb and push an updated gem to rubygems.org. His email's herehttps://github.com/masa16

Badal

unread,
Dec 24, 2010, 11:01:30 AM12/24/10
to RubyInstaller
I sent this before. Maybe a server problem ?
Apologies if it appear twice...

I am still trying to install ruby/gsl
Please do not hesitate to tell me you are fed up with it.
_md

>>>>>>>>>>>>>>> console log >>>>>>>>>>>>>>>


Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Michel>path=c:\gsl-1.14;%path%

C:\Documents and Settings\Michel>bash which gsl-config
/c/gsl-1.14/gsl-config

C:\Documents and Settings\Michel>gem install gsl
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing gsl:
ERROR: Failed to build gem native extension.

C:/Ruby192/bin/ruby.exe extconf.rb
checking gsl version... 1.14
checking gsl cflags... -I/usr/local/include
checking for main() in -lcblas... no
checking gsl libs... -L/usr/local/lib -lgsl -lgslcblas -lm
checking for round()... no
checking for rngextra/rngextra.h... no
checking for qrngextra/qrngextra.h... no
checking for ool/ool_version.h... no
checking for tensor/tensor.h... no
checking for jacobi.h... no
checking for gsl/gsl_cqp.h... no
checking for gsl/gsl_multimin_fsdf.h... no
checking for gsl_poly_solve_quartic() in -lgsl... no
checking for gsl_eigen_francis() in -lgsl... no
checking for ndlinear/gsl_multifit_ndlinear.h... no
checking for alf/alf.h... no
checking rb-gsl version...1.14.5
checking ruby version... 1.9.2
checking for graph... no
checking for narray.h... yes
checking for main() in -lnarray... no
checking for tamu_anova/tamu_anova.h... no
checking for main() in -ltamuanova... no
creating Makefile

make
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/
include/ruby-1.9.1/ruby/backward -I/C/Ruby192/include/
ruby-1.9.1 -I. -DHAVE_NARRAY_H -IC:/Ruby192/lib/ruby/gems/1.9.1/gems/
narray-ruby19-0.5.9.7-x86-mingw32/lib -IC:/Ruby192
/lib/ruby/site_ruby/1.9.1/i386-msvcrt -Wall -I../include -I/usr/
local/include -o alf.o -c alf.c
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/
include/ruby-1.9.1/ruby/backward -I/C/Ruby192/include/
ruby-1.9.1 -I. -DHAVE_NARRAY_H -IC:/Ruby192/lib/ruby/gems/1.9.1/gems/
narray-ruby19-0.5.9.7-x86-mingw32/lib -IC:/Ruby192
/lib/ruby/site_ruby/1.9.1/i386-msvcrt -Wall -I../include -I/usr/
local/include -o array.o -c array.c
In file included from array.c:14:0:
../include/rb_gsl_common.h:18:27: fatal error: gsl/gsl_errno.h: No
such file or directory
compilation terminated.
make: *** [array.o] Error 1


Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/
gsl-1.14.5 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/gsl-1.14.5/ext/
gem_make.out

>>>>>>>>>> But gsl/gsl_errno.h is there OK :

C:\Documents and Settings\Michel>dir c:\gsl-1.14\gsl\gsl_errno.h
Le volume dans le lecteur C s'appelle WINDOWS
Le numéro de série du volume est 44A7-46E2

Répertoire de c:\gsl-1.14\gsl

10/03/2010 11:57 5 965 gsl_errno.h
1 fichier(s) 5 965 octets
0 Rép(s) 79 500 730 368 octets libres

>>>>>>>>>> seg_make_out is a copy of tyhe abover log>.
>>>>>>>>>> content of mkmf.log

have_library: checking for main() in -lcblas... --------------------
no

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -Wall -I../include -I/usr/local/include
conftest.c -L. -LC:/Ruby192/lib -L. -lmsvcrt-ruby191-static -
lshell32 -lws2_32 "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -Wall -I../include -I/usr/local/include
conftest.c -L. -LC:/Ruby192/lib -L. -lmsvcrt-ruby191-static -
lcblas -lshell32 -lws2_32 "
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lcblas
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: int main() {return 0;}
8: int t() { void ((*volatile p)()); p = (void ((*)()))main; return
0; }
/* end */

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -Wall -I../include -I/usr/local/include
conftest.c -L. -LC:/Ruby192/lib -L. -lmsvcrt-ruby191-static -
lcblas -lshell32 -lws2_32 "
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lcblas
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: int main() {return 0;}
8: int t() { main(); return 0; }
/* end */

--------------------

have_func: checking for round()... -------------------- no

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -Wall -I../include -I/usr/local/include
conftest.c -L. -LC:/Ruby192/lib -L. -L/usr/local/lib -lgsl -
lgslcblas -lm -lmsvcrt-ruby191-static -lshell32 -lws2_32 "
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgsl
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgslcblas
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: int main() {return 0;}
8: int t() { void ((*volatile p)()); p = (void ((*)()))round; return
0; }
/* end */

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -Wall -I../include -I/usr/local/include
conftest.c -L. -LC:/Ruby192/lib -L. -L/usr/local/lib -lgsl -
lgslcblas -lm -lmsvcrt-ruby191-static -lshell32 -lws2_32 "
conftest.c: In function 't':
conftest.c:8:1: error: too few arguments to function 'round'
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: int main() {return 0;}
8: int t() { round(); return 0; }
/* end */

--------------------

have_header: checking for rngextra/rngextra.h... --------------------
no

"gcc -E -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/
include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -
I. -Wall -I../include -I/usr/local/include conftest.c -o
conftest.i"
conftest.c:5:31: fatal error: rngextra/rngextra.h: No such file or
directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <rngextra/rngextra.h>
/* end */

--------------------

have_header: checking for qrngextra/qrngextra.h...
-------------------- no

"gcc -E -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/
include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -
I. -Wall -I../include -I/usr/local/include conftest.c -o
conftest.i"
conftest.c:5:33: fatal error: qrngextra/qrngextra.h: No such file or
directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <qrngextra/qrngextra.h>
/* end */

--------------------

have_header: checking for ool/ool_version.h... -------------------- no

"gcc -E -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/
include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -
I. -Wall -I../include -I/usr/local/include conftest.c -o
conftest.i"
conftest.c:5:29: fatal error: ool/ool_version.h: No such file or
directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <ool/ool_version.h>
/* end */

--------------------

have_header: checking for tensor/tensor.h... -------------------- no

"gcc -E -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/
include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -
I. -Wall -I../include -I/usr/local/include conftest.c -o
conftest.i"
conftest.c:5:27: fatal error: tensor/tensor.h: No such file or
directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <tensor/tensor.h>
/* end */

--------------------

have_header: checking for jacobi.h... -------------------- no

"gcc -E -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/
include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -
I. -Wall -I../include -I/usr/local/include conftest.c -o
conftest.i"
conftest.c:5:20: fatal error: jacobi.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <jacobi.h>
/* end */

--------------------

have_header: checking for gsl/gsl_cqp.h... -------------------- no

"gcc -E -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/
include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -
I. -Wall -I../include -I/usr/local/include conftest.c -o
conftest.i"
conftest.c:5:25: fatal error: gsl/gsl_cqp.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <gsl/gsl_cqp.h>
/* end */

--------------------

have_header: checking for gsl/gsl_multimin_fsdf.h...
-------------------- no

"gcc -E -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/
include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -
I. -Wall -I../include -I/usr/local/include conftest.c -o
conftest.i"
conftest.c:5:35: fatal error: gsl/gsl_multimin_fsdf.h: No such file or
directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <gsl/gsl_multimin_fsdf.h>
/* end */

--------------------

have_library: checking for gsl_poly_solve_quartic() in -lgsl...
-------------------- no

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -Wall -I../include -I/usr/local/include
conftest.c -L. -LC:/Ruby192/lib -L. -L/usr/local/lib -lgsl -
lgslcblas -lm -lmsvcrt-ruby191-static -lgsl -lshell32 -lws2_32 "
conftest.c: In function 't':
conftest.c:8:53: error: 'gsl_poly_solve_quartic' undeclared (first use
in this function)
conftest.c:8:53: note: each undeclared identifier is reported only
once for each function it appears in
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: int main() {return 0;}
8: int t() { void ((*volatile p)()); p = (void ((*)
()))gsl_poly_solve_quartic; return 0; }
/* end */

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -Wall -I../include -I/usr/local/include
conftest.c -L. -LC:/Ruby192/lib -L. -L/usr/local/lib -lgsl -
lgslcblas -lm -lmsvcrt-ruby191-static -lgsl -lshell32 -lws2_32 "
conftest.c: In function 't':
conftest.c:8:1: warning: implicit declaration of function
'gsl_poly_solve_quartic'
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgsl
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgslcblas
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgsl
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: int main() {return 0;}
8: int t() { gsl_poly_solve_quartic(); return 0; }
/* end */

--------------------

have_library: checking for gsl_eigen_francis() in -lgsl...
-------------------- no

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -Wall -I../include -I/usr/local/include
conftest.c -L. -LC:/Ruby192/lib -L. -L/usr/local/lib -lgsl -
lgslcblas -lm -lmsvcrt-ruby191-static -lgsl -lshell32 -lws2_32 "
conftest.c: In function 't':
conftest.c:8:53: error: 'gsl_eigen_francis' undeclared (first use in
this function)
conftest.c:8:53: note: each undeclared identifier is reported only
once for each function it appears in
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: int main() {return 0;}
8: int t() { void ((*volatile p)()); p = (void ((*)
()))gsl_eigen_francis; return 0; }
/* end */

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -Wall -I../include -I/usr/local/include
conftest.c -L. -LC:/Ruby192/lib -L. -L/usr/local/lib -lgsl -
lgslcblas -lm -lmsvcrt-ruby191-static -lgsl -lshell32 -lws2_32 "
conftest.c: In function 't':
conftest.c:8:1: warning: implicit declaration of function
'gsl_eigen_francis'
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgsl
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgslcblas
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgsl
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: int main() {return 0;}
8: int t() { gsl_eigen_francis(); return 0; }
/* end */

--------------------

have_header: checking for ndlinear/gsl_multifit_ndlinear.h...
-------------------- no

"gcc -E -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/
include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -
I. -Wall -I../include -I/usr/local/include conftest.c -o
conftest.i"
conftest.c:5:44: fatal error: ndlinear/gsl_multifit_ndlinear.h: No
such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <ndlinear/gsl_multifit_ndlinear.h>
/* end */

--------------------

have_header: checking for alf/alf.h... -------------------- no

"gcc -E -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/
include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -
I. -Wall -I../include -I/usr/local/include conftest.c -o
conftest.i"
conftest.c:5:21: fatal error: alf/alf.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <alf/alf.h>
/* end */

--------------------

find_executable: checking for graph... -------------------- no

--------------------

have_header: checking for narray.h... -------------------- yes

"gcc -E -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/
include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -I. -
IC:/Ruby192/lib/ruby/gems/1.9.1/gems/narray-ruby19-0.5.9.7-x86-mingw32/
lib -IC:/Ruby192/lib/ruby/site_ruby/1.9.1/i386-msvcrt -Wall -I../
include -I/usr/local/include conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <narray.h>
/* end */

--------------------

have_library: checking for main() in -lnarray... --------------------
no

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -IC:/Ruby192/lib/ruby/gems/1.9.1/gems/narray-
ruby19-0.5.9.7-x86-mingw32/lib -IC:/Ruby192/lib/ruby/site_ruby/1.9.1/
i386-msvcrt -Wall -I../include -I/usr/local/include conftest.c -
L. -LC:/Ruby192/lib -LC:/Ruby192/lib/ruby/site_ruby/1.9.1/i386-msvcrt -
L. -L/usr/local/lib -lgsl -lgslcblas -lm -lmsvcrt-ruby191-static -
lnarray -lshell32 -lws2_32 "
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgsl
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgslcblas
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lnarray
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: int main() {return 0;}
8: int t() { void ((*volatile p)()); p = (void ((*)()))main; return
0; }
/* end */

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -IC:/Ruby192/lib/ruby/gems/1.9.1/gems/narray-
ruby19-0.5.9.7-x86-mingw32/lib -IC:/Ruby192/lib/ruby/site_ruby/1.9.1/
i386-msvcrt -Wall -I../include -I/usr/local/include conftest.c -
L. -LC:/Ruby192/lib -LC:/Ruby192/lib/ruby/site_ruby/1.9.1/i386-msvcrt -
L. -L/usr/local/lib -lgsl -lgslcblas -lm -lmsvcrt-ruby191-static -
lnarray -lshell32 -lws2_32 "
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgsl
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgslcblas
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lnarray
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: int main() {return 0;}
8: int t() { main(); return 0; }
/* end */

--------------------

have_header: checking for tamu_anova/tamu_anova.h...
-------------------- no

"gcc -E -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/
include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -I. -
IC:/Ruby192/lib/ruby/gems/1.9.1/gems/narray-ruby19-0.5.9.7-x86-mingw32/
lib -IC:/Ruby192/lib/ruby/site_ruby/1.9.1/i386-msvcrt -Wall -I../
include -I/usr/local/include conftest.c -o conftest.i"
conftest.c:5:35: fatal error: tamu_anova/tamu_anova.h: No such file or
directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <tamu_anova/tamu_anova.h>
/* end */

--------------------

have_library: checking for main() in -ltamuanova...
-------------------- no

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -IC:/Ruby192/lib/ruby/gems/1.9.1/gems/narray-
ruby19-0.5.9.7-x86-mingw32/lib -IC:/Ruby192/lib/ruby/site_ruby/1.9.1/
i386-msvcrt -Wall -I../include -I/usr/local/include conftest.c -
L. -LC:/Ruby192/lib -LC:/Ruby192/lib/ruby/site_ruby/1.9.1/i386-msvcrt -
L. -L/usr/local/lib -lgsl -lgslcblas -lm -lmsvcrt-ruby191-static -
ltamuanova -lshell32 -lws2_32 "
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgsl
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgslcblas
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -ltamuanova
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: int main() {return 0;}
8: int t() { void ((*volatile p)()); p = (void ((*)()))main; return
0; }
/* end */

"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/
Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/
ruby-1.9.1 -I. -IC:/Ruby192/lib/ruby/gems/1.9.1/gems/narray-
ruby19-0.5.9.7-x86-mingw32/lib -IC:/Ruby192/lib/ruby/site_ruby/1.9.1/
i386-msvcrt -Wall -I../include -I/usr/local/include conftest.c -
L. -LC:/Ruby192/lib -LC:/Ruby192/lib/ruby/site_ruby/1.9.1/i386-msvcrt -
L. -L/usr/local/lib -lgsl -lgslcblas -lm -lmsvcrt-ruby191-static -
ltamuanova -lshell32 -lws2_32 "
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgsl
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -lgslcblas
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.1/../../../../mingw32/bin/
ld.exe: cannot find -ltamuanova
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: int main() {return 0;}
8: int t() { main(); return 0; }
/* end */

--------------------

Luis Lavena

unread,
Dec 24, 2010, 12:40:44 PM12/24/10
to rubyin...@googlegroups.com
On Fri, Dec 24, 2010 at 1:01 PM, Badal <mic...@demazure.com> wrote:
> I sent this before. Maybe a server problem ?
> Apologies if it appear twice...
>
> I am still trying to install ruby/gsl
> Please do not hesitate to tell me you are fed up with it.
> _md

Hello, as I mentioned before, you need to provide links to:

* where you got the binaries of gsl library and if those binaries are
for windows
* gsl-config is not an executable on Windows, so you can't rely that
bash finds it.
* you need to use --with-gsl-dir instead of gsl-config, but that will
work as long gsl has been build and configured for Windows.

Since we are not making *any* progress on this thread, going to cover
all the steps involved:

A) Download a binary of gsl for Windows:

You can download gsl 1.8 from gnuwin32:

http://gnuwin32.sourceforge.net/packages/gsl.htm
You need binary and Development files:

http://gnuwin32.sourceforge.net/downlinks/gsl-bin-zip.php
http://gnuwin32.sourceforge.net/downlinks/gsl-lib-zip.php

Please note the special instructions

Or:

B) Compile it from sources:

ftp://ftp.unicamp.br/pub/gnu/gsl/

ftp://ftp.unicamp.br/pub/gnu/gsl/gsl-1.14.tar.gz

See this gist with the complete steps:

https://gist.github.com/754400

2) the narray gem do not compiled properly, as narray is a dependency
of gsl gem:

https://rubygems.org/gems/gsl

narray is playing with DLDFLAGS incorrectly, why is setting the output
lib? is not required, but the gem needs to be tweaked.

3) to patch narray gem:

gem fetch narray

gem unpack narray-0.5.9.9

cd narray-0.5.9.9

(edit extconf.rb and remove the DLDFLAGS section)

gem spec ..\narray-0.5.9.9.gem > narray.gemspec

gem build narray.gemspec

C:\Users\Luis\Projects\_sandbox\narray-0.5.9.9>gem install narray-0.5.9.9.gem


Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...

Successfully installed narray-0.5.9.9
1 gem installed

So, unless narray is fixed, there is nothing that can be done on gsl
area so far.

4) Now with narray fixed and installed, let's try install gsl again:

https://gist.github.com/754414

And it failed now, but due something related to NArray.

Conclusion:

So the thing is figure out what is wrong with both gems, but first
NArray and get it working. Maybe is not working by the way the code is
written

According to previous gems:

https://rubygems.org/gems/narray

There was a version for x86-mingw32 (RubyInstaller) but I believe was
just for Ruby 1.8

So:

1) NArray needs to be fixed. Please ask the author to use
rake-compiler to provide native binaries for Windows or at least catch
the errors we are seeing using cross-compilation techniques. There is
no need for the gem author have a Windows installation.

http://github.com/luislavena/rake-compiler

2) Once NArray is sorted out, let's see how gsl gem depends on NArray
been installed and compiled.

There are some people will say this things just works on Linux, but
sometimes is more "works on my machine" and fluke of luck than
anything else.

Sorry for the long email and sorry for not providing a concrete answer
to you, but is the most I can due due the time I have available.

Regards,

Badal

unread,
Dec 24, 2010, 1:25:34 PM12/24/10
to RubyInstaller
On 24 déc, 18:40, Luis Lavena <luislav...@gmail.com> wrote:

> 1) NArray needs to be fixed. Please ask the author to use
> rake-compiler to provide native binaries for Windows or at least catch
> the errors we are seeing using cross-compilation techniques. There is
> no need for the gem author have a Windows installation.
>
> http://github.com/luislavena/rake-compiler
>
> 2) Once NArray is sorted out, let's see how gsl gem depends on NArray
> been installed and compiled.
>
Luis,

The process B, 2, 3, 4 you describe is exactly the one I did follow.
And it failed at the same point.
I can add an element : I have a project using narray, I checked that
the (extconf patched) compiled narray 0.5.9.9. gem works.
The problem lies somewhere in the way gsl compilation uses narray
I mailed to both gem authors and give up for the time being for gsl/
windows.

Happy Xmas !
_md

Reply all
Reply to author
Forward
0 new messages