Skip to content
Prev 14199 / 398506 Next

Underscores and Fortran code

Brett Presnell <presnell at stat.ufl.edu> writes:
Probably not. I've certainly never heard of that convention before.
Given that you're not likely to be mixing your code with things
compiled with other compilers, option 2 does look viable. However,
your code might become nonportable to non-g77 compilers if they have
the convention and no way to turn it off. 

For option 3, you might change the code in do_dotCode, but how would
you replace

# define F77_CALL(x)    x ## _

with something that checks for underscores in x? That does not look
easy. 

Which leaves option 1....


There is a 4th possibility: Write your own C wrappers for the Fortran
functions and have them conditionalize properly. If you figure out how
to test for the property in configure, we might be convinced to add
the definition of (say) F77_2ND_UNDERSCORE to the relevant include
file.