qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Stitcher <astitc...@redhat.com>
Subject Using LLVM clang compiler to compile c++ qpid code
Date Mon, 09 May 2011 20:42:00 GMT
On the side for the past few weeks I've been working on fixing up the
code so that we could compile it with the clang c++ compiler
(http://clang.llvm.org).

I've finished this work (for the moment at least), so you can now
compile with the clang compiler. You will need to use version 2.9 at
least as version 2.8 had a few bugs that stopped it compiling the qpid
code.

Presently I've been doing something like this to get it working:

	CC=clang CXX=clang++ ../src-released/qpid/cpp/configure
or	CC=clang CXX=clang++ cmake ../src-released/qpid/cpp
	make check

Why you might want to use the clang compiler: It compiles significantly
faster than gcc (about 7/5 mins autoconfig/cmake compared to about 10
mins for gcc autoconfig); it produces vastly superior diagnostics to gcc
(at least in my opinion, although this is a design goal of the
compiler). The generated code with the default optimisations (-g -O2")
is somewhat slower than gcc on a simple perftest run (91Mb/s loopback
against 100Mb/s loopback).

So this makes clang a very good compiler to develop with when you want
to understand the errors you're getting, but at this point gcc would
seem to be the better compiler to deploy with.

There are a couple of outstanding issues:
* The clang compiler doesn't currently support 64 bit built in atomic
operations, and so to get it working I've made it use the slow mutes
locked version of the AtomicValue support, this will cause it to have
lower performance in some cases.

* make check with valgrind is detecting a memory leak running unit_test
compiled with clang that it does not see when compiled with gcc.

Andrew


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Mime
View raw message