[petsc-users] How do I supply the compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS

Smith, Barry F. bsmith at mcs.anl.gov
Tue May 28 10:14:59 CDT 2019



> On May 28, 2019, at 10:01 AM, Lisandro Dalcin <dalcinl at gmail.com> wrote:
> 
> 
> 
> On Tue, 28 May 2019 at 17:31, Balay, Satish via petsc-users <petsc-users at mcs.anl.gov> wrote:
> Configure.log shows '--with-pic=1' - hence this error.
> 
> Remove '--with-pic=1' and retry.
> 
> 
> Nonsense. Why this behavior? Building a static library with PIC code is a perfectly valid use case. 

   Indeed it is. But for that case PETSc's configure requires the user to pass the appropriate flag for PIC in through the compiler flags. (Should be better documented EXACTLY how)

   The reason for this nonsense design feature is that Configure does not know how to check for appropriate PIC flags unless Configure has turned on shared libraries for PETSc. It is rather convoluted; I'd love if someone fixed it but obviously Jed, Satish, and I (who agree with you that this is utter nonsense) are not brave enough to muck with that portion of configure.

 

> 
> -- 
> Lisandro Dalcin
> ============
> Research Scientist
> Extreme Computing Research Center (ECRC)
> King Abdullah University of Science and Technology (KAUST)
> http://ecrc.kaust.edu.sa/



More information about the petsc-users mailing list