<div dir="ltr"><div dir="ltr">On Mon, Jan 20, 2020 at 7:06 AM Lisandro Dalcin <<a href="mailto:dalcinl@gmail.com">dalcinl@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Mon, 20 Jan 2020 at 14:14, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Mon, Jan 20, 2020 at 3:06 AM Lisandro Dalcin <<a href="mailto:dalcinl@gmail.com" target="_blank">dalcinl@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I'm using GCC 9 from Fedora 31. A few things have changed regarding dependency generation, and things are now broken for PETSc. I do not have a clean solution to propose.<br></div><div><br></div><div>The problem is the way targets are emitted :<div><br></div><div><font face="monospace">$ head -n 3 arch-linux2-c-debug/obj/sys/objects/init.d <br>init.o: /home/devel/petsc/dev/src/sys/objects/init.c \<br> /home/devel/petsc/dev/include/petscsys.h \<br> /home/devel/petsc/dev/arch-linux2-c-debug/include/petscconf.h \</font><br><div><br></div><div>GCC now generates a bare "init.o" target. Using GCC 8 in a Manjaro box I get instead:</div><div><br></div><div><font face="monospace">$ head -n 3 arch-linux2-c-debug/obj/sys/objects/init.d<br>arch-linux2-c-debug/obj/sys/objects/init.o: \<br> /home/devel/petsc/src/sys/objects/init.c \<br> /home/devel/petsc/include/petscsys.h \<br></font></div><div><br></div><div>These differences totally break our use of dependencies:</div><div><br></div><div><span style="font-family:monospace">$ touch include/petscsys.h</span><br></div><div><font face="monospace">$ make<br>...<br>gmake[2]: Nothing to be done for 'all'.<br>...<br></font></div><div><br></div><div><br></div><div>My quick workaround so far has been to add this in makefiles:</div><div><br></div><div>C_DEPFLAGS += -MT $@<br>CXX_DEPFLAGS += -MT $@<br>FC_DEPFLAGS += -MT $@<br></div><div><br></div><div>From the GCC info page</div><div><br></div><div>'-MT TARGET'<br><br> Change the target of the rule emitted by dependency generation. By<br> default CPP takes the name of the main input file, deletes any<br> directory components and any file suffix such as '.c', and appends<br> the platform's usual object suffix. The result is the target.<br><br> An '-MT' option sets the target to be exactly the string you<br> specify. If you want multiple targets, you can specify them as a<br> single argument to '-MT', or use multiple '-MT' options.<br><br> For example, '-MT '$(objpfx)foo.o'' might give<br><br> $(objpfx)foo.o: foo.c</div></div></div></div></blockquote><div><br></div><div>Why is my GCC 9.1 not doing this?<br><br></div><div>master *$:/PETSc3/petsc/petsc-dev$ head -n 3 arch-master-debug/obj/sys/objects/init.d<br>arch-master-debug/obj/sys/objects/init.o: \<br> /PETSc3/petsc/petsc-dev/src/sys/objects/init.c \<br> /PETSc3/petsc/petsc-dev/include/petscsys.h \<br>master *$:/PETSc3/petsc/petsc-dev$ head -n 3 arch-master-gcc-debug/obj/sys/objects/init.d<br>arch-master-gcc-debug/obj/sys/objects/init.o: \<br> /PETSc3/petsc/petsc-dev/src/sys/objects/init.c \<br> /PETSc3/petsc/petsc-dev/include/petscsys.h \<br>master *$:/PETSc3/petsc/petsc-dev$ /PETSc3/petsc/gcc/bin/mpicc -show<br>/Users/knepley/MacSoftware/bin/ccache /usr/local/gcc-9.1/bin/gcc-9.1 -fstack-protector -g3 -Wl,-flat_namespace -Wl,-commons,use_dy<br>libs -I/PETSc3/petsc/gcc/include -L/PETSc3/petsc/gcc/lib -lmpi -lpmpi<br>master *$:/PETSc3/petsc/petsc-dev$ /usr/local/gcc-9.1/bin/gcc-9.1 --version<br>gcc-9.1 (GCC) 9.1.0<br>Copyright (C) 2019 Free Software Foundation, Inc.<br><br>This is free software; see the source for copying conditions. There is NO<br>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br></div><div><br></div></div></div></blockquote><div><br></div><div>Maybe this is a regression in GCC 9.2 ? The thing is that the behavior seems consistent with the documentation.</div><div><br></div><div>$ gcc --version</div>gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1)<br>Copyright (C) 2019 Free Software Foundation, Inc.<br>This is free software; see the source for copying conditions. There is NO<br>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</div></div>
</blockquote></div><br clear="all"><div>That is why I wondered. Could they have changed this between 9.1 and 9.2? It seems like a large change.</div><div><br></div><div> Matt</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>