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

Compiling with DEC/VAC and IBM/VS Extensions?

Anastasia_K_
Beginner
745 Views

I have some old legacy code I'm trying to compile, which was originally compiled on the Lahey LF90 compiler. When I tried compiling using gfortran and then ifort, the program compiled but when running the program I got vastly different results. When I talked to the original author, he said he had to specify -vax while compiling in order to compile code which uses the DEC/VAX and IBM/VS extensions. Rewriting the code is not at all a good option, as the code is ridiculously long and I haven't found any good resources saying how to convert back to regular fortran 77. 

I've been trying to find what the equivalent option with ifort is, but all I've found is -Vaxlib (which doesn't appear to exist anymore?) or -vax which didn't work at all, or things saying that it should be done automatically, which obviously wasn't the case. So what do I need to do to compile this code? 

Any help would be greatly appreciated, thanks!

0 Kudos
4 Replies
Steven_L_Intel1
Employee
745 Views

What problems do you see?  There is -vms , but this would not typically change numerical results. You might need to debug the program or add some logging to see where and why the results diverge. It may just be that the program is unstable numerically.

0 Kudos
Anastasia_K_
Beginner
745 Views

Hmm, that's very possible. As far as I could tell, the problem appeared to rise up out of the blue somewhere, some value just suddenly becoming negative. I will look more into that. When compiled on the Lahey compiler, the program performs correctly and with consistent results, but there must be some vax-specific commands that are causing weirdness. 

The problem seems to be that some of the variables are not at all the right values. I'm wondering if maybe they're being declared differently or something. I feel like I've seen something before where a variable declared improperly just spat out a random number, or something like that. I may be imagining it. 

Do you know where I could find a list of what sorts of things are different with these extensions? I've tried googling around, but I only found incomplete lists or a list of the functions available in vax but no information about them. 

 

0 Kudos
Lorri_M_Intel
Employee
745 Views

This seems like an uninitialized variable. 

By default, the Intel compiler does not initialize variables; the VAX/VMS compiler put many variables into program sections that were default-initialized by the VAX/VMS linker to be zero.

You can try using the -zero command line switch, which will do some (but not all) initializations to zero, or you can inspect the code for uninitialized uses.

                --Lorri

0 Kudos
Anastasia_K_
Beginner
745 Views

So, I took your advice and went through and initialized any variables that were flagged as uninitialized by check uninit. I tried to be very careful and make sure not to accidentally overwrite something, but I must have missed something weird because now the program is even more broken (before parts of it would give the right answer, now everything is zero and I've somehow deleted some output that was working before). 

Do you have any tips for doing this process more efficiently? There's maybe ~15,000 lines of actual code (excluding comments and such) so simply looking at it and picking out the uninitialized variables by hand is not ideal, to say the least.

0 Kudos
Reply