[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] Embedded GSL in Fortran 90

From: Eric Germaneau
Subject: [Help-gsl] Embedded GSL in Fortran 90
Date: Mon, 06 Oct 2008 06:11:08 -0400
User-agent: Thunderbird (X11/20080914)

Dear gsl users,

I wish to use gsl in my Fortran 90 program.
So far, I've written 2 C routines as the follwing:

*#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#include "gslwr.h"

static gsl_rng* r;

void rng_initialise__(int* s)
r = gsl_rng_alloc(gsl_rng_taus);
gsl_rng_set(r, (unsigned long int)(*s));

void rng__(double* zetha)
*zetha = (double)gsl_rng_uniform_pos(r) ;

And my program in Fortran 90 looks like that:

*PROGRAM random
integer :: seed = 0
double precision :: zetha

call system_clock(seed)
call rng_initialise(seed)
call rng(zetha)
PRINT*, "zetha=",zetha


I'm able to creat *.o file doing *icc -c gslwr.c* and *ifc -c gsl.f90*.
But when I do *ifc gsl.o gslw.o* I get

/*gsl.o: In function `MAIN__':
gsl.f90:(.text+0x2c): undefined reference to `rng_initialise_'
gsl.f90:(.text+0x36): undefined reference to `rng_'*/

Does someone understand what's wrong with this?
On the other hand I've heard about fgsl
Dose someone use it?
What do you think about it?

I thank you in advance,

/Be the change you wish to see in the world
/ — GANDHI —

Dr. Éric Germaneau <mailto:address@hidden>
Chemical Engineering Department
University of Massachusetts Amherst
159 Gœssmann Laboratory
686 North Pleasant Street
Amherst, MA 01003-9303
Tel: 413-545-6209 (Office)

/msn/: address@hidden
/skype/: aihaike

/ Please consider the environment before printing this email.
Considérez svp l'environnement avant d'imprimer cet email. /

reply via email to

[Prev in Thread] Current Thread [Next in Thread]