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

Extraneous error message

fort
Beginner
1,284 Views

When a syntax error is present, I often get two error messages, e.g.:

pint.F(1686): error #5082: Syntax error, found '.' when expecting one of: :: ) , : * <END-OF-STATEMENT> ; . (/ + - ] /) ' ** / // > PRIVATE ...
if(cutregion.lt.1 .or nregions.lt.1) then
----------------------------^
pint.F(1296): error #5508: Declaration of routine 'RMDUPES' conflicts with a previous declaration
subroutine rmdupes(n, xin, yin, zin, kv, xt, yt, zt,

 

Error #5508 has nothing to do with the syntax error.

 

 

I have 40 years of Fortran experience, but only a few months of "Intel Developer" experience.  Don't hesitate to remind me:

 

How to determine which compiler version I'm running (2022.0.0?)

How to determine if my issue has been addressed in another post.

Intel's preferences (# of lines...) for submitting code samples.

 

Thanks,

 

0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
1,276 Views

1. To see the compiler version, there are a couple of options. I'm not sure which OS you're using but invoking the compiler from a command prompt will show the version. For example:

D:\Projects>ifort
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.6.0 Build 20220226_000000

On Linux and MacOS, add the -logo option to see this.

If you are using Visual Studio on Windows, open the buildlog.htm in the Debug or Release folder. There will be a line like this:

Compiling with Intel® Fortran Compiler Classic 2021.3.0 [Intel(R) 64]...

2. Don't bother. 

3. Ideally, two things. First, the smallest, self-contained example that demonstrates the problem. Also include your full test case. If it's multiple files or large, use ZIP or tgz, etc. These can be attached to a reply here.

Now I'll comment on the issue in general. It's not unusual for an error detected earlier in a compilation to create enough confusion in the compiler that other, seemingly irrelevant error messages get generated. I wouldn't expend any energy on chasing those down. Fix the syntax error first and then see what you get.

 

View solution in original post

0 Kudos
4 Replies
Steve_Lionel
Honored Contributor III
1,277 Views

1. To see the compiler version, there are a couple of options. I'm not sure which OS you're using but invoking the compiler from a command prompt will show the version. For example:

D:\Projects>ifort
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.6.0 Build 20220226_000000

On Linux and MacOS, add the -logo option to see this.

If you are using Visual Studio on Windows, open the buildlog.htm in the Debug or Release folder. There will be a line like this:

Compiling with Intel® Fortran Compiler Classic 2021.3.0 [Intel(R) 64]...

2. Don't bother. 

3. Ideally, two things. First, the smallest, self-contained example that demonstrates the problem. Also include your full test case. If it's multiple files or large, use ZIP or tgz, etc. These can be attached to a reply here.

Now I'll comment on the issue in general. It's not unusual for an error detected earlier in a compilation to create enough confusion in the compiler that other, seemingly irrelevant error messages get generated. I wouldn't expend any energy on chasing those down. Fix the syntax error first and then see what you get.

 

0 Kudos
fort
Beginner
1,252 Views

My post was motivated by the fact that in 20 years or more, ifort has seldom misled me into concluding an error message could be ignored.  If I run into this issue with a source file of manageable proportion (not the present 3000 lines) I'll share it.

 

Cheers,

0 Kudos
mecej4
Honored Contributor III
1,262 Views

You probably know this already, but note that 

if(cutregion.lt.1 .or nregions.lt.1) then

is in error because a period character '.' is missing after .or . For fixed format source, the compiler would see the token as ornregions

0 Kudos
mecej4
Honored Contributor III
1,235 Views

It is certainly your decision whether to share your source file, but 3,000 lines is, by today's norms, small-to-medium. If you decide to share source files, zip them up along with any include, batch and data files that are needed, and attach the zip file to your reply.

You can, instead, upload the zip file to a cloud host, give public access to the uploaded file, and post the link (URL) in your reply.

0 Kudos
Reply