From 52fe2cdb1b1f3b129f0bde80558b1a5e7b5a0b7f Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Sat, 25 Apr 2020 15:34:33 +0200 Subject: [PATCH] Add docs on how to use CCache --- doc/users/cmake_dealii.html | 46 ++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/doc/users/cmake_dealii.html b/doc/users/cmake_dealii.html index 3a8630fd72..cb9e1de1d2 100644 --- a/doc/users/cmake_dealii.html +++ b/doc/users/cmake_dealii.html @@ -49,6 +49,7 @@
  • Component selection
  • Build configuration
  • Selecting a compiler
  • +
  • Compiling using Ccache
  • Installation
  • @@ -814,7 +815,7 @@ cmake -DLAPACK_FOUND=true \ linkage of executables. Enabling this option forces BUILD_SHARED_LIBS=OFF and DEAL_II_PREFER_STATIC_LIBS=ON. - +
  • CMAKE_INSTALL_RPATH_USE_LINK_PATH: If set (default), the deal.II library will be @@ -894,6 +895,49 @@ cmake -DDEAL_II_CXX_FLAGS="-Wno-sign-compare" <...>

    + +

    Compiling using Ccache

    +

    + Ccache is a compiler caching tool. It + accelerates recompilation by caching previously executed compilations + and subsequently detecting when the same compilation is being performed + again. +

    + +

    + It is possible for the library to be built using the Ccache tool. + This may be useful for those who frequently rebuild the library, as it + caches the output of the compilation (the C++ components, at least). + The next time that the library is built, if the compilation objects remain + the same then rebuilding them can be avoided as the results will be taken + from directly the cache. Anecdotally, Ccache is not well suited to + everybody's workflow, so it may take some experimentation to determine if + it's effective and helpful, or offers no particular gain to you. +

    + +

    + Building with Ccache can be enabled directly via the command line. + When using a version of CMake that is greater or equal to 3.4, then using + Ccache is easy. Passing the configure-time argument +

    +  -DCXX_COMPILER_LAUNCHER="ccache"
    +
    + to Cmake ensures that Ccache is invoked whenever C++ code is compiled. +

    + +

    + For older versions of CMake, Ccache may be invoked by prefixing the + compiler commands passed to CMake by environment or configure-time + variables. For example, if building using GCC then +

    +  -DCMAKE_C_COMPILER="ccache gcc" -DCMAKE_CXX_COMPILER="ccache g++"
    +
    + would indicate that ccache should invoke the GCC compilers to build deal.II. + Ccache itself is invoked when calling make or + ninja. +

    + +

    Installation

    -- 2.39.5