Thread: --enable-ccache configure option

--enable-ccache configure option

From
Andres Freund
Date:
Hi,

Now that there's several tools used during compilation that can benefit
from ccache I wonder if it's time to add an option to configure for
setting up ccache across the board.

ISTM --enable-ccache would simplify setup for a number of people? And it
shouldn't be hard to implement.

Greetings,

Andres Freund


Re: --enable-ccache configure option

From
Andrew Dunstan
Date:
On Fri, May 4, 2018 at 1:58 PM, Andres Freund <andres@anarazel.de> wrote:
> Hi,
>
> Now that there's several tools used during compilation that can benefit
> from ccache I wonder if it's time to add an option to configure for
> setting up ccache across the board.
>
> ISTM --enable-ccache would simplify setup for a number of people? And it
> shouldn't be hard to implement.
>


What exactly would it do? I use ccache all the time, have for years,
but it's not clear to me what can usefully be done by configure.

cheers

andrew

-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: --enable-ccache configure option

From
Andres Freund
Date:
On 2018-05-04 17:04:38 -0400, Andrew Dunstan wrote:
> On Fri, May 4, 2018 at 1:58 PM, Andres Freund <andres@anarazel.de> wrote:
> > Hi,
> >
> > Now that there's several tools used during compilation that can benefit
> > from ccache I wonder if it's time to add an option to configure for
> > setting up ccache across the board.
> >
> > ISTM --enable-ccache would simplify setup for a number of people? And it
> > shouldn't be hard to implement.
> >
> 
> 
> What exactly would it do? I use ccache all the time, have for years,
> but it's not clear to me what can usefully be done by configure.

Use ccache without having to set it up individually for CC, CLANG, CXX.

Greetings,

Andres Freund


Re: --enable-ccache configure option

From
Andrew Dunstan
Date:
On Fri, May 4, 2018 at 5:07 PM, Andres Freund <andres@anarazel.de> wrote:
> On 2018-05-04 17:04:38 -0400, Andrew Dunstan wrote:
>> On Fri, May 4, 2018 at 1:58 PM, Andres Freund <andres@anarazel.de> wrote:
>> > Hi,
>> >
>> > Now that there's several tools used during compilation that can benefit
>> > from ccache I wonder if it's time to add an option to configure for
>> > setting up ccache across the board.
>> >
>> > ISTM --enable-ccache would simplify setup for a number of people? And it
>> > shouldn't be hard to implement.
>> >
>>
>>
>> What exactly would it do? I use ccache all the time, have for years,
>> but it's not clear to me what can usefully be done by configure.
>
> Use ccache without having to set it up individually for CC, CLANG, CXX.
>

Ah, I see. Not a bad idea. The only thing is it should look to make
sure these aren't already set up with ccache - if they are it should
leave them alone. It's also possible to set up ccache in a transparent
mode, where you don't have to call ccache explicitly. Not sure what
the implications of that would be.

cheers

andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: --enable-ccache configure option

From
Alvaro Herrera
Date:
Andres Freund wrote:

> > On Fri, May 4, 2018 at 1:58 PM, Andres Freund <andres@anarazel.de> wrote:

> > > ISTM --enable-ccache would simplify setup for a number of people? And it
> > > shouldn't be hard to implement.
> > 
> > What exactly would it do? I use ccache all the time, have for years,
> > but it's not clear to me what can usefully be done by configure.
> 
> Use ccache without having to set it up individually for CC, CLANG, CXX.

Umm, I just add /usr/lib/ccache somewhere in PATH (ahead of the compiler
binaries) which is enough to make it all work.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: --enable-ccache configure option

From
Tom Lane
Date:
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Andres Freund wrote:
>>> What exactly would it do? I use ccache all the time, have for years,
>>> but it's not clear to me what can usefully be done by configure.

>> Use ccache without having to set it up individually for CC, CLANG, CXX.

> Umm, I just add /usr/lib/ccache somewhere in PATH (ahead of the compiler
> binaries) which is enough to make it all work.

On my preferred distros (ie Red Hat), ccache is used automatically;
there is nothing that needs to be done in configure AFAIK.  (It looks
like this happens by dint of the same thing Alvaro mentions, ie the
standard PATH has /usr/lib(64)?/ccache in front of the actual compilers.)
It'd be important not to break such setups in trying to make it happen
elsewhere.

            regards, tom lane