<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Mar 19, 2016 at 11:49 AM, Satish Balay <span dir="ltr"><<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, 19 Mar 2016, Matthew Knepley wrote:<br>
<br>
> On Sat, Mar 19, 2016 at 11:29 AM, Satish Balay <<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>> wrote:<br>
><br>
> > This code is a bit convoluted..<br>
> ><br>
> > There is CPP, CPPFLAGS, CXXCPP, CXXCPPFLAGS. But then no FPP or FPPFLAGS..<br>
> ><br>
><br>
> Is this really true? Is the Fortran preprocessors not the C preprocessor? I<br>
> have never encountered this.<br>
> If you want flags which are different for C, use CFLAGS. Am I missing<br>
> something?<br>
<br>
</span>Even if we assume CPPFLAGS are -D only - it wont' work with all FC<br>
compilers. For ex: xlf does not recognize -D option - its -WF,-D.<br>
So we cannont assume FC always uses CPP [or CPPFLAGS]<br>
<br>
And some flags have to be used at compile time only - and some can be<br>
used at both compile & linktime - and some at linktime only.<br>
<br>
So we have CPPFLAGS, CFLAGS, LDFLAGS [not compiler specific?]<br>
<br>
In this case -Qunused-arguments can go into CFLAGS - but presumably<br>
there are other compiler flags that cannot be used at link time - so<br>
have to use with CPPFLAGS only?<br>
<br>
And this whole thread started with clang barfing on using a link flag during compile time..<br>
<span class=""><br>
Executing: /Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/openmpi-1.10.2-37xieeupgsteaq6btru6wmhxfi44xqtn/bin/mpicc -c -o<br>
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/petsc-8RPaEA/config.setCompilers/conftest.o<br>
-I/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/petsc-8RPaEA/config.setCompilers<br>
/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/petsc-8RPaEA/config.setCompilers/conftest.c<br>
Possible ERROR while running compiler:<br>
stderr:<br>
clang: warning: argument unused during compilation:<br>
'-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/boost-1.60.0-eo7nn3v27nxa7lxqv5tttjzikshwt56i/lib'<br>
clang: warning: argument unused during compilation:<br>
'-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/bzip2-1.0.6-leelnsg3humpngfeofkrdpgtsofrm5ya/lib'<br>
clang: warning: argument unused during compilation:<br>
'-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/openmpi-1.10.2-37xieeupgsteaq6btru6wmhxfi44xqtn/lib'<br>
<br>
<br>
</span>So having proper support for CFLAGS, CPPFLAGS, FLAGS, FPPFLAGS might be the correct thing to do..</blockquote><div><br></div><div>Won't that be incredibly confusing for the 99% of people who use Fortran that uses the C preprocessor?</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888"><br>
Satish<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
> Matt<br>
><br>
><br>
> > And then base.py has: [which is wrong for 'Cxx', 'FC'?]<br>
> ><br>
> > def getPreprocessorFlagsName(self, language):<br>
> > if language in ['C', 'Cxx', 'FC']:<br>
> > flagsArg = 'CPPFLAGS'<br>
> > elif language == 'CUDA':<br>
> > flagsArg = 'CUDAPPFLAGS'<br>
> > else:<br>
> > raise RuntimeError('Unknown language: '+language)<br>
> > return flagsArg<br>
> ><br>
> > And config/compile/FC.py has [which reuses CPP,CPPFLAGS for FC]:<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>
> ><br>
> > Matt - should we have FPP,FPPFLAGS supported here?<br>
> ><br>
> > Perhaps using CPPFLAGS with FC is a bug? So we should atleast do:<br>
> ><br>
> > diff --git a/config/BuildSystem/config/compile/FC.py<br>
> > b/config/BuildSystem/config/compile/FC.py<br>
> > index 3d0bf74..7bae24d 100644<br>
> > --- a/config/BuildSystem/config/compile/FC.py<br>
> > +++ b/config/BuildSystem/config/compile/FC.py<br>
> > @@ -13,6 +13,7 @@ class Preprocessor(config.compile.C.Preprocessor):<br>
> > config.compile.C.Preprocessor.__init__(self, argDB)<br>
> > self.language = 'FC'<br>
> > self.targetExtension = '.F'<br>
> > + self.flagsName = ''<br>
> > self.includeDirectories = sets.Set()<br>
> > return<br>
> ><br>
> > And then [I'm not sure where this gets used..]<br>
> ><br>
> > $ git diff config/BuildSystem/config/base.py |cat<br>
> > diff --git a/config/BuildSystem/config/base.py<br>
> > b/config/BuildSystem/config/base.py<br>
> > index b18a173..8b1129d 100644<br>
> > --- a/config/BuildSystem/config/base.py<br>
> > +++ b/config/BuildSystem/config/base.py<br>
> > @@ -454,8 +454,12 @@ class Configure(script.Script):<br>
> ><br>
> > # Should be static<br>
> > def getPreprocessorFlagsName(self, language):<br>
> > - if language in ['C', 'Cxx', 'FC']:<br>
> > + if language == 'C':<br>
> > flagsArg = 'CPPFLAGS'<br>
> > + elif language == 'Cxx':<br>
> > + flagsArg = 'CXXCPPFLAGS'<br>
> > + elif language == 'FC':<br>
> > + flagsArg = ''<br>
> > elif language == 'CUDA':<br>
> > flagsArg = 'CUDAPPFLAGS'<br>
> > else:<br>
> ><br>
> ><br>
> > Satish<br>
> ><br>
> > On Sat, 19 Mar 2016, Denis Davydov wrote:<br>
> ><br>
> > > Hi Satish,<br>
> > ><br>
> > > I think you have a bug in you config system as<br>
> > "CPPFLAGS=-Qunused-arguments" propagate to fortran compiler even when I try<br>
> > to explicitly specify "FPPFLAGS=" to nothing :<br>
> > ><br>
> > > TEST checkFortranCompiler from<br>
> > config.setCompilers(/private/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/davydden/spack-stage/spack-stage-jNBTET/petsc-3.6.3/config/BuildSystem/config/setCompilers.py:919)<br>
> > > TESTING: checkFortranCompiler from<br>
> > config.setCompilers(/private/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/davydden/spack-stage/spack-stage-jNBTET/petsc-3.6.3/config/BuildSystem/config/setCompilers.py:919)<br>
> > > Locate a functional Fortran compiler<br>
> > > Checking for program<br>
> > /Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/openmpi-1.10.2-37xieeupgsteaq6btru6wmhxfi44xqtn/bin/mpif90...found<br>
> > > Defined make macro "FC" to<br>
> > "/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/openmpi-1.10.2-37xieeupgsteaq6btru6wmhxfi44xqtn/bin/mpif90"<br>
> > > Pushing language FC<br>
> > > Executing:<br>
> > /Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/openmpi-1.10.2-37xieeupgsteaq6btru6wmhxfi44xqtn/bin/mpif90<br>
> > -c -o<br>
> > /var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/petsc-zwyqnZ/config.setCompilers/conftest.o<br>
> > -I/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/petsc-zwyqnZ/config.setCompilers<br>
> > -Qunused-arguments<br>
> > /var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/petsc-zwyqnZ/config.setCompilers/conftest.F<br>
> > > Possible ERROR while running compiler: exit code 256<br>
> > > stderr:<br>
> > > gfortran: error: unrecognized command line option '-Qunused-arguments’<br>
> > ><br>
> > > Kind regards,<br>
> > > Denis<br>
> > ><br>
> > > > On 18 Mar 2016, at 19:13, Satish Balay <<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>> wrote:<br>
> > > ><br>
> > > > Or you can workarround by using additional PETSc configure option:<br>
> > > ><br>
> > > > CPPFLAGS=-Qunused-arguments<br>
> > > > [or CFLAGS?]<br>
> > > ><br>
> > > > Satish<br>
> > > ><br>
> > > ><br>
> > > > On Fri, 18 Mar 2016, Satish Balay wrote:<br>
> > > ><br>
> > > >> your mpicc is barfing stuff on stderr - thus confusing petsc<br>
> > configure.<br>
> > > >><br>
> > > >> I don't see this issue with the old openmpi I have access to..<br>
> > > >><br>
> > > >> What do you have for:<br>
> > > >><br>
> > > >><br>
> > /Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/openmpi-1.10.2-37xieeupgsteaq6btru6wmhxfi44xqtn/bin/mpicc<br>
> > -show<br>
> > > >> touch foo.c<br>
> > > >><br>
> > /Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/openmpi-1.10.2-37xieeupgsteaq6btru6wmhxfi44xqtn/bin/mpicc<br>
> > -c foo.c -show<br>
> > > >><br>
> > > >> I'm not sure what to suggest.. Perhaps you can use --download-mpich<br>
> > > >> [or --download-openmpi] - but then I see you are building all these<br>
> > > >> packages using spack - so perhaps you should check with 'spack' folk..<br>
> > > >><br>
> > > >> Satish<br>
> > > >><br>
> > > >> ---------<br>
> > > >><br>
> > > >> Executing:<br>
> > /Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/openmpi-1.10.2-37xieeupgsteaq6btru6wmhxfi44xqtn/bin/mpicc<br>
> > -c -o<br>
> > /var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/petsc-8RPaEA/config.setCompilers/conftest.o<br>
> > -I/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/petsc-8RPaEA/config.setCompilers<br>
> > /var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/petsc-8RPaEA/config.setCompilers/conftest.c<br>
> > > >> Possible ERROR while running compiler:<br>
> > > >> stderr:<br>
> > > >> clang: warning: argument unused during compilation:<br>
> > '-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/boost-1.60.0-eo7nn3v27nxa7lxqv5tttjzikshwt56i/lib'<br>
> > > >> clang: warning: argument unused during compilation:<br>
> > '-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/bzip2-1.0.6-leelnsg3humpngfeofkrdpgtsofrm5ya/lib'<br>
> > > >> clang: warning: argument unused during compilation:<br>
> > '-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/openmpi-1.10.2-37xieeupgsteaq6btru6wmhxfi44xqtn/lib'<br>
> > > >> clang: warning: argument unused during compilation:<br>
> > '-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/hwloc-1.11.2-pxsmp4nhfdjc3jb7odj5lhppu7wqna5b/lib'<br>
> > > >> clang: warning: argument unused during compilation:<br>
> > '-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/libpciaccess-0.13.4-erc6tr3ghndi5ed3gbj6wtvw6zl4vobf/lib'<br>
> > > >> clang: warning: argument unused during compilation:<br>
> > '-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/zlib-1.2.8-cyvcqvrzlgurne424y55hxvfucvz2354/lib'<br>
> > > >> clang: warning: argument unused during compilation:<br>
> > '-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/hdf5-1.8.16-diujq2w7ew4qviquh67b3lkcqsxtf77y/lib'<br>
> > > >> clang: warning: argument unused during compilation:<br>
> > '-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/hypre-2.10.1-4kql32qmjpp7ict2qczkyyv6a4mbrgbl/lib'<br>
> > > >> clang: warning: argument unused during compilation:<br>
> > '-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/openblas-0.2.16-qplsxnxlbaqnz2iltdo7fdhlayvuaxel/lib'<br>
> > > >> clang: warning: argument unused during compilation:<br>
> > '-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/metis-5.1.0-i5y5b6r5ca4f77u5tketagpkn6joxasp/lib'<br>
> > > >> clang: warning: argument unused during compilation:<br>
> > '-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/ncurses-6.0-sabhdwxbdbbapfo6wodglfmyo6u3c3hj/lib'<br>
> > > >> clang: warning: argument unused during compilation:<br>
> > '-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/openssl-1.0.2g-answvmhu3lodpmgulgzryygkkimmsn34/lib'<br>
> > > >> clang: warning: argument unused during compilation:<br>
> > '-L/Users/davydden/spack/opt/spack/darwin-x86_64/clang-7.0.2-apple/parmetis-4.0.3-auubrjcwhqmqnpoqjwgwgz4bcjnxzunx/lib'<br>
> > > >><br>
> > > >> On Fri, 18 Mar 2016, Denis Davydov wrote:<br>
> > > >><br>
> > > >>> Dear all,<br>
> > > >>><br>
> > > >>> Although I saw this issue on the mailing list, that was related to<br>
> > broken compilers, i don’t think it’s the case here as `mpicc -E` seems to<br>
> > be ok.<br>
> > > >>> Log is attached.<br>
> > > >>><br>
> > > >>> Kind regards,<br>
> > > >>> Denis<br>
> > > >>><br>
> > > >>><br>
> > > >><br>
> > ><br>
> > ><br>
> ><br>
><br>
><br>
><br>
> </div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>