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

Fortran conversion IA32 to Intel64 Question

bnrssmith
Beginner
482 Views
I am still relatively new to Fortran and am porting a mixed language program from IA32 to Intel64. In the original version, the C++ code makes calls to the Fortran using [C,ALIAS:'_nameOfSubroutine']. When the program tries to link under Intel64, all of these calls are listed as unresolved external symbols. I am assuming this has to do with the size of the address. Is there a way to implement this in the Intel64 platform?
0 Kudos
2 Replies
Steven_L_Intel1
Employee
482 Views
No, it has to do with default name decoration conventions which are different on the 64-bit platform. Briefly, there is no leading underscore as there is on IA-32. If you drop the underscore, it should work.

If you want to write code that works on both platforms,. remove the MS PowerStation square bracket attribute syntax and add this line instead:

!DEC$ ATTRIBUTES C, DECORATE, ALIAS:"nameOfSubroutine" :: nameOfSubroutine

Ideally, I'd recommend using the new BIND(C,NAME="nameOfSubroutine") F2003 feature but a current compiler bug would result in the same problem you have now (because the compiler assumes the name you specify is fully decorated.) That will be fixed in the next update (or so I am told.)
0 Kudos
bnrssmith
Beginner
482 Views
Thanks, problems solved.
0 Kudos
Reply