Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Odd compile error

gib
New Contributor II
1,011 Views

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.

0 Kudos
11 Replies
gib
New Contributor II
1,011 Views

I forgot to reiterate that this VS2015 and Parallel Studio XE 2016, on Windows 10.  Sounds like the perfect storm, eh?

0 Kudos
IanH
Honored Contributor III
1,011 Views

Is the last line that you show actually the end of the relevant source file, or is there source following?

0 Kudos
gib
New Contributor II
1,011 Views

Yes, that's the last line in the file.  I tried deleting and replacing it, but it made no difference.

0 Kudos
mecej4
Honored Contributor III
1,011 Views

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.

0 Kudos
IanH
Honored Contributor III
1,011 Views

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.

0 Kudos
gib
New Contributor II
1,011 Views

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. 

0 Kudos
Steven_L_Intel1
Employee
1,011 Views

My guess is that in the Release configuration this file is marked as "Exclude from build".

0 Kudos
gib
New Contributor II
1,011 Views

Interesting, Steve.  Where would that be done?  I don't recall specifying that it be excluded, but anything is possible.

0 Kudos
Steven_L_Intel1
Employee
1,011 Views

Right click on the source, select Properties > General.

0 Kudos
gib
New Contributor II
1,011 Views

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.

0 Kudos
andrew_4619
Honored Contributor III
1,011 Views

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! 

0 Kudos
Reply