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

Wiindows Ifort compiles and runs but osx/linux ifort does not

james_r_1
Beginner
271 Views

Hello,

I have a fortran program that compiles and runs fine when compiled with windows ifort but will not work using linux ifort.  think the error has something to so with reading numbers from a file but I am not sure. 

Is there a difference in a linux fortran ifort compiled program reading integers from a file and a program compiled on windows using ifort reading from a file?

Also why would a fortran program compiled with windows ifort be ok with the following statement but if I compile the same code on linux ifort I get a undefined variable error. 

IF(hello.EQ.0)hello=3

The variable hello is not initialized but windows seems to be ok with using uninitialized variables and linux ifort is not ok with uninitialized variables. Yes I know uninitialized variables are bad, the code is older than I am......

0 Kudos
2 Replies
Lorri_M_Intel
Employee
271 Views

Generally speaking, if the same version is used on both Linux and Windows, the core part of the compiler is identical.  (that's a wild generalization of course, but still, they're basically the same)

That said, what compiler options are you using on the two systems?  It sounds like you've specified -C on Linux, but not on Windows.  Are there other differences?

                 --Lorri

 

 

0 Kudos
mecej4
Honored Contributor III
271 Views

Many old programs relied on implicit initialization of variables to zero. The statement "IF(hello.EQ.0)hello=3" suggests that your old program may do so, as well. The compiler provides the -zero option to make such code work, but it is best to bring the code into compliance with the standard by initializing variables.

0 Kudos
Reply