# Using rb-gsl with Windows

**URL:** <https://rubytalk.org/t/using-rb-gsl-with-windows/40148>\
**Category:** ruby-talk\
**Created:** [23 August 2007 19:39 UTC](https://rubytalk.org/t/using-rb-gsl-with-windows/40148 "2007-08-23T19:39:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Armin\_Armbruster](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@Armin\_Armbruster](https://rubytalk.org/u/Armin_Armbruster)\
**Post date:** [23 August 2007 19:39 UTC](https://rubytalk.org/t/using-rb-gsl-with-windows/40148/1 "2007-08-23T19:39:07Z")

</div>

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  
&nbsp;&nbsp;&nbsp;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)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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?\

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![a11](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/a11/32/8169_2.png) [@a11](https://rubytalk.org/u/a11)\
**Post date:** [23 August 2007 21:12 UTC](https://rubytalk.org/t/using-rb-gsl-with-windows/40148/2 "2007-08-23T21:12:31Z")

</div>

slightly outdated:

[http://codeforpeople.com/lib/ruby/rb-gsl-win/](http://codeforpeople.com/lib/ruby/rb-gsl-win/)

but you may be able to download and simply run

&nbsp;&nbsp;ruby install.rb

it ships with narray to btw.

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

&nbsp;&nbsp;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/](http://drawohara.com/)

> **···**
>
> On Aug 23, 2007, at 1:39 PM, Armin Armbruster wrote:
> 
> > Anyhow, my real goal is to install the rb-gsl under windows (not using  
> > cygwin).
> 
> --  
> we can deny everything, except that we have the possibility of being better. simply reflect on that.  
> h.h. the 14th dalai lama

---

<div class="post-metadata">

**Author:** ![a11](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/a11/32/8169_2.png) [@a11](https://rubytalk.org/u/a11)\
**Post date:** [23 August 2007 21:14 UTC](https://rubytalk.org/t/using-rb-gsl-with-windows/40148/3 "2007-08-23T21:14:40Z")

</div>

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/](http://drawohara.com/)

> **···**
>
> On Aug 23, 2007, at 1:39 PM, Armin Armbruster wrote:
> 
> > 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?\
> 
> --  
> we can deny everything, except that we have the possibility of being better. simply reflect on that.  
> h.h. the 14th dalai lama

---

<div class="post-metadata">

**Author:** ![Armin\_Armbruster](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@Armin\_Armbruster](https://rubytalk.org/u/Armin_Armbruster)\
**Post date:** [24 August 2007 14:09 UTC](https://rubytalk.org/t/using-rb-gsl-with-windows/40148/4 "2007-08-24T14:09:28Z")

</div>

ara.t.howard wrote:

> 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

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
