Compiler flags CVF compatibility

Compiler flags CVF compatibility

It seems if I use the ifl /Gm flag or the /iface:default flag the compiler ignores /Qlowercase and /us. How does one change the calling convention to stdcall to match CVF while still maintaining lowercase for external names and underscores? This legacy code that has been compiling and linking with CVF.

13 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Exactly which options did you use in CVF? I have a hard time understanding how you would want to use both /Gm and /us. What is a sample external name of a routine you are trying to call?

Steve

Steve - Intel Developer Support

Here is an example command line to create one of the object files, which is then linked with C++ objects.

df /nologo /names:lowercase /assume:underscore /assume:byterecl  /debug -c /Fo driver.f

An example of a fortran function name and its C declaration is:

extern "C" void driver_( void );

My understanding is that the calling conventions differ between ifl and df, that is/was my motivation for using /Gm. I assumed that flag would change the behaviors of ifl to match that of df.

/Gm changes some defaults to approximate CVF's defaults, but you had to go far out of your way to get CVF to match this C code.

With Intel Fortran, things are simpler for you here. You should be able to get by with /Qlowercase /us

Steve

Steve - Intel Developer Support

What about the differences between ifl and df:
calling mechanisms i.e. c vs stdcall,
mixed string length args.,
routine names. e.g. _sub@n vs _sub,
and caller or callee pops?

How are the two different default behaviors of the compilers both compatible with my set of code. I would think the code would be exclusively compatible with one or the other default mechanism.

I hope my frustration doesn't appear to be ungratefulness, as I GREALTY appreciate your help. I am trying to meet a delivery deadline, and right now this is a showstopper. And honestly I am learning much of this on the fly.

Well, none of that matters when calling a void routine, surely?

For your Fortran to Fortran calls, it will all sort out - the compiler will use a consistent mechanism. If you have C calls that involve character arguments, then things do get more complicated. Do you? And if so, are there arguments in the list after the character args?

I note in the example you gave that you did not use /iface:cref in the DF command nor did you use __stdcall in the C declaration, so you have a mismatch there - the only thing saving you is that the routine takes no arguments, but I'd think you'd get link errors because CVF would try to append @0 to the routine name.

Intel Fortran is a lot closer to C's default than CVF is.

Steve

Steve - Intel Developer Support

I think I have reconciled most of the function call issues. I do have a remaining common block / struct issue. It seems CVF appeneded underscores to my common block labels whereas the intel only appends to subroutine calls. So that when I declare an extern struct to match, it is unresolved. When I inpsected the .lib file the label was there, just without the appended underscore. Is there an easy way to correct this?
Thanks,
Todd

Not that I can think of offhand...

Steve

Steve - Intel Developer Support

After reading the Intel Fortran Compiler User's Guide for LINUX (pg 247), it appears that appending an underscore to common block labels is the default behavior of the Intel compiler for LINUX. Although the topic is not addressed in the users guide for windows, If I understand correctly, the windows version does NOT append an underscore to common block labels and there is no way to make it do so!?

Thanks,
Todd

What about the CVF flag

/assume:byterecl

what is the equivalent flag for Intel Fortran, or is this now the default behavior? I didn't see this specifically addressed anywhere.

Thanks,
Todd

I'm pretty sure Intel Fortran currently uses bytes as the RECL unit by default. Interesting question as to what we're doing for the combined release... Think I'll go ask.

Steve

Steve - Intel Developer Support

I also would like to know what RECL will be. Currently porting
an application from AIX to CVF, I would like to make a choice
between using the default and specifying /assume:byterecl
so that I wouldn't have to do it all over again for the Intel fortran.

sol

I asked - the default will be the CVF default - 4-byte units.

Steve

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today