<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
I can certainly can use the find rule but the fact that it isnt part of the petsc distro complicates things more for me than the patch does.<br>
<br>
-------- Opprinnelig melding --------<br>
Fra: Satish Balay <balay@mcs.anl.gov> <br>
Dato: 13.10.2015 18.13 (GMT+01:00) <br>
Til: Arne Morten Kvarving <Arne.Morten.Kvarving@sintef.no> <br>
Ko: petsc-users <petsc-users@mcs.anl.gov> <br>
Emne: Re: [petsc-users] petsc cmake config - BUILD_SHARED_LIBS <br>
<br>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Jed might have better suggestion [wrt cmake code and petsc]<br>
<br>
You might have to explain why you can't use FindPETSc.cmake - and need<br>
PETScConfig.cmake.<br>
<br>
Satish<br>
<br>
<br>
<br>
On Tue, 13 Oct 2015, Arne Morten Kvarving wrote:<br>
<br>
> Right. Then I will keep patching as there is no other easy way to use petsc in a portable way. Too many defines used in too many headers for me to do bother writing my own find rule.<br>
> <br>
> Thanks for your answers.<br>
> <br>
> <br>
> -------- Opprinnelig melding --------<br>
> Fra: Satish Balay <balay@mcs.anl.gov><br>
> Dato: 13.10.2015 17.53 (GMT+01:00)<br>
> Til: Arne Morten Kvarving <Arne.Morten.Kvarving@sintef.no><br>
> Ko: petsc-users <petsc-users@mcs.anl.gov><br>
> Emne: Re: [petsc-users] petsc cmake config - BUILD_SHARED_LIBS<br>
> <br>
> As mentioned - PETScConfig.cmake is primarily for building PETSc - and<br>
> not equivalent to .pc file<br>
> <br>
> It gets used when 'make all-cmake' is used instead of the default<br>
> 'make all' to build petsc libraries.<br>
> <br>
> [This mode is deprecated - and not properly tested - and I see its currenty broken]<br>
> <br>
> Jed had a tool FindPETSc.cmake - which is a tool for the user to<br>
> detect petsc config via cmake.<br>
> <br>
> <a href="https://github.com/jedbrown/cmake-modules/" target="_BLANK">https://github.com/jedbrown/cmake-modules/</a><br>
> <br>
> Is this what you are using?<br>
> <br>
> Satish<br>
> <br>
> On Tue, 13 Oct 2015, Arne Morten Kvarving wrote:<br>
> <br>
> > Yes I am aware and i can reset and such.<br>
> > This is about the why, not the how. The config file has nothing to do with the petsc build system, it is for users of petsc, like a .pc file (pkgconfig).<br>
> ><br>
> > The code in question builds a number of convenience libraries for shared code between multiple apps. I want these static at times but in general shared for installs. This I control using the intended cmake mechanism - namely the BUILD_SHARED_LIBS variable.
 Petsc breaks this since it overrides the value passed by the user.<br>
> ><br>
> > I would rather avoid hacking my buildsystem to workaround petsc bugs. Right now i need to deploy a patched petsc everywhere for this reason - to remove the useless variable writing in the cmake config file. Because as you say shared libs should normally
 be used.<br>
> ><br>
> ><br>
> > -------- Opprinnelig melding --------<br>
> > Fra: Satish Balay <balay@mcs.anl.gov><br>
> > Dato: 13.10.2015 16.56 (GMT+01:00)<br>
> > Til: Arne Morten Kvarving <Arne.Morten.Kvarving@sintef.no><br>
> > Ko: petsc-users@mcs.anl.gov<br>
> > Emne: Re: [petsc-users] petsc cmake config - BUILD_SHARED_LIBS<br>
> ><br>
> > Well the current code has the option of building petsc via cmake [but<br>
> > this mode is deprecated - and the default build uses straight gnumake]<br>
> ><br>
> > So if you configure PETSc with --shared-libraries=1 [default] - this<br>
> > flag is set in conf/PETScConfig.cmake<br>
> ><br>
> > So you can rebuild petc with --shared-libraries=0 - and this flag will<br>
> > go away.<br>
> ><br>
> > BTW: I'm not sure why this affects your application. [as applications<br>
> > don't build libraries]. Or is it that you have a library that builds<br>
> > over PETSc?<br>
> ><br>
> > [in this case - it generally makes sense to build it as shared anyway]<br>
> ><br>
> > Also - I'm guessing - there must be a way for you to reset this variable in<br>
> > your cmake config - if thats whats requred by your app.<br>
> ><br>
> > Jed should be able to confirm..<br>
> ><br>
> > Satish<br>
> ><br>
> ><br>
> > On Tue, 13 Oct 2015, Arne Morten Kvarving wrote:<br>
> ><br>
> > > hi there;<br>
> > ><br>
> > > why does the cmake config file set the BUILD_SHARED_LIBS variable? this<br>
> > > affects all buildsystem where the config file is included, and has 0 effect on<br>
> > > the actual petsc side of things.<br>
> > ><br>
> > > i don't see why petsc should decided whether i want to use static libraries in<br>
> > > my application or not.<br>
> > > i can keep hacking around it, or supply a patch to get rid of it. but i<br>
> > > figured i'd ask for the reasoning first.<br>
> > ><br>
> > > if this should have gone to -dev, i'm sorry. i thought it fit better here.<br>
> > ><br>
> > > arnem<br>
> > ><br>
> > ><br>
> ><br>
> ><br>
> <br>
> <br>
</div>
</span></font>
</body>
</html>