ROOT 6 Build From Source Error on Ubuntu 14.04 LTS

If you configure without specifying CMAKE_INSTALL_PREFIX it takes the value /usr/local. To control if the installation is fix location installation or relocatable we have another option ‘gnuinstall’. Independently of the value of CMAKE_INSTALL_PREFIX you can always make an installation with

cmake -DCMAKE_INSTALL_PREFIX=<instal-prefix-location> -P cmake_install.cmake 

I’m back with another build from source error, but this time on Ubuntu 16.04 LTS:

uname -a
Linux mcf-ThinkPad-Edge-E540 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
g++ --version | grep g++
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609
gcc --version | grep gcc
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609

I again have the latest version of all required and optional prerequisite packages.
I’m attempting to build from source doing the following:

cd ~/applications/bin/
git clone http://root.cern.ch/git/root.git root_source
mkdir root
cd root
unset ROOTSYS
cmake -Dall="ON" -Dsoversion="ON" -Dqtgsi="OFF" ../root_source >> cmake.out.txt 2>&1
cmake --build . >> cmake.out.txt 2>&1

which now fails with the following (log file is attached)

[  7%] Building CXX object interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/InvocationOptions.cpp.o
In file included from /home/mcf/applications/bin/root_source/interpreter/cling/lib/Interpreter/InvocationOptions.cpp:13:0:
/home/mcf/applications/bin/root_source/interpreter/cling/../llvm/src/tools/clang/include/clang/Driver/Options.h:41:36: fatal error: clang/Driver/Options.inc: No such file or directory
compilation terminated.
interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/build.make:643: recipe for target 'interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/InvocationOptions.cpp.o' failed
make[2]: *** [interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/InvocationOptions.cpp.o] Error 1
CMakeFiles/Makefile2:8464: recipe for target 'interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/all' failed
make[1]: *** [interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

Any thoughts?
cmake.out.txt (59.1 KB)

I have also tried downgrading my gcc compiler, [url=https://root-forum.cern.ch/t/rootaas-c-kernel-sdtout-or-stderr-malformed-message-with-zmq/20577/8 suggested here[/url]. However, that still produces the same error.

I had the same problem with the “Options.inc” in Ubuntu 16.04, for gcc 4.9 as well as gcc 5.4.

I am not really sure how I solved it, I tried two things (a and b) at the same time and then it suddenly worked.

Try:
a) Remove the git repository and clone again. Remove build directory and rebuild from scratch
b) Install libclang-dev, and then step a)

See:

[quote=“ferhue”]I had the same problem with the “Options.inc” in Ubuntu 16.04, for gcc 4.9 as well as gcc 5.4.

I am not really sure how I solved it, I tried two things (a and b) at the same time and then it suddenly worked.

Try:
a) Remove the git repository and clone again. Remove build directory and rebuild from scratch
[/quote]
I’m running a script that contains (effectively) the following commands

cd ~/applications/bin/
git clone http://root.cern.ch/git/root.git root_source
mkdir root
cd root
unset ROOTSYS
cmake -Dall="ON" -Dsoversion="ON" -Dqtgsi="OFF" ../root_source >> cmake.out.txt 2>&1
cmake --build . >> cmake.out.txt 2>&1
cmake -DCMAKE_INSTALL_PREFIX=/home/mcf/applications/bin/root -P cmake_install.cmake
sudo cmake --build . --target install >> cmake.out.txt 2>&1
source bin/thisroot.sh

and before I run it every time I’m ensuring I’m running a totally clean install

cd ~/applications/bin/
rm -rf root_source root

[quote=“ferhue”]
b) Install libclang-dev, and then step a)

See:
https://root-forum.cern.ch/t/root-build-suddenly-failing-ubuntu-16-04-lts/21739/1[/quote]

I followed [url=https://root-forum.cern.ch/t/root-build-suddenly-failing-ubuntu-16-04-lts/21739/1 Le Pew’s suggestion[/url] of purging anything installed relating to clang and cling, and then installed libclang-dev and reran my script with gcc 5.4. I once again got the same failure (with the logs once again attached).
cmake.out.txt (59.1 KB)

Mmm I have no further idea.

What does the following tell you before install?

unset ROOTSYS
printenv | grep PATH

Just to check that there are no conflicts…

Maybe try another cmake build method like this, without sudo things, and then add further options if it works:

cd ~/temporary/
git clone http://root.cern.ch/git/root.git root_source
mkdir root
cd root
unset ROOTSYS
cmake ../root_source
make
source bin/thisroot.sh

[quote=“ferhue”]Mmm I have no further idea.

What does the following tell you before install?

unset ROOTSYS
printenv | grep PATH

Just to check that there are no conflicts…
[/quote]
MANPATH=:/usr/local/texlive/2014/texmf-dist/doc/man
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
PATH=/home/mcf/anaconda/envs/py3k/bin:/home/mcf/anaconda/bin:/usr/local/texlive/2014/bin/x86_64-linux:/home/mcf/bin:/opt/texbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
COMPIZ_BIN_PATH=/usr/bin/
INFOPATH=:/usr/local/texlive/2014/texmf-dist/doc/info

[quote=“ferhue”]
Maybe try another cmake build method like this, without sudo things, and then add further options if it works:

cd ~/temporary/ git clone http://root.cern.ch/git/root.git root_source mkdir root cd root unset ROOTSYS cmake ../root_source make source bin/thisroot.sh [/quote]
These commands, unfortunately, still produces the same error (log file of these commands attached).
cmake-simple.out.txt (54.3 KB)

Let’s see what the ROOT team says about that. Or submit a bug report.

Otherwise, I would suggest the following: install a clean Ubuntu 16.04 on a Virtualbox. Type exactly the commands below. If it works, then the conclusion would be that something in your local environment (/home/mcf/anaconda…) interacts with cmake or clang…

sudo apt-get install git dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev \
libxft-dev libxext-dev
sudo apt-get install gfortran libssl-dev libpcre3-dev \
xlibmesa-glu-dev libglew1.5-dev libftgl-dev \
libmysqlclient-dev libfftw3-dev libcfitsio-dev \
graphviz-dev libavahi-compat-libdnssd-dev \
libldap2-dev python-dev libxml2-dev libkrb5-dev \
libgsl0-dev libqt4-dev

cd ~/temporary/
git clone http://root.cern.ch/git/root.git root_source
mkdir root
cd root
cmake ../root_source
make -j4

Note that my suggestion was to “purge” everything that’s related to any “*cl[ai]ng-dev” package (including any cl[ai]ng related compiler / interpreter).
Note also that you must make sure that nothing in your setup points to any other ROOT version (e.g. you may have Ubuntu’s default ROOT related packages installed, which you need to “purge”).

I just checked that on a Virtualbox, installing a fresh Ubuntu 16.04.1 Mate with these minimal commands does not produce any error:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev \
libxft-dev libxext-dev

mkdir ~/temp
cd ~/temp
git clone http://root.cern.ch/git/root.git root_source
mkdir root_build
cd root_build
cmake ../root_source
make -j4

So, something in your environment, as suggested by Pepe, might be messing up and giving this cryptic error.

As comparison, my printenv says just

printenv | grep PATH
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
DEFAULTS_PATH=/usr/share/gconf/mate.default.path
PATH=/home/ferhue/bin:/home/ferhue/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
MANDATORY_PATH=/usr/share/gconf/mate.mandatory.path

Sorry, I failed to mention earlier that I had done your recommended purge such that

returns nothing, and the error still occurred when I ran like that.

[quote=“Pepe Le Pew”]
Note also that you must make sure that nothing in your setup points to any other ROOT version (e.g. you may have Ubuntu’s default ROOT related packages installed, which you need to “purge”).[/quote]

returns nothing,

$ sudo dpkg --list "*"|grep -i "root"
ii  dns-root-data                                        2015052300+h+1                                              all          DNS root data including root zone and DNSSEC key
ii  fakeroot                                             1.20.2-1ubuntu1                                             amd64        tool for simulating superuser privileges
ii  libfakeroot:amd64                                    1.20.2-1ubuntu1                                             amd64        tool for simulating superuser privileges - shared libraries
un  xsetroot                                             <none>                                                      <none>       (no description available)

which aren’t ROOT related, and there isn’t anything in my path. I could be missing something obvious, but I’m not sure what.

Just a strange question.
Was “Options.inc” created or not?
In the subdirectory in which you build ROOT (NOT in the source code subdirectory), try to execute:
find ./ -name "Options.inc"
and you should get something like this (for ROOT 6.06/06):
./interpreter/llvm/src/tools/clang/include/clang/Driver/Options.inc

ferhue and Pepe, I’m think I have found the difference in our results on getting ROOT 6 to compile following ferhue’s method. I had been using

make which fails, but make -j4 succeeds. Thus,

cd ~/applications/bin/
git clone http://root.cern.ch/git/root.git root_source
mkdir root
cd root
unset ROOTSYS
cmake -Dall="ON" -Dsoversion="ON" -Dqtgsi="OFF" ../root_source >> cmake.out.txt 2>&1
cmake .../root_source >> cmake.out.txt 2>&1
make -j4 >> cmake.out.txt 2>&1
source ./bin/thisroot.sh

works just fine with no problems.

I find this very confusing, as I don’t see why the number of jobs launched with make should determine if it fails or succeeds. Do you understand this? Further, I’m still confused why this method succeeds, but following the ROOT webpage build documentation instructions (as I have done here) fails.

Regardless, thank you both for your time and help in getting me a working version of ROOT6 again.

[quote=“Pepe Le Pew”]Just a strange question.
Was “Options.inc” created or not?
In the subdirectory in which you build ROOT (NOT in the source code subdirectory), try to execute:
find ./ -name "Options.inc"
and you should get something like this (for ROOT 6.06/06):
./interpreter/llvm/src/tools/clang/include/clang/Driver/Options.inc[/quote]
After discovering the fix, I went back and reran with the failing set of commands, and no “Options.inc” was created.

$ cd root
$ find ./ -iname "Options.inc"

return no results, and the Driver dir is never created

$ ls interpreter/llvm/src/tools/clang/include/
clang/  CMakeFiles/  cmake_install.cmake  Makefile

So it seems that it is a clear problem in ROOT building procedure (missing dependencies somewhere which is clearly visible if one makes it using a single cpu).

BTW. You should try: ls -p interpreter/llvm/src/tools/clang/include/clang/ which should return something like this (for ROOT 6.06/06): AST/ CMakeFiles/ Config/ Makefile Sema/ Basic/ cmake_install.cmake Driver/ Parse/ Serialization/ and then: ls -p interpreter/llvm/src/tools/clang/include/clang/Driver/ which gives: CMakeFiles/ cmake_install.cmake Makefile Options.inc Options.inc.tmp

Lol… This is ROOT in pure state xD. No idea. Time to submit a bug report…

That was also the reason why it worked for me just “some times”, but I did not find the right reason.

You are welcome :wink:

For the working build:

Okay, so (obvious high ignorance on my end) is this an actual bug then, or is this some pathological effect of my Ubuntu’s setup?

[quote=“Pepe Le Pew”]
BTW. You should try: ls -p interpreter/llvm/src/tools/clang/include/clang/ which should return something like this (for ROOT 6.06/06): AST/ CMakeFiles/ Config/ Makefile Sema/ Basic/ cmake_install.cmake Driver/ Parse/ Serialization/[/quote]
yields

AST/    CMakeFiles/          Config/  Makefile  Sema/           StaticAnalyzer/
Basic/  cmake_install.cmake  Driver/  Parse/    Serialization/

yields what you have printed above.

What you show for the “working build” is fine.
But what do you get for the “broken / 1 cpu make” build (after it dies)?

Hi,

I have created sft.its.cern.ch/jira/browse/ROOT-8392 for this.

Axel.

Thanks for reporting the problem. We didn’t see it because we always build with -jN on the nightlies. A fix has been committed to master and 6.08 branches.