[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] For help about the use of "gsl_rng_alloc" on windows
From: |
Ralph Silva |
Subject: |
Re: [Help-gsl] For help about the use of "gsl_rng_alloc" on windows |
Date: |
Wed, 17 Oct 2007 11:16:58 -0300 |
Hi,
I compiled your program (see below) using Cygwin and gcc with
gcc -W -Wall -o test test.c -I/usr/include -L/usr/lib -lgsl -lm
and it worked fine. It also worked fine on Debian Etch Gnu/Linux 64bit. It
is always a good idea to use "-W -Wall" for all warnings and error messages.
Your program had two errors. Compare it with yours!
Please, read the GSL manual
www.gnu.org/software/gsl/manual/gsl-ref.html#Random-Number-Generation for
further information.
It also a good idea to use GCC and GNU/Linux.
I hope that helps you.
Best,
Ralph.
#include <stdio.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
int main (void){
int i;
gsl_rng * r;
printf("running1....\n");
r = gsl_rng_alloc(gsl_rng_mt19937_1999);
printf("running2....\n");
for(i = 0;i<10;i++){
double v = gsl_ran_flat(r,1,12);
printf("number is %2.4f\n",v);
}
gsl_rng_free (r);
return 0;
}
On 10/16/07, 张乐华 <address@hidden> wrote:
>
> Dear,
>
> I am using gsl_rng_alloc in a C-coded python extension on windows XP. The
> extension compiles and links fine but any call to gsl_rng_alloc causes a
> fatal error. codes are as follows:
>
> #include <stdio.h>#include <gsl/gsl_rng.h>#include <gsl/gsl_randist.h>
> int main (void){ const gsl_rng_type * T; int i; gsl_rng *
> r; printf("running1....\n"); r =
> gsl_rng_alloc(gsl_rng_mt19937_1999); printf("running2....\n"); for(i =
> 0;i<10;i++) { double v = gsl_ran_flat(r,1,12); printf("number is
> %d\n",v); } gsl_rng_free (r); return 0;}
>
> crashes happened at " r = gsl_rng_alloc(gsl_rng_mt19937_1999);"
>
> Any suggestions?
>
> Thanks,
>
> 姓名:张乐华
> 单位:北京邮电大学计算机学院
>
>
> ___________________________________________________________
> 雅虎邮箱,终生伙伴!
> http://mail.yahoo.com.cn/
> _______________________________________________
> Help-gsl mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-gsl
>