Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

error compiling fortran 77

mpotes
Beginner
671 Views
Hello all
I'm trying to compile a fortran77 code on LINUX and I'm having one error: undefined reference to 'eof_'
This suggests that I haven't some library!?
How can i fix this?
I just try mpif90, mpif77,intel64,gfortran,pgf90, etc....
Many thanks in advance
Miguel
0 Kudos
1 Reply
Hirchert__Kurt_W
New Contributor II
671 Views
The 'eof_' in the error message corresponds to a reference to a function or subroutine name 'eof' (or 'EOF') in your Fortran source code. There is no standard function or subroutine named EOF, but some vendors in the past provided a function named EOF to address a deficiency in the original 1966 FORTRAN standard.

That standard provided no way to detect end of file when reading, so vendors typically provided some kind of extension to do this. Most provided the END= clause in the READ statement that became standard in FORTRAN 77, but a few provided an EOF function whose value after a READ statement would tell you whether or not that statement encountered an end of file. I suspect that is what you have here.

It may be that the wizards at Intel have some compiler compatibility option that would provide you with such an EOF function, but the more portable approach would be to search your source code for 'eof(' or 'EOF(' to locate the uses of eof and then replace them with uses of one of the ways to detect end of file that is standard in FORTRAN 77, Fortran 90, Fortran 2003, and Fortran 2008, adding either an END= clause or STAT= clause to the READ statements that are expected to encounter end of file.

-Kurt
0 Kudos
Reply