This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Random seed initialization
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: Angelo Graziosi <angelo dot graziosi at alice dot it>
- Cc: fortran <fortran at gcc dot gnu dot org>
- Date: Sat, 6 Apr 2013 17:44:28 +0200
- Subject: Re: Random seed initialization
- References: <51603400 dot 3030705 at alice dot it> <CAKwh3qgG=pPbKyE6YT8H9++E_74uKmFC0UKG+Q3cW8bxYHVHRw at mail dot gmail dot com> <51603FEF dot 9020300 at alice dot it>
Hi,
> Using my build of GCC-4.9.0 20130324, each run produces always this
>
> $ ./rnd_init.out
> n= 12
> clock: 0
> seed: 0 37 74 111 148 185
> 222 259 296 333 370 407
> random: 0.301754534 0.380439878 0.926293135 0.672118008
> 0.237815678 0.638214409 0.320253670 0.351599574 0.865273237
>
> It seems the call to SYSTEM_CLOCK() is failing..
right, this clearly confirms my suspicion that it's a problem with SYSTEM_CLOCK.
>> Might be a platform-specific problem (with SYSTEM_CLOCK?!?) ...
>
> ... or my build of GCC is not so good (see above for configure options)...
I have exactly zero experience with building GCC under Windows/Cygwin,
so I'm not of much help here. Also I don't have a Windows installation
to check this, but maybe someone else can confirm this problem on
Cygwin?
It would also be helpful if you could use a newer Cygwin-provided
build of gfortran (if available), or try to build 4.7 or 4.8 yourself
(to check if it's a regression on trunk).
Cheers,
Janus