This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, libfortran] Multi-threaded random_number
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jerry DeLisle <jvdelisle at charter dot net>, Cesar Philippidis <cesar at codesourcery dot com>
- Date: Fri, 12 Aug 2016 13:37:43 +0300
- Subject: Re: [Patch, libfortran] Multi-threaded random_number
- Authentication-results: sourceware.org; auth=none
- References: <CAO9iq9FeBPjnwMJScLzhyXANkc=z=0AybdW2dNA0z5FcsMsTGw@mail.gmail.com> <CAO9iq9F1RRSWDSiKkyOB1KWvKUbXEL_5KABL5Y_sKHLHaf_wHA@mail.gmail.com> <710d21ad-f79e-a681-bf1a-9be40c0382d6@charter.net> <CAO9iq9Hef=L8nw9=D7vWYjn_qsYWC6RMydNkphAdEdjSD5=9Hw@mail.gmail.com> <CAO9iq9FcHRxPvTS4jbkk=g3Lmrk=NLWUGB5Qn94Sa2ieobn4LQ@mail.gmail.com> <874m6q5mi1.fsf@kepler.schwinge.homeip.net>
On Fri, Aug 12, 2016 at 1:07 PM, Thomas Schwinge
<thomas@codesourcery.com> wrote:
> Hi!
>
> On Thu, 11 Aug 2016 12:01:59 +0300, Janne Blomqvist <blomqvist.janne@gmail.com> wrote:
>> committed a slightly modified patch as r239356. [...]
>
> This breaks the build for nvptx
Sorry about that!
> (but it may actually be a problem
> specific to the nvptx-newlib); I filed <https://gcc.gnu.org/PR74755>
> "libgfortran: build breaks if localtime_r prototype is present, but
> definition is not".
Hmm, yeah, sounds like something nvptx-newlib should fix?
More generally, however, now that you mention it; With the new PRNG we
optionally seed it from /dev/urandom, and if that is not found, with
gettimeofday() + getpid() (which is why it now includes time_1.h which
causes this failure). But if I understand it correctly, none of these
approaches work on nvtpx. So is there some sane way to seed the PRNG
in an, err, random way?
--
Janne Blomqvist