Cannot run macros after upgrade gcc

Hi all,

I am working on ROOT v6.06.06 on ubuntu 14.04. Everything went OK. Lately i did apt-get upgrade, and this affected the c++ compiler.

Since then, when i try to run my macros on ROOT, I have this error:

fatal error: file ‘/usr/include/c++/4.9/cmath’ modified since it was first processed

I tried then to re-compile ROOT, but it’s not working, I have this error:

[ 36%] Building CXX object interpreter/llvm/src/tools/clang/lib/Driver/CMakeFiles/clangDriver.dir/ToolChains.cpp.o
…/root/interpreter/llvm/src/tools/clang/lib/Driver/ToolChains.cpp: In static member function ‘static std::string clang::driver::toolchains::Hexagon_TC::GetGnuDir(const string&, const llvm::opt::ArgList&)’:
…/root/root6/root/interpreter/llvm/src/tools/clang/lib/Driver/ToolChains.cpp:2110:42: error: ‘LLVM_PREFIX’ was not declared in this scope
std::string PrefixRelDir = std::string(LLVM_PREFIX) + “/…/gnu”;
^
make[2]: *** [interpreter/llvm/src/tools/clang/lib/Driver/CMakeFiles/clangDriver.dir/ToolChains.cpp.o] Error 1
make[1]: *** [interpreter/llvm/src/tools/clang/lib/Driver/CMakeFiles/clangDriver.dir/all] Error 2
make: *** [all] Error 2

So I need either solving the c++ compiler so i can use the last compiled version of ROOT that I have, Or succeed to solve the problem while compiling ROOT.

Can you help me please? I am blocked. Thanks a lot.

Very strange, did you add any repository containing a new gcc?

Just tested on a clean Ubuntu 14.04 VM image:

apt-get update && apt-get -s install g++ ... Inst g++-4.8 (4.8.4-2ubuntu1~14.04.3 Ubuntu:14.04/trusty-updates [amd64]) Inst g++ (4:4.8.2-1ubuntu6 Ubuntu:14.04/trusty [amd64]) ...

Can you run

[quote]So I need either solving the c++ compiler so i can use the last compiled version of ROOT that I have, Or succeed to solve the problem while compiling ROOT.[/quote]When the compiler change, the easiest solution is to restart the build from scratch (i.e. start from an empty build directory then run cmake then make).

Cheers,
Philippe.

I didn’t add. this what I have:

..:/usr/include/c++$ ll total 32 drwxr-xr-x 4 root root 4096 Nov 14 18:57 ./ drwxr-xr-x 61 root root 4096 Nov 14 18:57 ../ drwxr-xr-x 12 root root 12288 Nov 14 18:57 4.8/ lrwxrwxrwx 1 root root 3 Dec 1 2015 4.8.5 -> 4.8/ drwxr-xr-x 13 root root 12288 Nov 14 18:57 4.9/ lrwxrwxrwx 1 root root 3 Sep 5 04:02 4.9.4 -> 4.9/
Some changes are made the Nov 14 after the upgrade. the same folders where here before.

and when looking in /var/log/apt/history.log, these are the main upgrades concerning the compiler

gcc-4.8-base:amd64 (4.8.4-2ubuntu1~14.04.3, 4.8.5-2ubuntu1~14.04.1)
gcc-6-base:amd64 (6.1.1-3ubuntu11~14.04.1, 6.2.0-3ubuntu11~14.04)
libgcc1:amd64 (6.1.1-3ubuntu11~14.04.1, 6.2.0-3ubuntu11~14.04)
libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.3, 4.8.5-2ubuntu1~14.04.1)
gcc-4.8:amd64 (4.8.4-2ubuntu1~14.04.3, 4.8.5-2ubuntu1~14.04.1),
gcc-4.9:amd64 (4.9.3-8ubuntu2~14.04, 4.9.4-2ubuntu1~14.04.1),
libgcc-4.9-dev:amd64 (4.9.3-8ubuntu2~14.04, 4.9.4-2ubuntu1~14.04.1),
gcc-4.9-base:amd64 (4.9.3-8ubuntu2~14.04, 4.9.4-2ubuntu1~14.04.1)

cpp-4.8:amd64 (4.8.4-2ubuntu1~14.04.3, 4.8.5-2ubuntu1~14.04.1),
cpp-4.9:amd64 (4.9.3-8ubuntu2~14.04, 4.9.4-2ubuntu1~14.04.1)

libstdc+±4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.3, 4.8.5-2ubuntu1~14.04.1)
libstdc+±4.9-dev:amd64 (4.9.3-8ubuntu2~14.04, 4.9.4-2ubuntu1~14.04.1),
libstdc++6:amd64 (6.1.1-3ubuntu11~14.04.1, 6.2.0-3ubuntu11~14.04)

[quote]When the compiler change, the easiest solution is to restart the build from scratch (i.e. start from an empty build directory then run cmake then make).
[/quote]

This is what I did exactly, and I still have this error while building:

[ 36%] Building CXX object interpreter/llvm/src/tools/clang/lib/Driver/CMakeFiles/clangDriver.dir/ToolChains.cpp.o .../root/interpreter/llvm/src/tools/clang/lib/Driver/ToolChains.cpp: In static member function ‘static std::string clang::driver::toolchains::Hexagon_TC::GetGnuDir(const string&, const llvm::opt::ArgList&)’: .../root/root6/root/interpreter/llvm/src/tools/clang/lib/Driver/ToolChains.cpp:2110:42: error: ‘LLVM_PREFIX’ was not declared in this scope std::string PrefixRelDir = std::string(LLVM_PREFIX) + "/../gnu"; ^ make[2]: *** [interpreter/llvm/src/tools/clang/lib/Driver/CMakeFiles/clangDriver.dir/ToolChains.cpp.o] Error 1 make[1]: *** [interpreter/llvm/src/tools/clang/lib/Driver/CMakeFiles/clangDriver.dir/all] Error 2 make: *** [all] Error 2

I resolved the problem adding #define LLVM_PREFIX "/usr/local" to interpreter/llvm/src/include/llvm/Config/llvm-config.h, and then I recompiled ROOT from scratch.
Everything is working fine now.

Thanks for your support.