[petsc-dev] RFC: allow setting flags via environment variables

Sean Farley sean.michael.farley at gmail.com
Thu Oct 9 17:59:15 CDT 2014


Barry Smith writes:

>   Sean,
>
>    We definitely want to support this ability (in our new quest to be more standards friendly, since we can’t ask others to follow standards if we don’t). 

:-)

>    Ideally BuildSystem would just know it is a package build and use those variables. Are there any special environment variables that only packagers use that we could detect to turn on this feature?

That's a tough one. I think you're asking if there is an environment
variable (or combination) that all package managers set? The answer to
that would be 'no' since autotools grabs whatever it can find from the
environment and uses that.

I have two ideas off the top of my heads:

1) Test for all compiler and flag variables. Something like:

   if (CC and CXX and FC and CFLAGS and CXXFLAGS) is set

   That seems pretty fragile to me.

2) Test if the user is the same as the logged in uesr. Most package
   managers build the package in sandboxed environment that is not the
   logged in user.

I'm open to other ideas, though :-)



More information about the petsc-dev mailing list