# CCACHE in FreeBSD 10.0-RELEASE



## nanotek (Feb 9, 2014)

According to /usr/local/share/doc/ccache/ccache-howto-freebsd.txt[0], to make devel/ccache work with ports you just need to add WITH_CCACHE_BUILD=yes to /etc/make.conf[1]. However, it doesn't appear to be working:

`ccache -s`

```
cache directory                     /root/.ccache
cache hit (direct)                     0
cache hit (preprocessed)               0
cache miss                             0
files in cache                         0
cache size                             0 Kbytes
max cache size                       1.0 Gbytes
```

That's after building nearly 200 ports with Poudriere, which has ccache enabled:

`grep CCACHE /usr/local/etc/poudriere.conf`

```
CCACHE_DIR=/var/cache/ccache
```

`ls /var/cache/`

```
pkg
```

What am I missing? Thanks.


[0] /usr/local/share/doc/ccache/ccache-howto-freebsd.txt


			
				ccache said:
			
		

> To use ccache for ports, just add WITH_CCACHE_BUILD=yes to
> /etc/make.conf. The rest of this guide is for building
> /usr/src and other checkouts.



[1] /etc/make.conf

```
WITH_CCACHE_BUILD=yes
CCACHE_CPP2=1
```


----------



## worldi (Feb 9, 2014)

1. The directory shown in the `ccache -s` output differs from the one you've specified in poudriere.conf. To see statistics for a cache directory other than the default set `CCACHE_DIR` accordingly:

```
env CCACHE_DIR=/var/cache/ccache  ccache -s
```

2. /var/cache/ccache does not exist. The wiki suggest to create it:

```
mkdir /var/cache/ccache
```


----------



## nanotek (Feb 10, 2014)

Thanks, @worldi.

`env CCACHE_DIR=/var/cache/ccache  ccache -s`

```
cache directory                     /var/cache/ccache
cache hit (direct)                     0
cache hit (preprocessed)               0
cache miss                             0
files in cache                         0
cache size                             0 Kbytes
max cache size                       1.0 Gbytes
```

Still no sign of ccache being used.

We'll see if creating the directory works. Perhaps /usr/local/share/doc/ccache/ccache-howto-freebsd.txt should be updated.


----------

