Skip to content
Matthias Richter edited this page Mar 29, 2017 · 1 revision

This page collects some notes how to compile AliO2 with clang on a system with gcc as the default compiler

Configuring the local build directory to use clang compiler

cd sw/BUILD/O2-latest
cp -a O2 O2-gcc # maka a backup copy
export FAIRROOTPATH=$FAIRROOT_ROOT
export SIMPATH=$FAIRROOT_ROOT
cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_FLAGS='-std=c++11' .

Problems with detection of C++11 ability

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 56af7ec..63d071a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -135,12 +135,12 @@ IF (NOT ALICEO2_MODULAR_BUILD)
   # Up to now this is only a check since the code does not use
   # any of the features of the new standard
   # does not work straightforward
-  include(CheckCXX11Features)
+  #include(CheckCXX11Features)
 
   # Check IF the compilation flag -std=c++11 is set
-  IF (NOT CMAKE_CXX_FLAGS)
-    Message(FATAL_ERROR "No C++11 support found. AliceO2 require C++11 be build.")
-  EndIF (NOT CMAKE_CXX_FLAGS)
+  #IF (NOT CMAKE_CXX_FLAGS)
+  #  Message(FATAL_ERROR "No C++11 support found. AliceO2 require C++11 be build.")
+  #EndIF (NOT CMAKE_CXX_FLAGS)
 
 ELSE (NOT ALICEO2_MODULAR_BUILD)
   # This needs to be improved