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

FORTRAN / C Mixed language programming

connell
Beginner
1,306 Views

I have been experimenting with FORTRAN/C mixed language programming. The documentation is a littleunclear on calling conventions bit the following seems to work ( I have access to the C and FORTRAN code)

1) Make the C routine declaration and any FORTRAN call upper case

2) No need to use __stdcal or any compiler directives

3) No worries about passing character strings -lengths now at end of argument list

This all seems to work but I am still gettinga failure I cannot trace (even with -traceback I get no tracenack). Can someone confirm this is the correct way to mix languages or do I need some compiler options/directives

Stuart Connell

0 Kudos
1 Reply
Steven_L_Intel1
Employee
1,306 Views
That's generally a good way to get interoperability without resorting to directives. Of course, you'd want to make sure that the C calls to Fortran pass arguments by address (except for string lengths.)

If you need help, please send a test case to Intel Premier Support and we'll take a look.
0 Kudos
Reply