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, file should have an option:


and in compiling SCALAPACK, should have:

CDEFS     = -DAdd_

This option depends on compliers.

No comments:


Blog Archive