Differences

This shows you the differences between two versions of the page.

Link to this comparison view

compilingwithclang [2013/07/20 04:31]
kraileth Case change for edelib
compilingwithclang [2015/10/03 14:54]
Line 1: Line 1:
-====== Compiling With Clang ====== 
- 
-===== Introduction ===== 
- 
-This short tutorial describes the details of compiling ''​edelib''​ and ''​EDE''​ with the [[http://​clang.llvm.org/​|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: 
- 
-<​code>​ 
-$ cd fltk-<​version>​ 
-$ export CC=clang 
-$ export CXX=clang++ 
-$ ./configure && make 
-</​code>​ 
- 
-or in case you would like ''​FLTK''​ to be installed on different place (default is 
-///​usr/​local//,​ use the //prefix//) parameter, like: 
- 
-<​code>​ 
-$ ./configure --prefix=/​usr && make 
-</​code>​ 
- 
-and as superuser, run: 
- 
-<​code>​ 
-$ make install 
-</​code>​ 
- 
-===== Compiling edelib ===== 
- 
-Normally ''​edelib''​ should compile without problems and compilation 
-commands are pretty much the same as for compiling ''​FLTK''​ (except you are 
-using //JAM// as build tool). The commands in the right order are: 
- 
-<​code>​ 
-$ cd edelib-<​version>​ 
-$ export CC=clang 
-$ export CXX=clang++ 
-$ ./configure && jam 
-</​code>​ 
- 
-You can use the //prefix// parameter to set the desired location. As superuser, 
-running: 
- 
-<​code>​ 
-$ jam install 
-</​code>​ 
- 
-will install ''​edelib''​ to the desired location. 
- 
-===== Compiling EDE ===== 
- 
-The commands to build ''​edelib''​ apply here, too. However, if you get strange errors like: 
- 
-<​code>​ 
-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);​ } 
-                                     ^ 
-</​code>​ 
- 
-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: 
- 
-<code cpp> 
-#define _GLIBCXX_ATOMIC_BUILTINS 1 
-</​code>​ 
- 
-and comment it out, like: 
- 
-<code cpp> 
-// #define _GLIBCXX_ATOMIC_BUILTINS 1 
-</​code>​ 
- 
-which will disable ''​GCC''​ builtin atomic access functions. Recompile ''​EDE''​ and install it, uncommenting above line afterwards. 
  
Print/export