NickFort
Technical User
- Jun 10, 2010
- 113
I'd like to use the GNU Scientific Library (GSL) with Fortran 90 and later -- it has almost anything I'd need. Pity it's all in C.
Now, I know it can be done: I've found two sites which deal with this: (note that this doesn't exist any more; it's a cache of Google's, and I don't know how much longer it'll be available -- I do have it saved in case it goes down) and
The first gives a simple example, but is very basic, and doesn't explain the reasoning (although I can understand it, I think). It also points to a non-existent link about writing Fortran wrappers for the GSL (
FGSL, at the second link, looks hellishly complicated to me, and geared towards people who are (a) on Unix, and (b) very competent when it comes to the compiling side of things. I am neither of these (I do use Linux, but not for programming purposes, and I can't use it for this project, anyway).
Can anyone help me out here? What I would ultimately like to do is compile the various GSL subroutines into DLLs, and call them from Fortran -- if that plan is even vaguely feasible. How would I go about achieving these two goals?
I think possibly my biggest hurdle would be, for example, using an algorithm from the GSL on a dynamically-associated function available as a Fortran DLL.
So, let's say I have a DLL containing two Fortran functions, myfoo1 and myfoo2. I would like to be able to use a GSL minimisation routine to find the minimum of either of the functions, as specified by an argument to the GSL minimisation DLL.
I hope that makes sense -- any help would be greatly appreciated! I really haven't got a clue where to start here.
Regards,
NF
--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
Now, I know it can be done: I've found two sites which deal with this: (note that this doesn't exist any more; it's a cache of Google's, and I don't know how much longer it'll be available -- I do have it saved in case it goes down) and
The first gives a simple example, but is very basic, and doesn't explain the reasoning (although I can understand it, I think). It also points to a non-existent link about writing Fortran wrappers for the GSL (
FGSL, at the second link, looks hellishly complicated to me, and geared towards people who are (a) on Unix, and (b) very competent when it comes to the compiling side of things. I am neither of these (I do use Linux, but not for programming purposes, and I can't use it for this project, anyway).
Can anyone help me out here? What I would ultimately like to do is compile the various GSL subroutines into DLLs, and call them from Fortran -- if that plan is even vaguely feasible. How would I go about achieving these two goals?
I think possibly my biggest hurdle would be, for example, using an algorithm from the GSL on a dynamically-associated function available as a Fortran DLL.
So, let's say I have a DLL containing two Fortran functions, myfoo1 and myfoo2. I would like to be able to use a GSL minimisation routine to find the minimum of either of the functions, as specified by an argument to the GSL minimisation DLL.
I hope that makes sense -- any help would be greatly appreciated! I really haven't got a clue where to start here.
Regards,
NF
--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.