I am in the process of stitching two large fortran programs together, but the two programs have a large number of subroutine names in common. These namespace conflicts cause the linker to fail, of course, with lots of messages like
tinker//libtinker.a(sort.o)(.text+0x0): In function `sort_': : multiple definition of `sort_' /exports/localmqm-ix86_64-linux/SVNControlled/molpro2006.1/trunk//lib/libmolpro.a(cirs2util3.o)(.text+0x7a30):/exports/localmqm-ix86_64-linux/SVNControlled/molpro2006.1/trunk/src/mrci/cirs2util3.f:1787: first defined here
for when two subroutine names clash, and
/usr/bin/ld: Warning: alignment 16 of symbol `files_' in /exports/localmqm-ix86_64-linux/SVNControlled/molpro2006.1/trunk//lib/libmolpro.a(modules_sapt.o) is smaller than 32 in tinker//libtinker.a(readxyz.o)
for two common blocks conflict.
Does anyone know of some way to prevent these conflicts, without actually going into the source and changing all the names by hand?
One avenue that I am investigating: I know that pgf90 appends underscores to all fortran objects - is there perhaps a compiler flag to change this behavior?