title: ccache and precompiled header
body: <p>I'm using precompiled header and CCACHE to speed up my compilation (GCC 5.3.1)</p>
  
  <p>The two works separatly (I have a speed up x2 for precompiled, and x25 for CCACHE on second run), but I have trouble to make them work together (I have only cache miss when looking at CCACHE stats).</p>
  
  <p>Do you see any reason why ccache could not manage to work with precompiled header ?</p>
  
  <p>Here are the CCACHE stats</p>
  
  <pre><code>cache directory                     /work1/heyho/cache/ccache
  primary config                      /work1/heyho/cache/ccache/ccache.conf
  secondary config      (readonly)    /etc/ccache.conf
  cache hit (direct)                     1
  cache hit (preprocessed)               0
  cache miss                          1016
  called for link                       12
  compile failed                         1
  files in cache                      1490
  cache size                         627.1 MB
  max cache size                       5.0 GB
  </code></pre>
  
  <p>Here is an example of CCACHE log (on second run)</p>
  
  <pre><code>[x] === CCACHE 3.2.1 STARTED =========================================
  [x] Config: (default) base_dir =
  [x] Config: (environment) cache_dir = /work1/gwen/cache/ccache
  [x] Config: (default) cache_dir_levels = 2
  [x] Config: (default) compiler =
  [x] Config: (default) compiler_check = mtime
  [x] Config: (default) compression = false
  [x] Config: (default) compression_level = 6
  [x] Config: (default) cpp_extension =
  [x] Config: (default) direct_mode = true
  [x] Config: (default) disable = false
  [x] Config: (default) extra_files_to_hash =
  [x] Config: (default) hard_link = false
  [x] Config: (environment) hash_dir = true
  [x] Config: (environment) log_file = /tmp/cache.debug
  [x] Config: (default) max_files = 0
  [x] Config: (/work1/gwen/cache/ccache/ccache.conf) max_size = 5.0G
  [x] Config: (default) path =
  [x] Config: (environment) prefix_command =
  [x] Config: (default) read_only = false
  [x] Config: (default) read_only_direct = false
  [x] Config: (default) recache = false
  [x] Config: (default) run_second_cpp = false
  [x] Config: (/work1/gwen/cache/ccache/ccache.conf) sloppiness = time_macros
  [x] Config: (default) stats = true
  [x] Config: (default) temporary_dir =
  [x] Config: (default) umask =
  [x] Config: (default) unify = false
  [x] Command line: ccache /usr/bin/c++ -DUSE_PRECOMPILED -Dbluevision_EXPORTS -fPIC -I/usr/local/include/opencv -I/usr/local/include -I/work-crypt/gwen/workspace/bluecime/bluevision/src -I/work-crypt/gwen/workspace/bluecime/bluevision/build/None_Linux-4.4.14-200.fc22.x86_64/src -std=c++11 -fPIC -Werror -Wall -march=corei7-avx -mavx -msse4.1 -msse4.2 -fabi-version=6 -mavx2 -Winvalid-pch -include precompiled_header.hpp -o CMakeFiles/bluevision.dir/descriptor/histogram/integral_image.cpp.o -c /work-crypt/gwen/workspace/bluecime/bluevision/src/descriptor/histogram/integral_image.cpp
  [x] Hostname: kernavo.com
  [x] Working directory: /work-crypt/gwen/workspace/bluecime/bluevision/build/None_Linux-4.4.14-200.fc22.x86_64/src
  [x] Detected use of precompiled header: precompiled_header.hpp.gch
  [x] Source file: /work-crypt/gwen/workspace/bluecime/bluevision/src/descriptor/histogram/integral_image.cpp
  [x] Object file: CMakeFiles/bluevision.dir/descriptor/histogram/integral_image.cpp.o
  [x] Trying direct lookup
  [x] Looking for object file hash in /work1/gwen/cache/ccache/3/9/67544dd3c9bebe61712bf8bcc68c23-10829.manifest
  [x] Did not find object file hash in manifest
  [x] Running preprocessor
  [x] Executing /usr/bin/c++ -fPIC -std=c++11 -fPIC -Werror -Wall -march=corei7-avx -mavx -msse4.1 -msse4.2 -fabi-version=6 -mavx2 -Winvalid-pch -DUSE_PRECOMPILED -Dbluevision_EXPORTS -I/usr/local/include/opencv -I/usr/local/include -I/work-crypt/gwen/workspace/bluecime/bluevision/src -I/work-crypt/gwen/workspace/bluecime/bluevision/build/None_Linux-4.4.14-200.fc22.x86_64/src -include precompiled_header.hpp -fpch-preprocess -E /work-crypt/gwen/workspace/bluecime/bluevision/src/descriptor/histogram/integral_image.cpp
  [x] Got object file hash from preprocessor
  [x] Object file /work1/gwen/cache/ccache/c/b/960271b46a4eb133ebec4407f8b799-193981.o not in cache
  [x] Running real compiler
  [x] Executing /usr/bin/c++ -fPIC -std=c++11 -fPIC -Werror -Wall -march=corei7-avx -mavx -msse4.1 -msse4.2 -fabi-version=6 -mavx2 -Winvalid-pch -c -o CMakeFiles/bluevision.dir/descriptor/histogram/integral_image.cpp.o /work1/gwen/cache/ccache/tmp/integral_i.stdout.kernavo.com.27724.BLT8ks.ii
  [x] Unlink /work1/gwen/cache/ccache/c/b/960271b46a4eb133ebec4407f8b799-193981.o.tmp.stdout.kernavo.com.27724.x1URnV
  [x] Unlink /work1/gwen/cache/ccache/c/b/960271b46a4eb133ebec4407f8b799-193981.o.tmp.stderr.kernavo.com.27724.rxhBqo.2
  [x] Unlink /work1/gwen/cache/ccache/c/b/960271b46a4eb133ebec4407f8b799-193981.o.tmp.stderr.kernavo.com.27724.rxhBqo
  [x] Copying CMakeFiles/bluevision.dir/descriptor/histogram/integral_image.cpp.o to /work1/gwen/cache/ccache/c/b/960271b46a4eb133ebec4407f8b799-193981.o via /work1/gwen/cache/ccache/c/b/960271b46a4eb133ebec4407f8b799-193981.o.kernavo.com.27724.vTjTiS (uncompressed)
  [x] Stored in cache: CMakeFiles/bluevision.dir/descriptor/histogram/integral_image.cpp.o -&gt; /work1/gwen/cache/ccache/c/b/960271b46a4eb133ebec4407f8b799-193981.o
  [x] Copying /work1/gwen/cache/ccache/c/b/960271b46a4eb133ebec4407f8b799-193981.o to CMakeFiles/bluevision.dir/descriptor/histogram/integral_image.cpp.o via CMakeFiles/bluevision.dir/descriptor/histogram/integral_image.cpp.o.kernavo.com.27724.BJzcbm (uncompressed)
  [x] Created from cache: /work1/gwen/cache/ccache/c/b/960271b46a4eb133ebec4407f8b799-193981.o -&gt; CMakeFiles/bluevision.dir/descriptor/histogram/integral_image.cpp.o
  [x] Added object file hash to /work1/gwen/cache/ccache/3/9/67544dd3c9bebe61712bf8bcc68c23-10829.manifest
  [x] Unlink /work1/gwen/cache/ccache/tmp/integral_i.stdout.kernavo.com.27724.BLT8ks.ii
  [x] Unlink /work1/gwen/cache/ccache/tmp/integral_i.stdout.kernavo.com.27724.BLT8ks
  [x] Unlink /work1/gwen/cache/ccache/tmp/tmp.cpp_stderr.kernavo.com.27724.jae35Z
  [x] Acquired lock /work1/gwen/cache/ccache/c/stats.lock
  [x] Releasing lock /work1/gwen/cache/ccache/c/stats.lock
  [x] Unlink /work1/gwen/cache/ccache/c/stats.lock
  [x] Result: cache miss
  [x] Unlink /work1/gwen/cache/ccache/a/3/7ac45e9e75fedfd804f2aeb01e5ed0-126212.o.tmp.stdout.kernavo.com.27876.eFOVH2
  [x] Unlink /work1/gwen/cache/ccache/a/3/7ac45e9e75fedfd804f2aeb01e5ed0-126212.o.tmp.stderr.kernavo.com.27876.a4kQ4O.2
  [x] Unlink /work1/gwen/cache/ccache/a/3/7ac45e9e75fedfd804f2aeb01e5ed0-126212.o.tmp.stderr.kernavo.com.27876.a4kQ4O
  [x] Copying CMakeFiles/bluevision.dir/descriptor/descriptor_spatio.cpp.o to /work1/gwen/cache/ccache/a/3/7ac45e9e75fedfd804f2aeb01e5ed0-126212.o via /work1/gwen/cache/ccache/a/3/7ac45e9e75fedfd804f2aeb01e5ed0-126212.o.kernavo.com.27876.sLSNVB (uncompressed)
  [x] Stored in cache: CMakeFiles/bluevision.dir/descriptor/descriptor_spatio.cpp.o -&gt; /work1/gwen/cache/ccache/a/3/7ac45e9e75fedfd804f2aeb01e5ed0-126212.o
  [x] Copying /work1/gwen/cache/ccache/a/3/7ac45e9e75fedfd804f2aeb01e5ed0-126212.o to CMakeFiles/bluevision.dir/descriptor/descriptor_spatio.cpp.o via CMakeFiles/bluevision.dir/descriptor/descriptor_spatio.cpp.o.kernavo.com.27876.CBXLMo (uncompressed)
  [x] Created from cache: /work1/gwen/cache/ccache/a/3/7ac45e9e75fedfd804f2aeb01e5ed0-126212.o -&gt; CMakeFiles/bluevision.dir/descriptor/descriptor_spatio.cpp.o
  [x] Added object file hash to /work1/gwen/cache/ccache/0/c/677d29d2a852e11bc8ea97fdc27fda-9012.manifest
  [x] Unlink /work1/gwen/cache/ccache/tmp/descriptor.stdout.kernavo.com.27876.4mA1kg.ii
  [x] Unlink /work1/gwen/cache/ccache/tmp/descriptor.stdout.kernavo.com.27876.4mA1kg
  [x] Unlink /work1/gwen/cache/ccache/tmp/tmp.cpp_stderr.kernavo.com.27876.4r9fHu
  [x] Acquired lock /work1/gwen/cache/ccache/a/stats.lock
  [x] Releasing lock /work1/gwen/cache/ccache/a/stats.lock
  [x] Unlink /work1/gwen/cache/ccache/a/stats.lock
  [x] Result: cache miss
  </code></pre>