second underscore

Hello all,

is there a way to append a second underscore to some (not all) subroutine names (linked
from an external library) ? I know IBM’s xlf allows for this possibility.

My problem is that our vendor compiled mpich with the pg compilers and then went
on to compile some math libraries with the pg compilers and some with the gnu compilers.

Peter

Hi Peter,

The “-Msecond_underscore” will universally add a second underscore but I don’t think this is what you want. I’m assuming that the calls are mixed in your source code so there is no easy way of doing this.

My first thought is to manually append an underscore to those functions which need the second underscore. You could also use the preprocessor to do this where you add a “#include mydefs.h” to all your source files. “mydefs.h” would then be just a #defines like “#define myfunc myfunc_”. You need to use the “-Mpreprocess” flag of change your file extension to “.F” or “.F90” to envoke the preprocessor.

Hope this helps,

  • Mat