Can't built ROOT Version 6.22/06


Please read tips for efficient and successful posting and posting code

_ROOT Version:6.22/06
_Platform: Ubuntu 20.04.1 LTS
_Compiler: g++ 9.3.0


Hi, I am a newbie and would like to build ROOT manually, as suggested here: https://github.com/AGerrety/ROOT6PYTHON3

After following all the instructions from https://root.cern/install/build_from_source/ , I was able to do everything but stuck at cmake --build . -- -j 4
I have created 3 directories, root_build, root_scr and root_install.
The source file was unzipped in root_scr and a directory root-6.22.06 was created.
Then, cd into root_build and ran cmake -DCMAKE_INSTALL_PREFIX=../root_install ../cztee/root_scr/root-6.22.06/

The following appeared:

– The C compiler identification is GNU 9.3.0
– The CXX compiler identification is GNU 9.3.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Found Git: /usr/bin/git (found version β€œ2.25.1”)
– Looking for Python
– Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS NumPy) (found version β€œ3.8.5”)
– Found Python2: /usr/bin/python2.7 (found version β€œ2.7.18”) found components: Interpreter Development NumPy
– ROOT default compression algorithm: zlib
– PyROOT will be built for versions 3.8.5 (Main) and 2.7.18
– Found GCC. Major version 9, minor version 3
– Looking for pthread.h
– Looking for pthread.h - found
– Performing Test CMAKE_HAVE_LIBC_PTHREAD
– Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
– Looking for pthread_create in pthreads
– Looking for pthread_create in pthreads - not found
– Looking for pthread_create in pthread
– Looking for pthread_create in pthread - found
– Found Threads: TRUE
– Found a 64bit system
– Found GNU compiler collection
– Performing Test GLIBCXX_USE_CXX11_ABI
– Performing Test GLIBCXX_USE_CXX11_ABI - Success
– ROOT Platform: linux
– ROOT Architecture: linuxx8664gcc
– Build Type: Release (flags = β€˜-O3 -DNDEBUG’)
– Compiler Flags: -O3 -DNDEBUG -std=c++11 -Wno-implicit-fallthrough -Wno-noexcept-type -pipe -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread
– Looking for ZLib
– Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version β€œ1.2.11”)
– Looking for Freetype
– Could NOT find Freetype (missing: FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS)
– FreeType not found. Switching on builtin_freetype option
– Building freetype version 2.6.1 included in ROOT itself
– Looking for PCRE
– Could NOT find PCRE (missing: PCRE_INCLUDE_DIR PCRE_PCRE_LIBRARY)
– PCRE not found. Switching on builtin_pcre option
– Looking for LZMA
– Could NOT find LibLZMA (missing: LIBLZMA_LIBRARY LIBLZMA_INCLUDE_DIR LIBLZMA_HAS_AUTO_DECODER LIBLZMA_HAS_EASY_ENCODER LIBLZMA_HAS_LZMA_PRESET)
– LZMA not found. Switching on builtin_lzma option
– Building LZMA version 5.2.4 included in ROOT itself
– Looking for ZSTD
– Could NOT find ZSTD (missing: ZSTD_LIBRARIES ZSTD_INCLUDE_DIR ZSTD_VERSION)
– ZSTD not found. Switching on builtin_zstd option
– Performing Test CXX_FLAG_STD_CPLUSPLUS11
– Performing Test CXX_FLAG_STD_CPLUSPLUS11 - Success
– Performing Test C_FLAG_STD_C99
– Performing Test C_FLAG_STD_C99 - Success
– Performing Test C_FLAG_WALL
– Performing Test C_FLAG_WALL - Success
– Performing Test CXX_FLAG_WALL
– Performing Test CXX_FLAG_WALL - Success
– Performing Test C_FLAG_WEXTRA
– Performing Test C_FLAG_WEXTRA - Success
– Performing Test CXX_FLAG_WEXTRA
– Performing Test CXX_FLAG_WEXTRA - Success
– Performing Test C_FLAG_WUNDEF
– Performing Test C_FLAG_WUNDEF - Success
– Performing Test CXX_FLAG_WUNDEF
– Performing Test CXX_FLAG_WUNDEF - Success
– Performing Test C_FLAG_WSHADOW
– Performing Test C_FLAG_WSHADOW - Success
– Performing Test CXX_FLAG_WSHADOW
– Performing Test CXX_FLAG_WSHADOW - Success
– Performing Test C_FLAG_WCAST_ALIGN
– Performing Test C_FLAG_WCAST_ALIGN - Success
– Performing Test CXX_FLAG_WCAST_ALIGN
– Performing Test CXX_FLAG_WCAST_ALIGN - Success
– Performing Test C_FLAG_WCAST_QUAL
– Performing Test C_FLAG_WCAST_QUAL - Success
– Performing Test CXX_FLAG_WCAST_QUAL
– Performing Test CXX_FLAG_WCAST_QUAL - Success
– Performing Test C_FLAG_WSTRICT_PROTOTYPES
– Performing Test C_FLAG_WSTRICT_PROTOTYPES - Success
– Looking for xxHash
– Could NOT find xxHash (missing: xxHash_LIBRARY xxHash_INCLUDE_DIR)
– xxHash not found. Switching on builtin_xxhash option
– Looking for LZ4
– Could NOT find LZ4 (missing: LZ4_LIBRARY LZ4_INCLUDE_DIR)
– LZ4 not found. Switching on builtin_lz4 option
– Looking for X11
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB)
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindX11.cmake:366 (find_package_handle_standard_args)
cmake/modules/SearchInstalledSoftware.cmake:16 (_find_package)
cmake/modules/SearchInstalledSoftware.cmake:304 (find_package)
CMakeLists.txt:192 (include)
– Configuring incomplete, errors occurred!

Then I tried to build Root in the root_build directory and the following error appeared:
make: *** No targets specified and no makefile found. Stop.

But the directory CMakeFile does exist in the root_build directory.
Any help will be appreciated. Thanks.

Hi @CzTee,
and welcome to the ROOT forum!
Those instructions are fairly dated, please see https://root.cern/install for the ufficial up-to-date installation instructions.

ROOT has a conda package now, so if you want to install ROOT within an anaconda environment all you need is conda install -c conda-forge root (although creating a specific environment for ROOT and its dependencies is probably advisable).

Cheers,
Enrico

EDIT:
about your actual building issue: if I interpret the cmake configuration command correctly, the problem is that ROOT could not find X11 on your system. Changing the command to cmake -DCMAKE_INSTALL_PREFIX=../root_install -Dx11=OFF ../cztee/root_scr/root-6.22.06/ might help (note the extra -Dx11=OFF, in case you don’t need graphics).

1 Like

Thank you for your replies and the help to identify the error! I installed X11 and subsequent missing headers (suggested by https://gradient233.wordpress.com/2019/11/15/how-to-compile-root-with-python3/) and ROOT was built successfully.

Also, following the build instructions from the link https://root.cern/install/ and I found that in source ../root_install/bin/thisroot.sh , my root_install is empty and I found /bin/thisroot.sh is in the directory root_build instead. Is this something I should be concerned with? The root_install directory is empty. Should I expect anything inside this directory? Or I could just work with source ../root_build/bin/thisroot.sh ?

In case anyone has similar question as me:
In order to make conda install -c conda-forge root works, should I download the binary distribution of ROOT for that?

Thank you!

root_install is populated by an install command, such as make install or cmake --build . -- install. It’s generally better to do the install step and then take ROOT from the install directory rather than the build directory: the build directory contains a bunch of extra artifacts that are only needed for the build process.

conda install -c conda-forge root installs ROOT for you, that’s the only command you need to get a fully functioning ROOT on your computer (assuming a functioning conda installation).

Cheers,
Enrico