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

moving from CVF -> IntelF: dflib:getarg

forall
Beginner
1,135 Views
I am gradually porting a large fortran static library that has some Fortran Windows routines, in particular 'use dflib,only:getarg'. The whole thing worked nicely under cvf.
When compiling with intel fortran this routine is no longer recognised (name in list does not exist). Has it changed name or been replaced by something better :-) ? thanks.

Message Edited by forall on 01-31-2005 05:31 PM

0 Kudos
11 Replies
Steven_L_Intel1
Employee
1,135 Views
Yep - getarg is now an intrinsic in Intel Fortran, so just remove the USE line entirely.
0 Kudos
forall
Beginner
1,135 Views
thanks Steve. Is there a way to do a 'smart' port, so that the file contains some compiler directives that instructs the Intel compiler to ignore the use dflib line, but allows CVF to see it? That way I can avoid maintaining 2 copies differing in a single 'uninteresting line'. I have heard about these compiler directives but never used them - some startup hints would be appreciated.
0 Kudos
forall
Beginner
1,135 Views
one more thing I noticed about the compilation under CVF6.6 vs Intel Fortran 8.1 is that 8.1 seems MUCH more resource hungry. in particular compiling a project with about 20 files or so took ~1min on CVF and max RAM usage was 500MB or so (note winXP has 240MB 'baseline metabolic rate'). Conversely exactly the same files on the 8.1 took ~10min and peak RAM usage rocketed to 1GB. Now, on a 1.7GHz Pentium-M with 1.5GB of RAM I can live with the slower compiler for the moment, but nevertheless such large factor of difference is bothersome. In particular it would imply a significant slowdown if the machine happens to have <=1GB of RAM, which is the case for many many machines out there. Browsing the forum it seems others have also encountered such issues - I wonder whether there is an identifiable reason for this ?
0 Kudos
Steven_L_Intel1
Employee
1,135 Views
Well, the 8.1 compiler does a lot more in the way of optimization, but there are certainly cases where it uses much more memory than CVF did. If you have particular sources that demonstrate this, please send them to us at Intel premier Support.

Here's how you can modify your code so that it can compile with both compilers.

Replace the use line with the following:

!DEC$ IF DEFINED (__INTEL_COMPILER)
! GETARG is intrinsic in Intel Fortran
!DEC$ ELSE
use dfport, only: getarg
!DEC$ ENDIF
0 Kudos
forall
Beginner
1,135 Views
thanks again Steve. btw, what is the corresponding flag for CVF (if I wanted to differentiate between CVF vs Intel vs others?
0 Kudos
forall
Beginner
1,135 Views
also, I hit a similar problem with FOR_CHECK_FLAWED_PENTIUM. I doubt this is needed nowdays though, right?
0 Kudos
Steven_L_Intel1
Employee
1,135 Views
I agree that FOR_CHECK_FLAWED_PENTIUM is unlikely to be of any benefit today.

_VF_VER is defined by CVF and Intel Fortran but not, as far as I know, by other compilers. I don't think there are any symbols uniquely defined by CVF.
0 Kudos
forall
Beginner
1,135 Views
Steve,

_VF_VER works for what I wanted - thanks.

Also, is _VF_VER defined by IFORT? I am also thinking about an $DEC IF directive that differentiates between Windows and Linux versions of the compilers, and chooses a corresponding INCLUDE file.

Essentially I am after something along the lines
!DEC$ IF [windows, either CVF or Intel]
INCLUDE 'file.win'
!DEC$ ELSE
INCLUDE 'file.dum'
!DEC$ ENDIF

Ideally, I would like the 'INCLUDE file.win' line to be only be visible to Windows versions of CVF and Intel Fortran compilers, but this not as crucial.

Can somethinbg like this be achieved?

thanks,
Dmitri

Message Edited by forall on 01-31-2005 11:27 PM

0 Kudos
Steven_L_Intel1
Employee
1,135 Views
Yes, _VF_VER is defined by ifort. You could try _WIN32, which is alwsys defined by CVF and ifort on Windows.
0 Kudos
forall
Beginner
1,135 Views
Steve,
thanks for the help. these directives are definitely rather handy - they already saved me quite a bit of hussle.
now, is there any way to have a compiler-specific command. eg,
!DEC$ INCLUDE "file.inc"
basically, I am trying to make an INCLUDE statement visible to CVF and Intel Fortran, but not to other compilers. I tried the above line and it generated errors (I didnt quite expect it to work as is, though).
Am I trying to push these directives too hard?
regards,
Dmitri
0 Kudos
Steven_L_Intel1
Employee
1,135 Views
There is no !DEC$ INCLUDE. The way you would normally approach this is by using cpp-style conditional compilation. So you would use:

#ifdef _vf_ver
include 'some-vf-specific file
#endif

This would require, with CVF/ifort, that you compile with /fpp. Other compilers tend to have similar options.
0 Kudos
Reply