Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Usage of ccache with TITAN
Usage of ccache with TITAN [message #1767735] Mon, 10 July 2017 13:05
Bence Janos Szabo is currently offline Bence Janos SzaboFriend
Messages: 9
Registered: April 2017
Junior Member
Ccache is a compiler cache which speeds up the compilation by caching the result of the previous compilation. If the same compilation is being done again it will retrieve the cached object files from the cache and it will use them without recompiling the code again. Potentially faster compilation times can be achieved when using ccache with TITAN. TITAN generates c++ code and ccache can cache the object files of the generated c++ code. It is advised to use ccache on development builds.

Installing ccache

On an Ubuntu 16.04 operating system the following command will install ccache:
sudo apt-get install ccache 
or ccache can be built from source.

The source can be downloaded form

Configuring ccache

After installing ccache some configuration needs to be done to successfully use ccache.

1. The path of ccache needs to be added to the PATH variable:
export PATH="/usr/lib/ccache:$PATH 

By adding the path of ccache to the beginning of the PATH variable, when g++ or gcc is called ccache will be called too. This way the makefiles does not need to be modified.

2. Set time_macros sloppines in ccache to achieve better results:
ccache --set-config=sloppiness=time_macros
This is needed because in the generated code the __DATE__ and __TIME__ macros are used and with the sloppiness ccache will ignore theese macros.

3. There is an option (-D) in the TITAN compiler which disables generation of user and time information into the files. This way the same c++ will be generated for the same TTCN3 project regardless of time and user. The makefiles has to be edited to use the -D flag in the COMPILER_FLAGS variable. The usage of this option is highly recommended.

After the configuring is done the project can be built the same as before. The invokation of g++ or gcc will also invoke ccache and the compilation time will be reduced from the second compilation.

Ccache keeps statistics about the performance of ccache. The ccache -s command outputs the statistics. This includes the number of cache hits, cache misses, unsupported compiler options and a lot more useful information.
Previous Topic:[Solved] Titan Json Decoder bug with enum and int
Next Topic:Support for WebSocket in Eclipse Titan
Goto Forum:

Current Time: Sun Apr 21 02:23:20 GMT 2019

Powered by FUDForum. Page generated in 0.01279 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top