<div><div dir="auto">You will want to test IBM XLF and Cray Fortran compilers. These two have weirdness that has required NWChem to use cpp in the past (and present, most likely).</div></div><div dir="auto"><br></div><div dir="auto">XLF might be fine except the compiler flag is -WF,-DFOO=BAR rather than -DFOO=BAR. Your build system is probably smart enough to avoid that issue. NWChem’s isn’t.</div><div dir="auto"><br></div><div dir="auto">Cray’s Fortran preprocessor is painfully strict and refuses innocuously recursive preprocessing. If you’re relying on anything non-standard, they’ll probably catch it. </div><div dir="auto"><br></div><div dir="auto">Jeff</div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Aug 11, 2019 at 2:44 PM Smith, Barry F. via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov">petsc-dev@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Matt and Satish,<br>
<br>
Years ago we had to sometimes use the C preprocessor for preprocessor Fortran code. Isn't that no longer needed?<br>
<br>
In FC.py there is <br>
<br>
class Preprocessor(config.compile.C.Preprocessor):<br>
'''The Fortran preprocessor, which now is just the C preprocessor'''<br>
def __init__(self, argDB):<br>
config.compile.C.Preprocessor.__init__(self, argDB)<br>
self.language = 'FC'<br>
self.targetExtension = '.F90'<br>
self.includeDirectories = sets.Set()<br>
return<br>
<br>
class Compiler(config.compile.processor.Processor):<br>
'''The Fortran compiler'''<br>
<br>
<br>
which implies that C preprocessor is still handing around the Fortran. Now when all the Fortran compiler flags are generated with getFlags() it seems to include those from CPPFLAGS?<br>
<br>
Is this correct now? I don't think it should be? Should there be a separate FCCPPFLAGS? Bad things happen in the current situation when I set CPPFLAGS needed for clang but not for gfortran when MPICH is configured the CPPFLAGS are passed to the FCFLAGS which breaks things. <br>
<br>
I cannot find the exact line of code when the FFLAGS and CPPFLAGS are merged together for Fortran but I assume it is <br>
<br>
def getFlags(self):<br>
'''Returns a string with the flags specified for running this processor.'''<br>
if not hasattr(self, '_flags'):<br>
flagsName = self.flagsName[:]<br>
if <a href="http://self.name" rel="noreferrer" target="_blank">self.name</a> == <a href="http://self.compiler.name" rel="noreferrer" target="_blank">self.compiler.name</a>:<br>
flagsName.extend(self.compiler.flagsName)<br>
if hasattr(self, 'configCompilers'):<br>
flags = ' '.join([getattr(self.configCompilers, name) for name in flagsName])<br>
else:<br>
flags = ' '.join([self.argDB[name] for name in flagsName])<br>
return flags<br>
return self._flags<br>
flags = property(getFlags, config.compile.processor.Processor.setFlags, doc = 'The flags for the executable')<br>
<br>
<br>
How can this be fixed?<br>
<br>
Thanks<br>
<br>
Barry<br>
<br>
<br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Jeff Hammond<br><a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a></div>