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

Need help in resolving conflicts in calling conventions

jond
Novice
518 Views

Hi,

I am in the process of porting a CVF application to IVF and I am having problems witha call to anIMSL routine due to, I assume, calling conventions.

The program uses a static utility library (util.lib) which in turn uses another staticlibrary (x.lib) whose source codeI don't have access to. x.lib is compiled with IVF with the followingcompiler options:

Fortran>External Procedures:

Calling Convention = STDCALL,REFERENCE

Name Case Interpretation = Lower Case

Append Underscore to External Names = Yes

Fortran>Libraries:

Runtime library = Multithreaded

I used the same settings as above and successfully built the util.lib which uses x.lib. However, when I try tobuildthe Fortran executable whichcalls an IMSL routine and uses util.lib, I getthe LNK2019 error which saysthat the particular IMSL routine name cannot beresolved.I have included theINCLUDE 'include_f90_static.h' statement in my main program. According to IVF help document, IMSL library uses exactly the opposite settings for Fortran>External Procedures options listed above. I suspect that the difference between the name case interpretations (IMSL uses Upper Case, x.lib uses Lower Case) is causing the problem.

Does anybody have an idea how I can resolve this issue?

Thanks for any help,

Jon

0 Kudos
3 Replies
Steven_L_Intel1
Employee
518 Views

The solution to this is to add the appropriate USE statement for the IMSL routines you are using, following the recommendations of the IMSL documentation. There are two variants. One is to just say:

USE NUMERICAL_LIBRARIES

The other is to add lines such as:

USE FOOBAR_INT

for (fictional) IMSL routine FOOBAR. See the IMSL manual's writeup of the routine in question to see what to use. The latter style is preferable but you may need to change your calls as sometimes the arguments are different (shown in the manual as "Fortran 90 interface".

0 Kudos
jond
Novice
518 Views
Steve,

I tried your suggestion and I am still getting the same error. Are you sure that the Name Case Interpretation option for the Fortran>External Procedures has nothing to do with this problem? Because when I set this option to Upper Case, the linker error with not finding the IMSL routine goes away but I get other linker errors saying that it can't find the routines which are actually located in my own static library. When I switch to Lower Case, then IMSL routine is not recognized, but all other routines in my static library gets recognized.

Jon
0 Kudos
Steven_L_Intel1
Employee
518 Views
I'm sure that the name case interpretation option DIDcreate the initial problem. It is my belief that the proper USE statements where you call IMSL routines should make the IMSL routines findable again. If this is not the case, please send an example to Intel Premier Support and we'll be glad to look into it.
0 Kudos
Reply