Table of Contents

Compiling With Clang

Introduction

This short tutorial describes the details of compiling edelib and EDE with the Clang compiler. It is assumed you
already have installed a Clang version with the needed libraries.

Note: This tutorial also assumes you have read InstallationHowTo and have prepared the needed libraries and tools.

Compiling FLTK

First we are going to compile FLTK. Clang can use libraries compiled with GCC, so if you can install the latest stable version of FLTK with your distribution's package management system, feel free to do so.

However, if you prefer to compile FLTK with Clang as well, first download FLTK's source code, unpack it and run the following commands in terminal:

You can use the prefix parameter to set the desired location. As superuser,
running:

$ jam install

will install edelib to the desired location.

Compiling EDE

The commands to build edelib apply here, too. However, if you get strange errors like:

In file included from ActionMenu.cc:14:
In file included from /usr/bin/../lib/gcc/i686-redhat-linux/4.7.2/../../../../include/c++/4.7.2/iostream:39:
In file included from /usr/bin/../lib/gcc/i686-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ostream:39:
In file included from /usr/bin/../lib/gcc/i686-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ios:42:
In file included from /usr/bin/../lib/gcc/i686-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/ios_base.h:40:
/usr/bin/../lib/gcc/i686-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:48:45: error: use of undeclared identifier '__ATOMIC_ACQ_REL'
{ return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
^
/usr/bin/../lib/gcc/i686-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ext/atomicity.h:52:38: error: use of undeclared identifier '__ATOMIC_ACQ_REL'
{ __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
^

you are probably running a recent GCC version with a Clang version a bit older. If your distribution does not provide an updated Clang package,
you can apply a small hack.

Please note that this hack can change how gcc works, so after you change the given file, recompile EDE and revert those changes!

As superuser, open the file /usr/include/c++/VERSION/PLATFORM-DISTRO/bits/c++config.h, where VERSION is the GCC version (like 4.7.2) and PLATFORM-DISTRO is distribution specific folder, like i686-redhat-linux. Find the line: