<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
#pfptBanner4x79ho8 { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important;
background-color: #D0D8DC !important;
max-width: none !important; max-height: none !important }
.pfptPrimaryButton4x79ho8:hover, .pfptPrimaryButton4x79ho8:focus {
background-color: #b4c1c7 !important; }
.pfptPrimaryButton4x79ho8:active {
background-color: #90a4ae !important; }
</style>
<!-- BaNnErBlUrFlE-HeAdEr-end -->
</head><!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">
Il giorno lun 1 lug 2024 alle ore 16: 43 meator <meator. dev@ gmail. com> ha scritto: Thank you for your reply! On 7/1/24 4: 14 PM, Barry Smith wrote: > We have had well over a decade of debates on this issue. I would like to see a
</div>
<!-- Preheader Text : END -->
<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>
<!--[if ((ie)|(mso))]>
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 16px 0px 16px 0px; direction: ltr" ><tr><td>
<table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 10px 5px 6px; width: 100%; border-radius:4px; border-top:4px solid #90a4ae;background-color:#D0D8DC;"><tr><td valign="top">
<table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 4px 8px 4px 8px">
<tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; direction: ltr">
This Message Is From an External Sender
</td></tr>
<tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
This message came from outside your organization.
</td></tr>
</table>
</td></tr></table>
</td></tr></table>
<![endif]-->
<![if !((ie)|(mso))]>
<div dir="ltr" id="pfptBanner4x79ho8" style="all: revert !important; display:block !important; text-align: left !important; margin:16px 0px 16px 0px !important; padding:8px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #D0D8DC !important; background-color: #D0D8DC; border-top: 4px solid #90a4ae !important; border-top: 4px solid #90a4ae;">
<div id="pfptBanner4x79ho8" style="all: unset !important; float:left !important; display:block !important; margin: 0px 0px 1px 0px !important; max-width: 600px !important;">
<div id="pfptBanner4x79ho8" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:18px !important; line-height:18px">
This Message Is From an External Sender
</div>
<div id="pfptBanner4x79ho8" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:18px !important; line-height:18px; margin-top:2px !important;">
This message came from outside your organization.
</div>
</div>
<div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
</div>
<![endif]>
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->
<!-- BaNnErBlUrFlE-BoDy-end -->
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno lun 1 lug 2024 alle ore 16:43 meator <<a href="mailto:meator.dev@gmail.com">meator.dev@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thank you for your reply!<br>
<br>
On 7/1/24 4:14 PM, Barry Smith wrote:<br>
> We have had well over a decade of debates on this issue. I would like to see a CFLAGS+=extra_flags option but that has been resisted. Instead Satish can tell you how to get what you want.<br>
<br>
This is unfortunate. I assume that patching the buildsystem or some <br>
other trickery will be necessary if what you're saying is true.<br>
<br></blockquote><div>I admit it is not so standard, but Satish always opposed this. </div><div>No need to hack the buildsystem, just use COPTFLAGS, CXXOPTFLAGS and FOPTFLAGS</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
>> Is there a way to fix the pkg-config file (apart from manually removing cflags_extra, cxxflags_extra, and fflags_extra from the .pc file)?<br>
> <br>
> These are there so people can see EXACTLY what flags were used when PETSc was compiled. They are not intended for people using pkg-config to use PETSc when building their package. What is the harm in having these extra flags in the pkgconfig file?<br></blockquote><div><br></div><div>I don't think you should use Makefile.user. That is there as a sort of template/placeholder. The extra variables are not included in a standard usage of pkgconfig, so I don't think this issue is "severe"</div><div><br></div><div>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:21px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">$ pkg-config --cflags PETSc.pc # standard usage</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:21px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">-I/Users/szampini/Devel/petsc/arch-debug/include -I/Users/szampini/Devel/petsc/include</span></p></div><div><br></div><div>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:21px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">$ pkg-config --variable=cflags_extra PETSc.pc # non standard</span></p></div><div> <span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:Menlo;font-size:21px">-fPIC -Wall -Wwrite-strings -Wno-unknown-pragmas -fstack-protector -fno-stack-check -Qunused-arguments -fvisibility=hidden -g3 -O0</span></div><div><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:Menlo;font-size:21px"><br></span></div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Here is an excerpt from /usr/share/petsc/Makefile.user (this is a <br>
template Makefile supplied with PETSc for use in custom projects):<br>
<br>
> # Additional libraries that support pkg-config can be added to the <br>
list of PACKAGES below.<br>
> PACKAGES := $(petsc.pc)<br>
><br>
> CC := $(shell pkg-config --variable=ccompiler $(PACKAGES))<br>
> CXX := $(shell pkg-config --variable=cxxcompiler $(PACKAGES))<br>
> FC := $(shell pkg-config --variable=fcompiler $(PACKAGES))<br>
> CFLAGS_OTHER := $(shell pkg-config --cflags-only-other $(PACKAGES))<br>
> CFLAGS := $(shell pkg-config --variable=cflags_extra $(PACKAGES)) <br>
$(CFLAGS_OTHER)<br>
> CXXFLAGS := $(shell pkg-config --variable=cxxflags_extra $(PACKAGES)) <br>
$(CFLAGS_OTHER)<br>
> FFLAGS := $(shell pkg-config --variable=fflags_extra $(PACKAGES))<br>
> CPPFLAGS := $(shell pkg-config --cflags-only-I $(PACKAGES))<br>
> LDFLAGS := $(shell pkg-config --libs-only-L --libs-only-other <br>
$(PACKAGES))<br>
> LDFLAGS += $(patsubst -L%, $(shell pkg-config --variable=ldflag_rpath <br>
$(PACKAGES))%, $(shell pkg-config --libs-only-L $(PACKAGES)))<br>
> LDLIBS := $(shell pkg-config --libs-only-l $(PACKAGES)) -lm<br>
> CUDAC := $(shell pkg-config --variable=cudacompiler $(PACKAGES))<br>
> CUDAC_FLAGS := $(shell pkg-config --variable=cudaflags_extra $(PACKAGES))<br>
> CUDA_LIB := $(shell pkg-config --variable=cudalib $(PACKAGES))<br>
> CUDA_INCLUDE := $(shell pkg-config --variable=cudainclude $(PACKAGES))<br>
<br>
CFLAGS of user projects get initialized to cflags_extra for people who <br>
use the official recommended Makefile template. This is not tolerable <br>
because the flags used for building PETSc may be incompatible with <br>
unrelated projects that depend on PETSc. The build environment of the <br>
user program may be very different from the one used to build PETSc <br>
itself. Users trying to build their custom programs depending on PETSc <br>
will likely not want flags that were used to build PETSc in a fake <br>
destdir in chrooted system while building the PETSc package.<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Stefano</div></div>