Search This Blog

Tuesday, November 18, 2008

The underscore symbol between C and FORTRAN

When a C function is called from FORTRAN routine, the C function should end with '_'.  In other words, a C function 'myfun_' should be called as 'myfun' in a FORTRAN code.  Actually this is an old paradigm between GNU C and FORTRAN compilers. Current GNU FORTRAN compiler, gfortran, does not follow this rule, and so does Intel compilers.   This is actually a serious problem in compiling BLACS and SCALAPACK libraries.

In compiling BLACS, Bmake.inc file should have an option:

INTFACE = -DAdd_

and in compiling SCALAPACK, SLmake.inc should have:

CDEFS     = -DAdd_

This option depends on compliers.



No comments:

Labels

Blog Archive