[petsc-dev] Issue with dependency generation in GCC 9

Jed Brown jed at jedbrown.org
Mon Jan 20 08:07:37 CST 2020


Matthew Knepley <knepley at gmail.com> writes:

> On Mon, Jan 20, 2020 at 7:06 AM Lisandro Dalcin <dalcinl at gmail.com> wrote:
>
>> On Mon, 20 Jan 2020 at 14:14, Matthew Knepley <knepley at gmail.com> wrote:
>>
>>> On Mon, Jan 20, 2020 at 3:06 AM Lisandro Dalcin <dalcinl at gmail.com>
>>> wrote:
>>>
>>>> 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.
>>>>
>>>> The problem is the way targets are emitted :
>>>>
>>>> $ head -n 3 arch-linux2-c-debug/obj/sys/objects/init.d
>>>> init.o: /home/devel/petsc/dev/src/sys/objects/init.c \
>>>>  /home/devel/petsc/dev/include/petscsys.h \
>>>>  /home/devel/petsc/dev/arch-linux2-c-debug/include/petscconf.h \
>>>>
>>>> GCC now generates a bare "init.o" target. Using GCC 8 in a Manjaro box I
>>>> get instead:
>>>>
>>>> $ head -n 3 arch-linux2-c-debug/obj/sys/objects/init.d
>>>> arch-linux2-c-debug/obj/sys/objects/init.o: \
>>>>  /home/devel/petsc/src/sys/objects/init.c \
>>>>  /home/devel/petsc/include/petscsys.h \
>>>>
>>>> These differences totally break our use of dependencies:
>>>>
>>>> $ touch include/petscsys.h
>>>> $ make
>>>> ...
>>>> gmake[2]: Nothing to be done for 'all'.

Huge problem, but something is fishy; see below.

>> Maybe this is a regression in GCC 9.2 ? The thing is that the behavior
>> seems consistent with the documentation.
>>
>> $ gcc --version
>> gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1)
>> Copyright (C) 2019 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>
>
> That is why I wondered. Could they have changed this between 9.1 and 9.2?
> It seems like a large change.

Agreed that it seems like a huge and dubious change, especially for a
minor release.  My gcc is clean.

$ gcc --version
gcc (GCC) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ head -3 ompi-optg/obj/sys/objects/init.d 
ompi-optg/obj/sys/objects/init.o: /home/jed/petsc/src/sys/objects/init.c \
 /home/jed/petsc/include/petscsys.h \
 /home/jed/petsc/ompi-optg/include/petscconf.h \


>From my man page (contradicting the behavior Lisandro observed):

   -MD -MD is equivalent to -M -MF file, except that -E is not implied.  The driver
       determines file based on whether an -o option is given.  If it is, the driver uses
       its argument but with a suffix of .d, otherwise it takes the name of the input
       file, removes any directory components and suffix, and applies a .d suffix.


Lisandro, what does your man page say?


More information about the petsc-dev mailing list