- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Trying to track down the reason that my program crashes, I have resorted to building a debug version. I have built all the libraries, and almost built the main Fortran program, but I am getting an error in one file. This file contains a just set of interfaces, each of which looks very much like the last one, shown here:
interface
subroutine itsol_create_precond_VBILUK(ic, nfill_level, ierr) bind(C,name='itsol_create_precond_VBILUK')
use :: iso_c_binding
integer(c_int),value :: ic, nfill_level
integer(c_int) :: ierr
end subroutine
end interface
The compile error, only in Debug mode, occurs at the last line ('end interface'):
Error #5082: Syntax error, found END_OF_FILE when expecting one of: <LABEL> <END_OF_STATEMENT>;TYPE INTEGER REAL ...
This one has me stumped.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I forgot to reiterate that this VS2015 and Parallel Studio XE 2016, on Windows 10. Sounds like the perfect storm, eh?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is the last line that you show actually the end of the relevant source file, or is there source following?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, that's the last line in the file. I tried deleting and replacing it, but it made no difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interface blocks do not, per se, constitute a compilable program unit. The blocks have to be within MODULE ... END MODULE lines, or should be part of a subprogram source code. As IanH hinted above, if you simply add an END PROGRAM line to the lines that you showed, the modified source code is compilable, although the resulting object file is useless.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the source with the interface blocks was supplied by others, it may have been intended to be INCLUDE'd from the specification part of a program unit or subprogram in another file, and not compiled as a Fortran source file in its own right.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks guys for pointing me in the right direction. The interface file is included in one of the modules, and the setup builds correctly in Release mode. itsol_interface.f90 is in the list of source files. When I remove it from the list the build proceeds without error. As was pointed out, this file should not compile by itself, but then it is interesting that the Release build doesn't have a problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My guess is that in the Release configuration this file is marked as "Exclude from build".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interesting, Steve. Where would that be done? I don't recall specifying that it be excluded, but anything is possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right click on the source, select Properties > General.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've been switching back and forth between Release and Debug builds, so the original setting is lost, but I presume that at some time I did set that to Yes. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In solution explorer right click on the file, and select properties. Exclude from build is then under "general"
Edit Hmm . That is the second time today I have posted something and then several comments after the previous last comment have just appeared!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page