- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page