- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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......
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page