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

How do I add decoration to imported subroutines?

ferrad01
Beginner
857 Views
Our build machine compiles a Fortran file using v9.1.024. Doing a dumpbin on the object shows that a routine imported from a linked-in library is specified as AYNUMI@0 and is indeed represented as such in the (CVF generated) lib file.

However my machine is on v9.1.037, and a dumpbin on the object created from exactly the same ifort command line shows that object is now looking for AYNUMI, ie. without the decoration. My link therefore fails as the lib indeed exports AYNUMI@0.

Any idea how to add the decoration that was removed presumably as a default during the changes from 24 to 37?

I tried various ALIAS'ing in an INTERFACE statement without any luck.


0 Kudos
5 Replies
TimP
Honored Contributor III
857 Views
ifort should not have defaulted to stdcall; you should have had to use one of the mechanisms for specifying it. If INTERFACE doesn't work in the calling function according to
INTERFACE
SUBROUTINE AYNUMI
!DEC$ ATTRIBUTES STDCALL, DECORATE::AYNUMI
END SUBROUTINE AYNUMI
END INTERFACE
you might want to submit your case on premier.intel.com. Of course, this mechanism is available only for 32-bit Windows, so it's not ideal to continue to work with mixed CVF/IVF builds.
0 Kudos
ferrad01
Beginner
857 Views

I already submitted to premier.intel.com with a test case but my expression of urgency is not appreciated. Hence my post here.

I have:

interface

subroutine AYNUMI ()

!DEC$ ATTRIBUTES STDCALL, REFERENCE, DECORATE :: AYNUMI
!DEC$ ATTRIBUTES MIXED_STR_LEN_ARG, ALIAS: "AYNUMI" :: AYNUMI

IMPLICIT NONE
end subroutine
end interface

0 Kudos
Steven_L_Intel1
Employee
857 Views
This is weird. To fix it, take off the () after "subroutine AYNUMI". I'll make sure the developers know about this. What's your Premier Support issue number?
0 Kudos
Steven_L_Intel1
Employee
857 Views
Also, please be aware that if the CVF-compiled routine makes ANY calls to the language support run-time library, you cannot use it with Intel Fortran and must recompile it.

The () can be omitted if there are no arguments to the subroutine.
0 Kudos
ferrad01
Beginner
857 Views

Excellent it worked by removing the () !!!

Many thanks Steve. I guess something changed between 24 and 37.

PS. The premier support number is: 443668

0 Kudos
Reply