-
Notifications
You must be signed in to change notification settings - Fork 0
ccache
"ccache is a compiler cache. It speeds up recompilation by caching previous compilations and detecting when the same compilation is being done again."
Usually, the initial build takes a little (5% - 20%) longer, but repeated builds are up to ten times faster. Using ccache is safe, as ccache tries very hard to not mess up things and falls back to a normal compile if it cannot ensure correct output.
There's one drawback: without further tweaking, gcc stops emmiting coloured output.
- install using your distro's package manager. Eg., on ubuntu or debian:
# sudo apt-get install ccache
- set
CCACHEvariable toccache:
# export CCACHE=ccache
- (optional) add the above export line to your
~/.profile
Build without ccache:
[kaspar@booze default (master)]$ time BOARD=samr21-xpro make clean all
Building application "default" for "samr21-xpro" with MCU "samd21".
[...]
text data bss dec hex filename
37016 180 6008 43204 a8c4 /home/kaspar/src/riot/examples/default/bin/samr21-xpro/default.elf
real 0m12.321s
user 0m10.317s
sys 0m1.170s
[kaspar@booze default (master)]$
First build with ccache enabled:
[kaspar@booze default (master)]$ time BOARD=samr21-xpro make clean all
Building application "default" for "samr21-xpro" with MCU "samd21".
[...]
text data bss dec hex filename
37016 180 6008 43204 a8c4 /home/kaspar/src/riot/examples/default/bin/samr21-xpro/default.elf
real 0m15.462s
user 0m12.410s
sys 0m1.597s
[kaspar@booze default (master)]$
Subsequent build with ccache enabled:
[kaspar@booze default (master)]$ time BOARD=samr21-xpro make clean all
Building application "default" for "samr21-xpro" with MCU "samd21".
[...]
text data bss dec hex filename
37016 180 6008 43204 a8c4 /home/kaspar/src/riot/examples/default/bin/samr21-xpro/default.elf
real 0m2.157s
user 0m1.213s
sys 0m0.327s
[kaspar@booze default (master)]$
RIOT - The friendly Operating System for the Internet of Things
Homepage | [GitHub] (https://github.com/RIOT-OS/) | Developers Mailing List | Users Mailing List | Twitter @RIOT_OS
- Family: ARM
- Board: Airfy Beacon
- Board: Arduino Due
- Board: CC2538DK
- Board: CC2650STK
- Board: HikoB Fox
- Board: IoT LAB M3
- Board: LimiFrog-v1
- Board: mbed_lpc1768
- Board: MSB-IoT
- Board: MSBA2
- Board: Nucleo-L1
- Board: Nucleo-F446
- Board: Nucleo-F334
- Board: Nucleo-F303
- Board: Nucleo-F091
- Board: Mulle
- Board: OpenMote
- Board: PCA1000x (nRF51822 Development Kit)
- Board: Phytec phyWAVE-KW22
- Board: RFduino
- Board: SAMR21-xpro
- Board: SAML21-xpro
- Board: Seeeduino Arch-Pro
- Board: SODAQ Autonomo
- Board: Spark Core
- Board: STM32F0discovery
- Board: STM32F3discovery
- Board: STM32F4discovery
- Board: UDOO
- Board: yunjia-nrf51822
- Board: Zolertia remote
- Family: ATmega
- Board: Arduino Mega2560
- Board: Arduino Uno
- Board: Arduino Duemilanove
- Family: MSP430
- Board: MSB-430H
- Board: TelosB
- Board: WSN430
- Board: Zolertia Z1
- Board: eZ430-Chronos
- Family: native
- Board: native
- Family: x86
- Board: Intel Galileo