cross-platform thread-safe RNG drand48_r

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

 



hi

I was trying to compile a simulation code on
multiple platforms. It involves a thread-safe
48bit POSIX random number generator (RNG),
drand48_r/seed48_r. I tried gcc 4.4 on Ubuntu
10.4 and it compiled fine. However, when
I run gcc 4.0 on Mac OS X, it gave me error:

posix_randr.h:29: error: array type has incomplete element type

and the offending lines read like:

typedef struct drand48_data RandType;
__device__ float rand_uniform01(RandType t[RAND_BUF_LEN]);
...

Similar error when compiling on Windows with
MinGW gcc 3.4.

Because drand48 is supposed to be a POSIX function,
I am a bit surprised when seeing multiple platforms
responded differently. Did I miss anything? or
this is the correct behavior?

thanks

Qianqian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux