title: F77: problem to compile with g77 a program which was normally compiled with Absoft compiler
body: <p>I am not a Fortran programmer (just a short experience), but I need to compile a program partly written in <code>F77</code>. Someone has compiled it with <code>Absoft</code> compiler before me, but now I need to repeat the procedure on another machine with <code>g77</code>. For Absoft, the makefile has</p>
  
  <pre><code>f77 -f  -w -O -B100 -B108 -c *.f
  mv *.f flib &amp;&amp; mv *.o olib
  f77  -B100 -o runme olib/*.o clib/*.o -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -L$PVM_ROOT/lib/$PVM_ARCH  -lfpvm3 -lpvm3 -L$ABSOFT/lib -lU77
  </code></pre>
  
  <p>I have modified these lines to be</p>
  
  <pre><code>g77   -w -O -B100 -B108 -c *.f
  mv *.f flib &amp;&amp; mv *.o olib
  g77  -B100 -o runme olib/*.o clib/*.o -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -L$PVM_ROOT/lib/$PVM_ARCH  -lfpvm3 -lpvm3  -lgfortran -lgfortranbegin
  </code></pre>
  
  <p>But I get the following error messages</p>
  
  <pre><code>somefile.f:(.text+0x93): undefined reference to `for_open'
  somefile.f:(.text+0xf4): undefined reference to `for_write_seq_fmt'
  somefile.f:(.text+0x128): undefined reference to `for_write_seq_fmt_xmit'
  somefile.f:(.text+0x454): undefined reference to `for_read_seq'
  </code></pre>
  
  <p>How can I fix this?</p>
  
  <hr>
  
  <p><strong>UPDATE1</strong></p>
  
  <p>If I add <code>-libifcore</code> to the end of the last line (linker), then I get</p>
  
  <pre><code>/usr/bin/ld: cannot find -libifcore
  </code></pre>
  
  <p>I have located the library</p>
  
  <pre><code>$ find /opt/intel/* -name 'libifcore*'
  /opt/intel/fce/9.1.036/lib/libifcore.a
  /opt/intel/fce/9.1.036/lib/libifcore.so
  /opt/intel/fce/9.1.036/lib/libifcore.so.5
  /opt/intel/fce/9.1.036/lib/libifcore_pic.a
  /opt/intel/fce/9.1.036/lib/libifcoremt.a
  /opt/intel/fce/9.1.036/lib/libifcoremt.so
  /opt/intel/fce/9.1.036/lib/libifcoremt.so.5
  /opt/intel/fce/9.1.036/lib/libifcoremt_pic.a
  </code></pre>
  
  <p>But even if I do the following in the source directory</p>
  
  <pre><code>$ export PATH=$PATH:/opt/intel/fce/9.1.036/lib/
  $ ln -s /opt/intel/fce/9.1.036/lib/libifcore.so
  </code></pre>
  
  <p>it is not found.</p>
  
  <p>Moreover, it is the same machine where I get another problem <a href="https://stackoverflow.com/questions/3354818/how-to-pass-libm-to-mpicc-libimf-so-warning-feupdateenv-is-not-implemented">How to pass -libm to MPICC? libimf.so: warning: feupdateenv is not implemented and will always fail</a></p>
  
  <p>It seems that the compiler should find the library, if needed</p>
  
  <pre><code>$ echo $LD_LIBRARY_PATH
  /opt/intel/fce/9.1.036/lib:/opt/intel/cce/9.1.042/lib:/usr/local/lib/openmpi:/usr/local/lib:/usr/lib:
  </code></pre>