Error for installing Root source in Ubuntu 22.04

So i have continues with:

git clone https://github.com/root-project/root.git root_src


and
cmake --build . – install -j8
It goes further, but still stops with an error at some while:

[ 75%] Built target MetaCling
[ 75%] Built target rootcling_stage1
[ 75%] Generating G__Core.cxx, …/lib/Core.pcm
[ 75%] Linking CXX shared library …/…/…/lib/libCling.so
/home/faure/install/cpp/root_build/etc/cling/std.modulemap:442:12: error: header ‘bits/utility.h’ not found
header “bits/utility.h”
^
input_line_1:1:10: note: submodule of top-level module ‘std’ implicitly imported here
#include
^
Warning in cling::IncrementalParser::CheckABICompatibility():
Failed to extract C++ standard library version.
While building module ‘Core’:
While building module ‘Cling_Runtime’ imported from input_line_2:1:
While building module ‘Cling_Runtime_Extra’ imported from /home/faure/install/cpp/root_build/etc/cling/Interpreter/RuntimeUniverse.h:27:
/home/faure/install/cpp/root_build/etc/cling/std.modulemap:442:12: error: header ‘bits/utility.h’ not found
header “bits/utility.h”
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/DynamicExprInfo.h:13:10: note: submodule of top-level module ‘std’ implicitly imported here
#include
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/DynamicExprInfo.h:40:7: error: use of undeclared identifier ‘std’
std::string m_Result;
^
While building module ‘Core’:
While building module ‘Cling_Runtime’ imported from input_line_2:1:
While building module ‘Cling_Runtime_Extra’ imported from /home/faure/install/cpp/root_build/etc/cling/Interpreter/RuntimeUniverse.h:27:
/home/faure/install/cpp/root_build/etc/cling/std.modulemap:442:12: error: header ‘bits/utility.h’ not found
header “bits/utility.h”
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/DynamicLookupLifetimeHandler.h:12:10: note: submodule of top-level module ‘std’ implicitly imported here
#include
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/DynamicLookupLifetimeHandler.h:56:7: error: use of undeclared identifier ‘std’
std::string m_Type;
^
While building module ‘Core’:
While building module ‘Cling_Runtime’ imported from input_line_2:1:
While building module ‘Cling_Runtime_Extra’ imported from /home/faure/install/cpp/root_build/etc/cling/Interpreter/RuntimeUniverse.h:27:
/home/faure/install/cpp/root_build/etc/cling/std.modulemap:442:12: error: header ‘bits/utility.h’ not found
header “bits/utility.h”
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/Visibility.h:13:10: note: submodule of top-level module ‘std’ implicitly imported here
#include
^
While building module ‘Core’:
While building module ‘Cling_Runtime’ imported from input_line_2:1:
While building module ‘Cling_Runtime_Extra’ imported from /home/faure/install/cpp/root_build/etc/cling/Interpreter/RuntimeUniverse.h:27:
/home/faure/install/cpp/root_build/etc/cling/std.modulemap:442:12: error: header ‘bits/utility.h’ not found
header “bits/utility.h”
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/Value.h:17:10: note: submodule of top-level module ‘std’ implicitly imported here
#include <type_traits>
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/Value.h:93:41: error: use of undeclared identifier ‘std’
template <class T, class = typename std::enable_if<std::is_integral::value>::type>
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/Value.h:93:56: error: use of undeclared identifier ‘std’
template <class T, class = typename std::enable_if<std::is_integral::value>::type>
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/Value.h:93:83: error: expected ‘,’ or ‘>’ in template-parameter-list
template <class T, class = typename std::enable_if<std::is_integral::value>::type>
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/Value.h:95:14: error: use of undeclared identifier ‘std’
return std::is_signed::value
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/Value.h:94:35: error: no return statement in constexpr function
static constexpr EStorageType determineStorageTypeT(T*) {
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/Value.h:198:11: error: use of undeclared identifier ‘std’
= std::is_reference::value ?
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/Value.h:199:40: error: use of undeclared identifier ‘std’
determineStorageTypeT((typename std::remove_reference::type**)nullptr)
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/Value.h:199:66: error: expected a qualified name after ‘typename’
determineStorageTypeT((typename std::remove_reference::type**)nullptr)
^
/home/faure/install/cpp/root_build/etc/cling/Interpreter/Value.h:199:66: error: unknown type name ‘type’
While building module ‘Core’:
While building module ‘Cling_Runtime’ imported from input_line_2:1:
In file included from :1:
/home/faure/install/cpp/root_build/etc/cling/Interpreter/RuntimeUniverse.h:27:10: fatal error: could not build module ‘Cling_Runtime_Extra’
#include “cling/Interpreter/Visibility.h”

input_line_2:1:10: fatal error: could not build module 'Cling_Runtime'
#include "cling/Interpreter/RuntimeUniverse.h"
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


etc

Hi @Frederic_Faure ,
I am not sure what might be causing that, maybe a dirty build directory? Are you building in a previously empty build directory?

However, do you really need to build ROOT from source? You can download a pre-compiled binary for Ubuntu 22.04 or install ROOT as a conda or snap package, see Installing ROOT - ROOT .

Cheers,
Enrico

I am using a new building directory. I write these lines:

cd /home/faure/install/cpp

rm -rf root_build root_install root_src

git clone https://github.com/root-project/root.git root_src


mkdir root_build root_install && cd root_build

cmake -Dbuiltin_tbb=ON -Dimt=ON -DCMAKE_INSTALL_PREFIX=../root_install ../root_src 

cmake --build . -- install -j8

I thought that it was necessary to use the source in order to develop some programing c++ code using root, and that binary version allows only interactive sessions? Because i don’t see the test/ directory with some good examples, in the binary version?
But i was wrong, i installed the binary version and it works well. Thanks very much for your helps.

No, any ROOT package should allow compiling your code against ROOT libraries.

The command root-config --tutdir should point to the tutorials directory, which contains several examples. Tests are probably not included (but you can still look at their code on github or by checking out a copy of the ROOT sources with git).

Great! And sorry about the troubles building from source, that should of course not happen :confused:

Cheers,
Enrico

P.S.
I just found out that your compilation error is due to a (temporary) issue with GCC and C++17, diagnosed here: [cxxmodules] Reduce the amount of header duplications in the modules. by vgvassilev · Pull Request #10498 · root-project/root · GitHub

Ok, thanks. If i understand this issue has been detected but not resolved so far. So i will wait before using the source version.

The issue with the master branch has been fixed by @hahnjo , the most recent version of the branch should compile.

Hello,
Thanks very much for this. It compiles and works very well.
Have a nice day,
Frédéric.

=====================
Just a remark that i don’t understand:
At some point it appears the following error message, but the compilation process is not stopping and at the end everything seems to work. I don’t know if this message means a difficulty?.

67%] Building CXX object interpreter/llvm/src/lib/Transforms/IPO/CMakeFiles/LLVMipo.dir/GlobalOpt.cpp.o
[ 67%] Building CXX object interpreter/llvm/src/lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/SplitKit.cpp.o
[ 67%] Building CXX object interpreter/llvm/src/lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/GVN.cpp.o
[ 67%] Building CXX object interpreter/llvm/src/lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/StackColoring.cpp.o
[ 67%] Building CXX object interpreter/llvm/src/lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/StackMapLivenessAnalysis.cpp.o
[ 67%] Building CXX object interpreter/llvm/src/lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/StackMaps.cpp.o
IPDL protocol error: Handler returned error code!

###!!! [Parent][DispatchAsyncMessage] Error: PClientManager::Msg_ExpectFutureClientSource Processing error: message was deserialized, but the handler returned false (indicating failure)

IPDL protocol error: Handler returned error code!

###!!! [Parent][DispatchAsyncMessage] Error: PClientManager::Msg_ForgetFutureClientSource Processing error: message was deserialized, but the handler returned false (indicating failure)

IPDL protocol error: Handler returned error code!

###!!! [Parent][DispatchAsyncMessage] Error: PClientManager::Msg_ExpectFutureClientSource Processing error: message was deserialized, but the handler returned false (indicating failure)

[ 67%] Building CXX object interpreter/llvm/src/lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/StackProtector.cpp.o
IPDL protocol error: Handler returned error code!

###!!! [Parent][DispatchAsyncMessage] Error: PClientManager::Msg_ForgetFutureClientSource Processing error: message was deserialized, but the handler returned false (indicating failure)

JavaScript error: resource:///modules/ActivityManager.jsm, line 129: NS_ERROR_NOT_AVAILABLE:
[ 67%] Building CXX object interpreter/llvm/src/lib/Transforms/IPO/CMakeFiles/LLVMipo.dir/GlobalSplit.cpp.o
[ 67%] Building CXX object interpreter/llvm/src/tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaTemplateVariadic.cpp.o

Are you sure that comes from the ROOT build and not from another process that’s running in that terminal, e.g. firefox or thunderbird?

Down yet?

Oups, may be, sorry then.

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