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

Getting MPI to work with iface:cvf

cathleenmcguiness
826 Views
Hi,

I've compiled a dll with Intel MPI libs (Package ID: w_mpi_p_4.0.1.007, Package Contents: Intel MPI Library 4.0 Update 1 for Windows* OS) and Intel Visual Fortran Compiler Professional for applications running on IA-32, Version 11.1 , Build 20100806 Package ID: w_cprof_p_11.1.067.

To get this to work, iface:cvf must be "off".

However, I need to include the files generated from this compilation in the compilation of another dll which will not compile unless iface:cvf is active. This second dll is comprised of source files and object files provided by another company and I cannot change any of the compiler options they've told me to use or the second dll won't compile.

Does anyone have any ideas on how I can get around this, I have to get it to work somehow?

Any help would be much appreciated!

Cathleen
0 Kudos
5 Replies
Steven_L_Intel1
Employee
826 Views
You can use !DEC$ ATTRIBUTES to specify all behaviors implied by /iface:cvf, and I encourage you to do so. Basically it's:

!DEC$ ATTRIBUTES STDCALL,REFERENCE,MIXED_STR_LEN_ARG,DECORATE,ALIAS:"SUBNAME" :: subname
0 Kudos
cathleenmcguiness
826 Views
Thanks for your help but I'm afraid that didn't work, I get the message

error LNK2019: unresolved external symbol _DarsEsm@112 referenced in function
_ENGCOMBUSER EngCylinder_Combustion.obj

where DarsEsm is my routine (that has all the attributes) and EngCylinder _Combustion is the external source file in which I'm trying to call DarsEsm.

Any other ideas?
0 Kudos
Jugoslav_Dujic
Valued Contributor II
826 Views
Thanks for your help but I'm afraid that didn't work, I get the message

error LNK2019: unresolved external symbol _DarsEsm@112 referenced in function
_ENGCOMBUSER EngCylinder_Combustion.obj

where DarsEsm is my routine (that has all the attributes) and EngCylinder _Combustion is the external source file in which I'm trying to call DarsEsm.

Any other ideas?

The ALIAS:"SUBNAME" must match the name as exported from the Dll. You can verify what you are actually exporting from the dll using DUMPBIN command-line tool, or better still, Dependency Walker.

If you do not use the DECORATE+ALIAS in the dll, you don't need it in the caller either -- remove them from the inteface in the calling routine, and it should just work.

0 Kudos
cathleenmcguiness
826 Views
Okay, I had to move some stuff around and do a little dummy wrapper but it appears to run properly now.

Thanks!
0 Kudos
Steven_L_Intel1
Employee
826 Views
You do need DECORATE and ALIAS because STDCALL, by itself, downcases the routine name.
0 Kudos
Reply