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

command line versus Visual Studio

Svein-Atle
Beginner
575 Views
Hello,
Usually I compile my programs from the command line using a .bat file. Recent versions of the compiler have responded with "Catastrophic error" and "Internal error" when I use the optimizing options on certain programs. In debug mode they compile.
Yesterday I compiled the same programs successfully from Visual Studio having set various optimizing options.

Does anyone know why one works and the other doesn't?

One problem that occurs quite frequently is a conflict of the libraries LIBCMTD.LIB and LIBCMT.LIB.
In Visual Studio you can specify /NODEFAULTLIB:"LIBCMTD.LIB", this option isn't available from the command line even if Ifort suggests to use this option.
It seems strange to be forced to use /MTd instead of /MT when optimizing a program.
The compiler is 11.1.038

Thank you for your help.
Regards,
Svein-Atle
0 Kudos
3 Replies
Svein-Atle
Beginner
575 Views
Please provide us with a sample of code and a command line that causes the internal compiler error. Note that if you are building a Debug configuration in Visual Studio, optimization is disabled and several other options are enabled (bounds checking, for example.)

I strongly recommend against using /NODEFAULTLIB - if you must, it goes on the command line after a /LINK switch at the end. The better solution is to compile all the sources with a consistent set of options for the run-time libraries. Note that it is the Microsoft linker, not ifort, that issues the diagnostic suggesting /NODEFAULTLIB.

Hi,
Thanks for the answers. The cause of the different behaviour was indeed that different switches were set.
As far as I can tell the switches /assume:protect_parens and /assume:realloc_lhs caused the internal error.
Unfortunately the programs that triggers this are fairly big and I haven't tried to reduce them so I can send you a sample.
Removing those two switches I thought bliss had arrived, but when I should run the program a
Program Exception - access violation occurred. The problem is a call to GESVX, an MKL routine.
Enclosed is a small program to show the problem, with two different ifort.cfg and batch files for compilation.

It is exasperating that the compiler crashes just because I set a switch. It is also extremely hard to find what caused the problem since some programs compile and others don't.

Sincerely,
Svein-Atle
0 Kudos
Steven_L_Intel1
Employee
575 Views
Unfortunately, I can't reproduce the problem using your files and 11.1.038. The program builds and runs without error.
0 Kudos
Svein-Atle
Beginner
575 Views
Unfortunately, I can't reproduce the problem using your files and 11.1.038. The program builds and runs without error.

Hi,
Thanks for the answers.
I have continued experimenting with the different switches, and as far as I can tell the problem disappear if I don't set any of the switches controlling floating point operations.

Svein-Atle
0 Kudos
Reply