Using rb-gsl with Windows

A

Armin Armbruster

Hi,

I'm trying to use rb-gsl under Windows, but I'm stuck.
What I've done so far:

1. downloaded gsl-1.9 and compiled it under cygwin
2. downloaded rb-gsl-1.92 and ran ruby setup.rb all
I had some problems with that. config ran fine, make ran fine until
the link step, then the linker complained. I think the problem is that
there are two search pathes given for the linker. The first one is
/usr/lib, the second one is /usr/local/lib. As far as I can see /usr/lib
had an older version of libgsl.a, the newly compiled version (see step
1.) got put in /usr/local/lib.
I tried to re-run step 1. with the option --exec-prefix /usr. This
updated libgsl.a in /usr/lib, however I still had the linker problem in
step 2.
I eventually overcame the problem by calling the linker directly but
omitting the -L "/usr/lib" switch. After that I was able to run ruby
setup.rb install, which installed the gsl stuff under
/usr/lib/ruby/site_ruby/1.8.

That's how far I got so far.
I can run some of the samples in cygwin successful (the ones without
graphics output). I'm not able to run some of the samples that use
plot-utils, even though I've installed it (see below).

$ which graph
/usr/bin/graph

$ ruby -S histo3d.rb
/histo3d.rb:34:in `graph': GNU plotutils required (NoMethodError)
from ./histo3d.rb:34

Anybody any idea how to get this working.

Anyhow, my real goal is to install the rb-gsl under windows (not using
cygwin).
So my question:
How do I install rb-gsl in my windows installation of ruby (sitting in
c:\ruby).
Do I simply copy the rb_gsl.so file into one of the ruby sub-directories
(which?), or is there a "proper" way of doing it like ruby setup.rb
install ???

And finally, is there a way to install the documentation under the
RubyGems Documentation (I thought I saw that somewhere but can't find it
anymore).

Thanks for any help. It's greatly appreciated.

Regards,
Armin

PS: For those of you who want to tell me that I should run ruby in
cygwin rather than windows, perhaps we can postpone this discussion to
another time :)

PPS: If any of the rb-gsl authors/maintainers is reading this: Is there
a chance that you could publish rb-gsl as a gem so that people like me
could make use of your great library more easily?\
 
A

ara.t.howard

Anyhow, my real goal is to install the rb-gsl under windows (not using
cygwin).


slightly outdated:

http://codeforpeople.com/lib/ruby/rb-gsl-win/


but you may be able to download and simply run

ruby install.rb

it ships with narray to btw.

basically you need to do this
1) install msys
2) compile ruby under msys
3) compile narray using ruby under msys
4) compile gsql using msys
5) compile rb-gsl using ruby under msys

6) manually copy required files into c:\ruby\bin OR check out my
installer which uses the one-click to figure out where things should
go. (the installer would normally go into msys space)

one last note: it was a pain in the butt and required more that a few
tiny c code and makefile/bash hacks.

good luck!


a @ http://drawohara.com/
 
A

ara.t.howard

PPS: If any of the rb-gsl authors/maintainers is reading this: Is
there
a chance that you could publish rb-gsl as a gem so that people like me
could make use of your great library more easily?\


a gem won't help you since the windows ruby is crippled : it has no
built in compiler tool chain and this is precisely what gems use to
bootstrap these kinds of gems. the only option is a binary
installation of the entire gsl along side rb-gsl which is essentially
what my installer is.

cheers.

a @ http://drawohara.com/
 
A

Armin Armbruster

ara.t.howard said:
a gem won't help you since the windows ruby is crippled : it has no
built in compiler tool chain and this is precisely what gems use to
bootstrap these kinds of gems. the only option is a binary
installation of the entire gsl along side rb-gsl which is essentially
what my installer is.

Thanks for your help Ara. I'll have a look into your installer. I should
be able to re-use it for installing 1.9.2 (not that it really matters
for what I'm doing, but I'm just that kind of guy that always wants the
latest and greatest ... and then gets burned :) ). But first I'm going
on holidays :).

Funny enough, I was able to run a few of the examples by copying the
files from /lib/ruby/site_ruby/1.8 in cygwin to the correspoinding place
in my c:\ruby windows installation. The only thing I had to do is to add
the c:\cygwin\bin to my PATH variable and run ruby with the -S switch. I
realize that this isn't a "clean" way of doing things but interesting
nevertheless.
Obviously the samples that require graphics output don't work
(histo2d.rb for example).

Coming back to cygwin:
Can anybody tell me why I can't run the graphics sample like histo2d.rb
from within cygwin? As mentioned in my first post I have plotutils
installed (from cygwin setup.exe). I also have cygwin/x installed and
running, although I'm not sure if it's required at all. To be honest I
never use cygwin/x.

Thanks,
Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top