Build error root-6.06.04

I’m trying build root. I used the commands bellow:

sudo cmake -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 /home/juanleite/Downloads/root-6.06.04

sudo cmake --build .

ERROR:

graf2d/asimage/CMakeFiles/AFTERIMAGE.dir/build.make:64: recipe for target ‘graf2d/asimage/libAfterImage/libAfterImage.a’ failed
make[2]: *** [graf2d/asimage/libAfterImage/libAfterImage.a] Error 2
CMakeFiles/Makefile2:16095: recipe for target ‘graf2d/asimage/CMakeFiles/AFTERIMAGE.dir/all’ failed
make[1]: *** [graf2d/asimage/CMakeFiles/AFTERIMAGE.dir/all] Error 2
Makefile:149: recipe for target ‘all’ failed
make: *** [all] Error 2
CMakeError.txt (34 KB)
CMakeError.txt (34 KB)

To configure and build you do not need to “sudo”. Does it change anything removing it? Can you please post the actual output of the cmake command on a clean build area.

I need “sudo” because I’m installing in a subfolder at / directory.

/opt/build

I tried install in Download directory but it didn’t work too.
cmake_output.txt (16.6 KB)

What are your system and compiler versions?

at Download directory

/home/juanleite/Downloads/root-6.06.04

cat /etc/issue
gcc --version

juanleite@juan:/opt/build$ cat /etc/issue
Ubuntu 16.04 LTS \n \l

juanleite@juan:/opt/build$ gcc --version
gcc (Ubuntu 4.8.5-4ubuntu2) 4.8.5
Copyright © 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

juanleite@juan:/opt/build$

I solved the first problem removing the png.h from /usr/include
Now I have other

/usr/bin/ld: /usr/local/lib/libpython3.5m.a(myreadline.o): realocação R_X86_64_32 contra `.rodata.str1.1’ não pode ser usada quando estiver fazendo um objeto compartilhado; recompilar com -fPIC
/usr/local/lib/libpython3.5m.a: error adding symbols: Valor inaceitável
collect2: error: ld returned 1 exit status
bindings/pyroot/CMakeFiles/PyROOT.dir/build.make:954: recipe for target ‘lib/libPyROOT.so’ failed
make[2]: *** [lib/libPyROOT.so] Error 1
CMakeFiles/Makefile2:20192: recipe for target ‘bindings/pyroot/CMakeFiles/PyROOT.dir/all’ failed
make[1]: *** [bindings/pyroot/CMakeFiles/PyROOT.dir/all] Error 2
Makefile:149: recipe for target ‘all’ failed
make: *** [all] Error 2

sorry the portuguese