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

Intel Fortran Compilng from older versions

bbrust
Beginner
351 Views
I have been having some strange problems withrunning a code which easily compiled and ran on older versions of compilers (eg. Compaq). It possibly has to do with compile options. Sometimes I can get a program to compile and run in release mode and fail in debug mode. Sometimes the opposite occurs for simliar code. One issue is a situation where an integer is 0 valued the first time it encounters a statement. Such as:
Do 100 I=1,10
N=0
IF(LCON(N).GT.0) THEN ....
N=I+1
100 CONTINUE

The first time in this loop, when N=0, the code sometimes crashes in debug mode, and works in Release mode, or vice-versa, depending on compiler options. This may be sloppy coding (which always worked in old versions of compiler) and should be changed. However, I would like a quick fix is one is clear. Thanks, Bud Brust
0 Kudos
2 Replies
bmchenry
New Contributor II
351 Views
If you have a project that works in one more and crashes in the other (debug v release), i would suggest you simply compare the options of the two (you can do this simply by opening 2 versions of the compiler on the same project and setting one to debug and the other to release. Judicious choice of window size and location will allow you to directly compare the options between the two. Be sure to close and not save 'the working' version and then save the one you changed last (otherwsie you will simply overwrite the changes!)

It probably has to do with some array bounds checking, conformity checking, of some sort and/or optimization issues.

Of course i would strongly suggest you fix the problems with theprograms (declare the array 0:whatever so avoid the 0 address error you cite in your example and/or find out why it is you are getting some of the errors).

The 'compare debug/release' options is mainly to see what options are producing the errors and then that will assist in finding where the errors are occuring, etc.

0 Kudos
Les_Neilson
Valued Contributor II
351 Views
Quoting - bmchenry
It probably has to do with some array bounds checking, conformity checking, of some sort and/or optimization issues.

Of course i would strongly suggest you fix the problems with theprograms (declare the array 0:whatever so avoid the 0 address error you cite in your example and/or find out why it is you are getting some of the errors).

I would strongly agree about fixing the errors. If your array is dimensioned (1:m) and you access element (0) then that clearly is an error, and the fact that it appeared to work in the pastwould bepurely fortuitous, an accident waiting to happen. Over the years compilershave been getter better at identifying coding errors such as array bounds subscript errors.

Les
0 Kudos
Reply