Error installing root after cmake

I’m trying to install root and after running cmake ../root-6.20.00/ it gives me errors

-- ROOT default compression algorithm: zlib
-- Found GCC. Major version 4, minor version 4
-- Found a 64bit system
-- Found GNU compiler collection
-- ROOT Platform: linux
-- ROOT Architecture: linuxx8664gcc
-- Build Type: Release (flags = '-O3 -DNDEBUG')
-- Compiler Flags: -O3 -DNDEBUG  -std=c++0x -pipe  -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread
-- Looking for ZLib
-- Looking for Freetype
-- Looking for PCRE
-- Looking for LZMA
-- Looking for X11
CMake Error at cmake/modules/SearchInstalledSoftware.cmake:318 (message):
  libXpm and Xpm headers must be installed.
Call Stack (most recent call first):
  CMakeLists.txt:167 (include)


-- Configuring incomplete, errors occurred!
See also "/data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeOutput.log".
See also "/data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeError.log".

here is CMakeError.log

Determining if the pthread_create exist failed with the following output:
Change Dir: /data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_3fac3/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_3fac3.dir/build.make CMakeFiles/cmTC_3fac3.dir/build
gmake[1]: Entering directory `/data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_3fac3.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTC_3fac3.dir/CheckSymbolExists.c.o   -c /data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_3fac3
/srv/common/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3fac3.dir/link.txt --verbose=1
/usr/bin/cc      CMakeFiles/cmTC_3fac3.dir/CheckSymbolExists.c.o  -o cmTC_3fac3 
CMakeFiles/cmTC_3fac3.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0xc): undefined reference to `pthread_create'
collect2: ld returned 1 exit status
gmake[1]: *** [cmTC_3fac3] Error 1
gmake[1]: Leaving directory `/data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_3fac3/fast] Error 2

File /data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_b0081/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_b0081.dir/build.make CMakeFiles/cmTC_b0081.dir/build
gmake[1]: Entering directory `/data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_b0081.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_b0081.dir/CheckFunctionExists.c.o   -c /srv/common/share/cmake-3.10/Modules/CheckFunctionExists.c
Linking C executable cmTC_b0081
/srv/common/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b0081.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTC_b0081.dir/CheckFunctionExists.c.o  -o cmTC_b0081 -lpthreads 
/srv/common/bin/ld: cannot find -lpthreads
collect2: ld returned 1 exit status
gmake[1]: *** [cmTC_b0081] Error 1
gmake[1]: Leaving directory `/data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_b0081/fast] Error 2


Performing C++ SOURCE FILE Test GLIBCXX_USE_CXX11_ABI failed with the following output:
Change Dir: /data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_6f6ad/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_6f6ad.dir/build.make CMakeFiles/cmTC_6f6ad.dir/build
gmake[1]: Entering directory `/data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_6f6ad.dir/src.cxx.o
/usr/bin/c++    -std=c++0x -pipe  -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -DGLIBCXX_USE_CXX11_ABI   -std=c++0x -o CMakeFiles/cmTC_6f6ad.dir/src.cxx.o -c /data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp/src.cxx
/data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp/src.cxx:4:4: error: #error NOCXX11
gmake[1]: *** [CMakeFiles/cmTC_6f6ad.dir/src.cxx.o] Error 1
gmake[1]: Leaving directory `/data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_6f6ad/fast] Error 2

Source file was:

#include <string>
#if _GLIBCXX_USE_CXX11_ABI == 0
  #error NOCXX11
#endif
int main() {}

Performing C++ SOURCE FILE Test CXX_FLAG_STD_CPLUSPLUS11 failed with the following output:
Change Dir: /data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_46156/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_46156.dir/build.make CMakeFiles/cmTC_46156.dir/build
gmake[1]: Entering directory `/data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_46156.dir/src.cxx.o
/usr/bin/c++    -std=c++0x -pipe  -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -DCXX_FLAG_STD_CPLUSPLUS11   -std=c++11 -std=c++0x -o CMakeFiles/cmTC_46156.dir/src.cxx.o -c /data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp/src.cxx
cc1plus: error: unrecognized command line option "-std=c++11"
gmake[1]: *** [CMakeFiles/cmTC_46156.dir/src.cxx.o] Error 1
gmake[1]: Leaving directory `/data7a/bio/runs-alexgorbonos/task1/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_46156/fast] Error 2

Source file was:
int main() { return 0;}


_ROOT Version: root-6.20.00
_Platform: Linux x86_64
_Compiler: gcc version 4.4.7


Hi @11121,
welcome to the ROOT forum!

From this message:

CMake Error at cmake/modules/SearchInstalledSoftware.cmake:318 (message):
  libXpm and Xpm headers must be installed.

I would say you are missing some dependencies. You can check the list of packages that ROOT expects to be installed on your system here.

The CMakeError.log, instead, does not seem to be related to a ROOT build. (EDIT: but I guess the problem is that the build system is not passing the -pthread option to the compiler/linker)

Note that unless you have particular needs you do not have to compile ROOT yourself but can instead download one of our pre-compiled binaries under “binary distributions” here, or install ROOT via conda, or you can source it from CVMFS.

Cheers,
Enrico

This compiler cannot build ROOT, you need at least a compiler with support for C++11. You also need to install the dependencies as Enrico pointed out.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.