This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Calling GSL functions from Fortran ?
- From: Jacek Pliszka <pliszka at phyun0 dot ucr dot edu>
- To: Daniel T Konkle <daniel dot konkle at dynetics dot com>
- Cc: gsl-discuss at sources dot redhat dot com
- Date: Mon, 29 Apr 2002 12:07:55 -0700 (PDT)
- Subject: Re: Calling GSL functions from Fortran ?
- Reply-to: Jacek Pliszka <pliszka at phyun0 dot ucr dot edu>
On Mon, 29 Apr 2002, Daniel T Konkle wrote:
> Has anyone out there used the GSL library with Fortran?
>
> I'm looking for an example of calling one of the function from Fortran.
Write a simple C wrapper. Like this:
double my_gsl_ran_gaussian_(double *sigma){
return(gsl_ran_gaussian(gsl_rng_mt19937,*sigma))
}
Remember:
a) on some systems you have to add _ or __ to the name
b) fortran passes everything as reference so you have to go with pointers
c) may depend on compiler
For Linux g77/gcc add _
Good Luck,
Jacek