aac2 HOWTO: FreeBSD with CCACHE - Page 3 - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Miscellaneous > Howtos & FAQs (Moderated)

Howtos & FAQs (Moderated) Would you like to share some of your solutions for certain problems? Tips or tricks? Post here. All new topics are automatically moderated.

Reply
 
Thread Tools Display Modes
  #51  
Old May 25th, 2012, 14:19
donduq donduq is offline
Junior Member
 
Join Date: Sep 2011
Posts: 38
Thanks: 13
Thanked 3 Times in 3 Posts
Default

I'm a bit at a loss so please explain the following to me: how do I use ccache with clang for world and ports? I am aware that not all ports compile with clang so once I understand how to get it to work, I can find workarounds for ports that are not happy when they're being built with clang.
Reply With Quote
  #52  
Old May 25th, 2012, 14:33
donduq donduq is offline
Junior Member
 
Join Date: Sep 2011
Posts: 38
Thanks: 13
Thanked 3 Times in 3 Posts
Default

Quote:
Originally Posted by donduq View Post
I'm a bit at a loss so please explain the following to me: how do I use ccache with clang for world and ports? I am aware that not all ports compile with clang so once I understand how to get it to work, I can find workarounds for ports that are not happy when they're being built with clang.
Shortly after asking this I took a leap of foo and am now trying to build world after the following steps.

Big fat red warning for info scavengers: I'm just posting what I am trying out; don't blindly follow these steps. I'm posting this so someone can review them.

Code:
cd /usr/local/libexec/ccache/world
ln -s ccache clang
ln -s ccache clang++
cd ..
ln -s /usr/local/bin/ccache clang
ln -s /usr/local/bin/ccache++ clang
Then I edited /etc/make.conf:

Code:
(...other stuff...)

CC=clang
CXX=clang++
CPP=clang-cpp

.if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*))
.if !defined(NOCCACHE)
CC:=${CC:C,^cc,/usr/local/libexec/ccache/world/cc,1}
CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world/c++,1}
CC:=${CC:C,^clang,/usr/local/libexec/ccache/world/clang,1}
CXX:=${CXX:C,^clang\+\+,/usr/local/libexec/ccache/world/clang++,1}
CCACHE_DIR:=/usr/sysccache
CCACHE_COMPRESS:=yes
CCACHE_COMPILERCHECK:=content
.endif
.endif
.if ${CC:T} == "clang"
CFLAGS+=        -Qunused-arguments
.endif
We'll see how it goes... but (wo)men of wisdom, please shine your light on this.

Last edited by DutchDaemon; May 25th, 2012 at 22:26.
Reply With Quote
  #53  
Old June 2nd, 2012, 15:45
donduq donduq is offline
Junior Member
 
Join Date: Sep 2011
Posts: 38
Thanks: 13
Thanked 3 Times in 3 Posts
Default

Replying to my own comment... again.

The system has been running for a week now. A little background information: it is a rented VPS, FreeBSD runs as a Xen HVM domU. It has 512M of RAM and one CPU core. Purpose of the VPS: to run Apache and Redmine.

Good news first: everything builds except for the Midnight Commander (mc). I could compile the many ports required by me and/or Redmine.

But the bad news: The system is painfully slow. I'm puzzled because the box seems to be healthy as can be seen in the following snippet from top:

Code:
CPU:  0.0% user,  0.0% nice,  0.0% system,  0.0% interrupt,  100% idle
Mem: 172M Active, 144M Inact, 139M Wired, 18M Cache, 59M Buf, 4860K Free
Swap: 3072M Total, 896K Used, 3071M Free
See? This is when the system is idle, no one is using Redmine today. But when I go there to edit things or add new things I do notice a painful delay.

What I'm going to do now is this: recompile everything with gcc and test it again. If it is just as slow then we can assume that clang is not to blame. But if it is faster then something is up. Unfortunately I am not a C programmer or capable system engineer in these matters, so I can't be of much help beyond posting my own findings.

I would welcome feedback though.
Reply With Quote
Reply

Tags
ccache, kiss

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOWTO: FreeBSD CPU Scaling and Power Saving vermaden Howtos & FAQs (Moderated) 47 December 30th, 2011 15:25


All times are GMT +1. The time now is 12:25.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0