title: Undefined symbols for architecture x86_64: gfortran
body: <p>Hi so I'm trying to compile a Fortran code written by someone else in what I believe is F77 (.for extension). The error I'm getting is: </p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "_random_", referenced from:
        _pms_ in ccx1qzWD.o
  ld: symbol(s) not found for architecture x86_64
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>I'm not posting the code now but I've been searching online for what this error even means so I can start searching for the solution but can't find any helpful information. I have no previous Fortran experience! Any help on the meaning of this error is really appreciated. I'm using a mac and the only section that includes the "random" is part of a subroutine:</p>
  
  <pre><code>DOUBLE PRECISION RANDOM
  
  DO 1 J=1,M
        w(J)=dw+REAL(J*2-1)*dw/2.0
        W1=w(J)*w(J)*w(J)*w(J)*w(J)
        Vel1=Vel*Vel*Vel*Vel*W1/w(J)
        Vel1=-6844.0697/Vel1
        Gw(J)=0.77898/W1*EXP(Vel1)
        Phi(J)=RANDOM()*8.0*ATAN(1.0)
  1     CONTINUE
  </code></pre>
  
  <p>I am using: gfortran SEASIM.FOR to compile</p>
  
  <p>Thanks in advance for any advice!</p>