Re: [R] Fortran dy lib on Solaris

From: Jin Shusong <>
Date: Fri 29 Apr 2005 - 11:52:24 EST

On Thu, Apr 28, 2005 at 05:11:11PM +0100, V Nyirongo wrote:
> Dear all,
> Am new on this list but need help:
> I have a fortran code which I compile into a dynamic library (on Solaris).
> My probem is that when I call this code soon after starting R, it runs ok.
> But it doesn't for the second time without exiting R first. In this code I
> have to generate some random numbers. The problem is not about setting the
> seed.
> Anyone with an idea what might be going on?
> Thanks,
> Vysaul.
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!
Dear Vysaul,

  You can call srand to set the seed.

       implicit none
       integer i,seed,time
       call srand(seed)
       do 10 i= 1, 10
         print*, rand(0)
10     continue

  At least g77 can support srand and rand

  Good luck.


                       Yours  Sincerely

                               Shusong Jin

Add: Meng Wah Complex, RM518     Email:
     Dept. of Statistics         Tel:   (+852)28597942
      and Actuarial Science      fax:   (+852)28589041
     The Univ. of Hong Kong
     Pokfulam Road, Hong Kong

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Fri Apr 29 12:03:09 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:30 EST