- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
12 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is an example command line to create one of the object files, which is then linked with C++ objects.
An example of a fortran function name and its C declaration is:
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/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
With Intel Fortran, things are simpler for you here. You should be able to get by with /Qlowercase /us
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Thanks,
Todd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not that I can think of offhand...
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Thanks,
Todd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What about the CVF flag
Thanks,
Todd
/assume:bytereclwhat is the equivalent flag for Intel Fortran, or is this now the default behavior? I didn't see this specifically addressed anywhere.
Thanks,
Todd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I asked - the default will be the CVF default - 4-byte units.
Steve
Steve

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