Skip to content
Permalink
master
Switch branches/tags
Go to file
Asciidoctor seems to:

- Provide a nice left-hand side table of contents.
- Have nicer looking defaults.
- Be faster.
- Have less (but non-zero) quirks.
5 contributors

Users who have contributed to this file

@jrosdahl @AlexanderLanin @Zero-1729 @erijo @cristianadam

Ccache installation

Prerequisites

To build ccache you need:

  • CMake 3.10 or newer.

  • A C++14 compiler. See Supported platforms, compilers and languages for details.

  • A C99 compiler.

  • libzstd. If you don't have libzstd installed and can't or don't want to install it in a standard system location, there are two options:

    1. Install zstd in a custom path and set CMAKE_PREFIX_PATH to it, e.g. by passing -DCMAKE_PREFIX_PATH=/some/custom/path to cmake, or
    2. Pass -DZSTD_FROM_INTERNET=ON to cmake to make it download libzstd from the Internet and unpack it in the local binary tree. Ccache will then be linked statically to the locally built libzstd.

    To link libzstd statically you can use -DZSTD_LIBRARY=/path/to/libzstd.a.

Optional:

  • hiredis for the Redis storage backend. If you don't have libhiredis installed and can't or don't want to install it in a standard system location, there are two options:

    1. Install hiredis in a custom path and set CMAKE_PREFIX_PATH to it, e.g. by passing -DCMAKE_PREFIX_PATH=/some/custom/path to cmake, or
    2. Pass -DHIREDIS_FROM_INTERNET=ON to cmake to make it download hiredis from the Internet and unpack it in the local binary tree. Ccache will then be linked statically to the locally built libhiredis.

    To link libhiredis statically you can use -DHIREDIS_LIBRARY=/path/to/libhiredis.a.

  • GNU Bourne Again SHell (bash) for tests.

  • Asciidoctor to build the HTML documentation.

  • Python to debug and run the performance test suite.

Installation

Here is the typical way to build and install ccache:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
make install

You can set the installation directory to e.g. /usr by adding -DCMAKE_INSTALL_PREFIX=/usr to the cmake command. You can set the directory where the secondary configuration file should be located to e.g. /etc by adding -DCMAKE_INSTALL_SYSCONFDIR=/etc.

There are two ways to use ccache. You can either prefix your compilation commands with ccache or you can create a symbolic link (named as your compiler) to ccache. The first method is most convenient if you just want to try out ccache or wish to use it for some specific projects. The second method is most useful for when you wish to use ccache for all your compilations.

To install for usage by the first method just copy ccache to somewhere in your path.

To install for the second method, do something like this:

cp ccache /usr/local/bin/
ln -s ccache /usr/local/bin/gcc
ln -s ccache /usr/local/bin/g++
ln -s ccache /usr/local/bin/cc
ln -s ccache /usr/local/bin/c++

And so forth. This will work as long as /usr/local/bin comes before the path to the compiler (which is usually in /usr/bin). After installing you may wish to run which gcc to make sure that the correct link is being used.

NOTE: Do not use a hard link, use a symbolic link. A hard link will cause "interesting" problems.