title: Link to NAG library with -lnag
body: <p>I'm trying to compile my first program which uses the NAG library, the following:</p>
  
  <pre><code>program naginfo
  
      use nag_f77_a_chapter
      implicit none
  
      write(*,*) 'Calling NAG identification routine'
      write(*,*)
      call a00aaf
  
  end program naginfo
  </code></pre>
  
  <p>This is copied from the tutorial and they suggest to compile it with the following statement: </p>
  
  <pre><code>f95 -o naginfo naginfo.f90 -lnag
  </code></pre>
  
  <p>and they suppose that this <code>-lnag</code> drives the linker to NAG library, but then I find this error: </p>
  
  <pre><code>Fatal Error: Can't open module file ‘nag_f77_a_chapter.mod’ for reading at (1): The directory does not exist
  </code></pre>
  
  <p>I've tried changing the directory of the NAG files to help the linker find it.</p>
  
  <p>How do I get this to compile and link?</p>