This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: newbie question....trying hard to get GSL to work under windows
- From: G L Ingram <g dot l dot ingram at durham dot ac dot uk>
- To: Oregon Medical Press <office at ompress dot com>
- Cc: gsl-discuss at sources dot redhat dot com
- Date: Fri, 27 Jun 2003 14:58:24 +0100 (BST)
- Subject: Re: newbie question....trying hard to get GSL to work under windows
- References: <OOEGLGMJPMKLOFAEEDLFAEGPCKAA.office@ompress.com>
John,
I'm by no means an expert in all this but you might this useful:-
I've no idea about MATLAB I don't use it. However I do use the GSL under
windows using cygwin - I imagine the principles are the same:-
When I want to install a GSL installation I download a tar.gz file
from: http://www.mirror.ac.uk/sites/sources.redhat.com/pub/gsl/
this I then copy to the /home/username directory for cygwin. The
/home/username directory is found in the windows world as
c:\cygwin\home\username. There may be a better choice of directory but
that's the one I use. You should be able to find an analagous
directory for msys.
Having copied the file I push the cygwin icon button thingy this then pops
a window with a command prompt in it. From there you can navigate to the
/home/username directory. I then unzip (uncompress) the file using:-
# gzip -d name_of_file
Don't type the "#" it's shorthand for the command prompt. I then untar
the file using
# tar -xvf name_of_file
This produces a subdirectory called gsl-1.2/ or whatever verison gsl you
have downloaded. I then cd to this directory if you type
# less install
you should get some installation instructions but basically to get
gsl working type:-
# ./configure
# make
# make install
This process should put the right files in the right place.
In order to get programs working, I simply copied some sample code from
the manual (which I thought was quite good actually) into a file example.c
say, then to get it to compile:
# gcc -o fred example.c -lgsl -lgslcblas -lm
worked for me!
You an then run the program from your command prompt by
# ./fred
Then what I do when running windows is to copy the exe file produced by
all of this to the directory where my data is and you can run from an
MS-DOS prompt without loading up cygwin directly.
This may not help you, or be too simplistic - it's provided in the hope
that it might be useful. To answer some of your questions:-
> I have downloaded and installed MSYS and mingw32, and have downloaded the
> GNUWin32 version 1.0 of GSL. But I am stuck. Where do I place the GSL? I
> know somewhere it says to place it in the program files path, but the GSL
> documentation says that it belongs in the /usr/local/include/gsl path,
> which in the windows case I assume would be within the MSYS directory
> structure. Is that correct? And whereever I place it, how do I tell
> windows (or MSYS) that it is even there? Do I need to put it into the
> windows path statement, or some sort of path statement used by MSYS? Does
> MSYS have some sort of update function when you change directory structures?
The installation procedure should take care of which directory stuff goes
in.
> Next, when compiling a C code, how do I link using the dlls? Or do I link
> using the libgsl.a files? I could really use some simple, complete, easy to
> follow instructions on this. It is very confusing to me, and the manuals
> that came with GSL etc are not of too much help. I have read the one page
> discussion in the GSL manual many times. It assumes I know much more than I
> do. I am just a beginner and would really appreciate some help so that I
> could use GSL.
See above, not sure how you use DLLs though.
> Also, must I use the 1.0 version of GSL on windows or can I compile my own
> so that I can use the latest version? Is compiling the new version just a
> matter of downloading the source files and issuing the appropriate make
> commands, etc?
You can compile your own as above.
> Must I also download the header files if I want to write a C program that
> uses GSL functions? What directory should I place them in? How does MSYS
> or windows know that they are there?
If you follow the instructions above the whole things just works for me...
> Lastly, is WSYS the only interface to mingw32? It is funny to me, but in
> the web instructions to mingw32 they say to install it and type in some test
> commands. But where are you to type them in?? Into a dos prompt? Into the
> WSYS shell? The web page gives you no clue. Does mingw32 have its own
> shell?
I'm not sure about MSYS, I think you get a icon on the start menu which
pops up a window with a command prompt in it but don't quote me on that.
I hope that helps!
Regards,
Grant.