I am trying to compile a windows executable of a CFD code that is mixed language – composed mostly of fortran file with a few c-files for memory allocation handling. The code is a legacy code that I am porting.
After the code files have been compiled and during the linking process, I get several “undefined reference to ‘filename_’” where filename is the name of the corresponding c-routine. Some of the file names have underscores in them, and hence I know it can be problematic with compilers, especial between c and fortran.
I am using the -Munix compiler flag in order to get around other problems already encountered during the compilation process.
I have tried using both -Msecond_underscore and
-Mnosecond_underscore compiler options, but neither solve the problem. I have tried manually appending an underscore to the function names as well.
What is the trick in PGI to get the automatic single underscore append to stop messing up the linking process. Perhaps someone could explain what the rule is for automatic appending underscore characters.