OK, I seemed to have solve the problem. As also pointed out in the same
section of the R-exts manual, "Passing values via argument is safer."
I
just change the C function from double with no argument to void with double
* (and changed the Fortran calls from function to subroutine). Now it seems
to run fine. Sorry to bother everyone.
Cheers,
Andy
> -----Original Message-----
> From: Liaw, Andy [mailto:andy_liaw at merck.com]
> Sent: Monday, June 10, 2002 10:39 AM
> To: 'r-help at stat.math.ethz.ch'
> Subject: [R] R's RNG produced garbage when called from f77 (Irix)
>
>
> Dear R-help,
>
> I've managed to crash R on Irix when I called a Fortran
> subroutine that
> calls R's random number generator, as described in Section
> 5.6 of the R-exts
> manual. (It does say in that section that this is not
> guaranteed to be
> portable...) (Well, R doesn't crash when calling the RNG.
> It crashed when
> the random number generated isn't inside the unit interval.)
>
> Can anyone explain why the RNG doesn't return values within
> (0, 1), or, even
> better, how to get around this problem? I'll be very, very grateful!
>
> BTW, this might be the reason why my randomForest package
> fail to run on
> some systems...
>
> The system is:
>
> Version:
> platform = mips-sgi-irix6.5
> arch = mips
> os = irix6.5
> system = mips, irix6.5
> status > major = 1
> minor = 5.0
> year = 2002
> month = 04
> day = 29
> language = R
>
> Search Path:
> .GlobalEnv, package:ctest, Autoloads, package:base
>
> Cheers,
> Andy
>
>
> --------------------------------------------------------------
> ----------------
> Notice: This e-mail message, together with any attachments,
> contains information of Merck & Co., Inc. (Whitehouse
> Station, New Jersey, USA) that may be confidential,
> proprietary copyrighted and/or legally privileged, and is
> intended solely for the use of the individual or entity named
> on this message. If you are not the intended recipient, and
> have received this message in error, please immediately
> return this by e-mail and then delete it.
>
> =============================================================>
===============>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
> -.-.-.-.-.-.-.-.-
> r-help mailing list -- Read
> http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !) To:
> r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
> _._._._._._._._._
>
> --------------------------------------------------------------
> ----------------
> Notice: This e-mail message, together with any attachments,
> contains information of Merck & Co., Inc. (Whitehouse
> Station, New Jersey, USA) that may be confidential,
> proprietary copyrighted and/or legally privileged, and is
> intended solely for the use of the individual or entity named
> on this message. If you are not the intended recipient, and
> have received this message in error, please immediately
> return this by e-mail and then delete it.
>
> =============================================================>
===============>
------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains information
of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be
confidential, proprietary copyrighted and/or legally privileged, and is intended
solely for the use of the individual or entity named on this message. If you
are not the intended recipient, and have received this message in error, please
immediately return this by e-mail and then delete it.
=============================================================================
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._