[petsc-users] Weird handling of compiler flags by the build system

meator meator.dev at gmail.com
Mon Jul 1 14:53:43 CDT 2024


On 7/1/24 6:53 PM, Stefano Zampini wrote:> Since you said  "your 
package", I have a few questions:
> 
> - why do your users need to know how to compile with PETSc?

I provide two main packages: petsc and petsc-devel. petsc-devel contains 
header files, symlinks to dynamic library & more. petsc-devel should 
also be fully usable for personal development of PETSc dependent programs.

> - Shouldn't this be handled by you?

I compile PETSc. That's what the users of my package will get from me. 
But they may link with it however they wish. And since the Makefile 
method is official & provided by upstream, I don't see a reason why I 
shouldn't take care in supporting it. The extra pkg-config variables are 
not standard and most systems integrating with PETSc using pkg-config 
will simply ignore these, but that isn't true for the Makefile.user.

> - And also, can't you tell your users how to use PETSc? (for example not 
> to use the Makefile.user)

This is a decision I leave to upstream. As a packager, I try to not 
alter the functionality of programs & libraries I package, because that 
would make my packages less trustworthy. If I'd believed that 
Makefile.user should be removed (which I don't), I would first write on 
this mailing list requesting its removal from PETSc or I would create an 
issue/MR on GitLab.

>  > And /usr/share/petsc/Makefile.user or /usr/share/petsc/CMakeLists.txt 
> are officially supported ways of using PETSc,
> Those two files are not the "officially supported ways of using PETSc."
> They are examples of how to set up compilations using PETSc.

I do not view these two files as the only officially supported ways of 
linking with PETSc. If these files weren't part of PETSc, I wouldn't be 
compelled to support them. If that was the case, I would simply delete 
the offending lines in the pkg-config file. But these files are example 
build definition files provided by PETSc meant to be used in projects 
which depend on PETSc. Users of my package may or may not choose to use 
them.

> 
>  > leaving junk flags in /usr/lib/pkgconfig/petsc.pc is not tolerable 
> for me.
> 
> Those are not junk flags, since they are not part of the pkg config standard
> https://people.freedesktop.org/~dbn/pkg-config-guide.html 
> <https://people.freedesktop.org/~dbn/pkg-config-guide.html>

By "junk flags" I meant flags that were used when building PETSc for the 
petsc package. These flags got put into cflags_extra, which is then used 
in user projects thanks to Makefile.user.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x1A14CB3464CBE5BF.asc
Type: application/pgp-keys
Size: 6275 bytes
Desc: OpenPGP public key
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240701/31951de1/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240701/31951de1/attachment-0001.sig>


More information about the petsc-users mailing list