Community
cancel
Showing results for 
Search instead for 
Did you mean: 
rudi-gaelzer
New Contributor I
308 Views

Diagnostics file and console

Jump to solution

Using:

Fedora Linux 30

Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.1.2 Bu
ild 20201208_000000

I'm compiling a Fortran code from the console with the option

-diag-file=<filename>

However, besides generating the desired file with the diagnostics, the compiler also prints the warning message on the console:

ifort: command line warning #10287: the previously set diagnostic file output option is being overridden by '-diag-file=<filename>'

I don't want to see this message, that's why I'm choosing a diagnostics file.  

How do I turn off these warnings on the console?

 

0 Kudos

Accepted Solutions
rudi-gaelzer
New Contributor I
217 Views

Perhaps I was not clear enough about what I want to do.

If I try to compile:

PROGRAM error_source
implicit none
REAL*8 ABC
IsdfNTEGER :: I4B
END PROGRAM error_source

With: 

$>ifort -c -warn all -diag-file=error_source.diag error_source.f90 &> /dev/null

I don't get the warning #10287 printed on the console, but the file error_source.diag is created with:

$>more error_source.diag 
error_source.f90(4): error #5082: Syntax error, found '::' when expecting one of: ( : % [ . = =>
IsdfNTEGER :: I4B
-----------^
error_source.f90(4): error #6404: This name does not have a type, and must have an explicit type.   [ISDFN
TEGER]
IsdfNTEGER :: I4B
^
error_source.f90(4): error #6404: This name does not have a type, and must have an explicit type.   [I4B]
IsdfNTEGER :: I4B
--------------^
error_source.f90(3): remark #7712: This variable has not been used.   [ABC]
REAL*8 ABC
-------^

This is what I want.

View solution in original post

15 Replies
mecej4
Black Belt
274 Views

You did not state all the options that were specified (directly or implicitly).

It can be tricky to get the compiler to show you only the warnings that you want to see, and hide the rest.

rudi-gaelzer
New Contributor I
264 Views

Nothing very fancy.  I'm just using a response file and "-module" and "-diag-file" options:

ifort -c  @<responsef>.cfg  -module <path> -diag-file=<diagf>.diag <sourcef>.f90

Steve_Lionel
Black Belt Retired Employee
256 Views

So what's in the .cfg file?

rudi-gaelzer
New Contributor I
252 Views

Other compiler options.

I'm writing a bash script to automate the compilation process and the use of configuration files is an optional argument for the script.

rudi-gaelzer
New Contributor I
244 Views

Some people suggested that I should simply redirect stderr (with &> /dev/null).

It works, but if there's a builtin solution, I'd like to know.

Steve_Lionel
Black Belt Retired Employee
235 Views

If you're going to conceal necessary information, we can't help you.

You might try calling COMPILER_OPTIONS from intrinsic module ISO_FORTRAN_ENV and see if it provides any clues.

mecej4
Black Belt
230 Views

Rudy G: "Some people suggested that I should simply redirect stderr (with &> /dev/null)."

That could be considered irresponsible. Rather than redirect to /dev/null, redirect to a file, read that file and do something responsible in response to what gets written to that file.

I don't understand why you explicitly ask for diagnostic information and then complain when the compiler obeys your request.

rudi-gaelzer
New Contributor I
226 Views

Erm... but it doesn't...

According to my tests, any warnings/remarks/error messages during compilation are still written on the diagnostics file.

It's just the warning

 ifort: command line warning #10287: the previously set diagnostic file output option is being overridden by '-diag-file=<diagf>.diag'

that is concealed. 

But this is just what I want.  If I KNOW that any warnings/remarks/errors will be written on a diagnostics file of my choosing, I don't need to be reminded of the fact...

rudi-gaelzer
New Contributor I
218 Views

Perhaps I was not clear enough about what I want to do.

If I try to compile:

PROGRAM error_source
implicit none
REAL*8 ABC
IsdfNTEGER :: I4B
END PROGRAM error_source

With: 

$>ifort -c -warn all -diag-file=error_source.diag error_source.f90 &> /dev/null

I don't get the warning #10287 printed on the console, but the file error_source.diag is created with:

$>more error_source.diag 
error_source.f90(4): error #5082: Syntax error, found '::' when expecting one of: ( : % [ . = =>
IsdfNTEGER :: I4B
-----------^
error_source.f90(4): error #6404: This name does not have a type, and must have an explicit type.   [ISDFN
TEGER]
IsdfNTEGER :: I4B
^
error_source.f90(4): error #6404: This name does not have a type, and must have an explicit type.   [I4B]
IsdfNTEGER :: I4B
--------------^
error_source.f90(3): remark #7712: This variable has not been used.   [ABC]
REAL*8 ABC
-------^

This is what I want.

View solution in original post

JohnNichols
Valued Contributor I
211 Views

In 1978 I was taught a very valuable lesson in Fortran for Beginners at the University of Newcastle. 

At the moment I am following that advice for MYSQL and Fortran 

Read the manual. 

It is usually that simple or google it. 

rudi-gaelzer
New Contributor I
198 Views

RTFM?

Yeah... I'm doing it (all 2679 pages of it) and googling  too...

But, if you forgive my candor, that's not a very polite answer and it's quite unhelpful and useless... you could have simply ignored my post...

You could give this "advice" to about half of the questions raised in this forum, but fortunately there are people out there that still are willing to spare some of their busy schedule to try and help others.

JohnNichols
Valued Contributor I
193 Views

Actually, when someone does not answer it usually means

1. Read the manual - implicit in no answer from the small group who answer most of the questions

2. The question is obvious and you should be able to work it out yourself

But sometimes people answer and others get offended, but I was trying to tell you - you would likely get no  more answers as the responses were getting terse. 

It also helps if you give more information so people understand what you are trying to do.  

For instance there has been a lot of questions on linking FORTRAN to Abaqus - yet there are literally hundreds of pages on how to do it - including good Indian videos.  The questions are from students, although as a Professor you are reluctant to answer the questions as they might be an assignment. 

Anyway good luck, but my initial thought was - move to a good IDE that does the compilation for you. 

 

FortranFan
Honored Contributor I
182 Views
@rudi-gaelzer,
.. I don't get the warning #10287 printed on the console, but the file error_source.diag is created with:
..
This is what I want

@rudi-gaelzer ,

You may be familiar with -diag-disable and the options that go along with it:

https://software.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide...

Unfortunately -diag-disable=10287 does not seem to work whereas it does with other remark #s such as -diag-disable=7712.

So if your subscription permits, I suggest you submit a support request at the Intel Online Center and see what Intel Fortran support thinks of it:

https://supporttickets.intel.com/servicecenter?lang=en-US

Otherwise. you can hope someone from the Support staff notices your item of interest and posts their feedback.

In spite of the questionable comments upthread. you have come to the right place compared to comp.lang.fortran since the matter pertains intimately with Intel Fortran.

By the way, for general discussions involving Fortran, I suggest you also consider this Fortran Discourse site:

https://fortran-lang.discourse.group/

Cheers,

 

JohnNichols
Valued Contributor I
165 Views

@rudi-gaelzer ,

I did not intend rudeness - if taken that way then I apologize. 

There was an interesting quote this morning on the Lakeland Cam -- worth a look  - it is at the bottom. 

If we use a query from @ojacquet this morning as an example.  

@ojacquet  asked about an invalid attempt to assign into a pointer that is not associated. 

A quite interesting question about Fortran and Linux. 

The question was asked on 19th at 5:56 pm. 

The question gave the perfect outline as suggested in a recent post by @mecej4  responding to a question I asked. It is about as good a query as you get. 

@Steve_Lionel responded at 6:05 pm assuming the same time zone, that is 9 minutes. Which is without doubt an excellent response time.  He asked as to the compiler version, which is the one item  missed from @mecej4  list of standard items. 

Clearly @ojacquet was awaiting a response as thye replied 3 minutes later which is immediate given the likely need to find the version.  Thye if you do a statistical analysis of the "I he she they" group, then this is the one remaining sensible 4 word letter from the standard set of letters used in this set to allow for a non-gender specific personal pronoun.  It is better than saying he/she.

@Steve_Lionel  replied 3 minutes later to say use the latest compiler.  A fairly standard response and excellent advice. 

@ojacquet replied at 02:56 am to say thye <you see I cannot tell if the writer is a boy or a girl so to avoid offence one avoids the gender> could not afford the latest compiler. 

Here a search using google would have turned up the extremely less than obvious answer that the Intel Compliers are now free.  Whilst it is a low probability that Intel would stop charging it is always worth a look to see if there is a free trial etc.  I did that recently with Abaqus. 

@mecej4  replied at 04:05 am to explain that the version was now free.  

In following this response, I can offer the following comment that I would give any of the 120 students I am teaching at the moment, "do a Google search, look for a free version,  try the Linux gfortran first." I would send these emails a few times a day just the response after "do a Google search changes."   

I would be quite happy to do the test, but my Linux computer will not load Fortran - it is a Raspberry PI.  

@mecej4 is giving the best advice, which can be translated into colloquial Australian as "have a go mate" here the mate is taken in the non-gender specific outback Australian form - like Who's your mate? No idea, found them in the bush a bit lost, but sling them a beer, he is parched.  Here I make the interesting statistical assumption that someone lost in the Australian bush is a bloke, commenting on the ability of some Australian men to get lost in Pitt Street on a Sunday with a police person on every corner to ask a question, but your average Australian bloke does not need no stinking map.  The psychology of the Average Australian Male is interesting to say the least. 

Of course @ojacquet has lost about 18 hours awaiting a response. Now the best part of the conversation is that it represents a social economic exchange between @ojacquet  and the rather statistically small group who answer questions on this board, who I have collectively nicknamed the Titans.  @mecej4 is gently telling @ojacquet  - it is ok, calm down, one reads this from the simple calming language in his text, <I am reasonably certain that @mecej4 is male so used his, of course I could be wrong, but I doubt it. > And @mecej4 kindly provides the link. 

But the emphasis from @mecej4 is you are likely going to have to give it a go with the latest compiler and then report.  The implicit statement is - you can do it. 

------------------------------------------------------------------------------------

The most important element is the social economic exchange to say - it is ok, calm down, you are capable but try the new compiler first. 

Which is a good response for a cry for help in the night.  

--------------------------------------------------------------------------------------

But::

There are some unsolvable problems in computing:

you cannot wake a windows computer on a wifi - cell phone by sending a wlan call - if you read the deep deep literature Microsoft and the others on the committee decided this feature was not needed as it was hard. 

You have trouble running sensors that use a ethernet port on a Linux box if you have a ethernet link on the box as well. One gets switched off.  I have watched some Linux experts get stumped with this one and I gave up and just use Windows for the sensor. 

Or ask God why the length of a selection of a set of random numbers in the range 0 to 1 will add to greater than one after e numbers on average.  It is easy to prove, but does not answer the deeper question as to why -1, 0, 1, e and PI are such special numbers. 

Or the deeper question of why I am sideways with one of the Titans. 

Anyway good hunting. 

 

 

Many of life's failures are people who did not realize how close they were to success when they gave up.

Thomas A. Edison

 

rudi-gaelzer
New Contributor I
125 Views
Indeed, I tried the -diag-disable=10287 option and it did not work for me either.
The workaround I found with '&> /dev/null' is working for me. All other diagnostic reports are being written to the diag file. So, I marked that post as the accepted solution.
I'm already subscribed to the Fortran Discourse group as well as to the Google comp.lang.fortran group.
Thanks for all the other suggestions. I'll look into them.