如何修复 ROOT ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
问题
运行 ROOT 程序时,你看到如下错误消息
cling_cifactory_error.txt
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
LC_ALL=C x86_64-linux-gnu-g++-7 -xc++ -E -v /dev/null 2>&1 | sed -n -e '/^.include/,${' -e '/^ \/.*++/p' -e '}'
Results was:
With exit code 0解决方案
通常,这意味着你为操作系统或编译器使用了错误版本的 ROOT。因此,最简单的解决方案是为你的操作系统下载合适版本的 ROOTx86_64-linux-gnu-g++-7 如果不可能,正确的解决方案是从源代码构建 ROOT。这样,你可以确保 ROOT 使用正确的编译器和设置为你的系统构建。有关更多说明,请参见从源代码构建 ROOT。
如果这也不行 - 通常是由于某些不常见的编译器或操作系统 - 你可以尝试对我有效的技巧:
首先,使用普通的 g++ 编译器运行命令:
check_gpp_includes.sh
g++ -xc++ -E -v /dev/null 2>&1 | sed -n -e '/^.include/,${' -e '/^ \/.*++/p' -e '}'它应该产生至少一行输出,例如:
gpp_include_output.txt
/usr/include/c++/7
/usr/include/c++/7/x86_64-suse-linux
/usr/include/c++/7/backward如果可行,你可以通过创建从 g++ 到 x86_64-linux-gnu-g++-7 的符号链接来给 root 它期望的编译器名称。记住从错误消息中复制编译器名称,因为你的系统或 ROOT 版本可能不同。
你需要将该符号链接放在 PATH 上可访问的某个目录中。如果你有 sudo 权限,使用 /usr/local/bin,如果没有,我推荐 $HOME/usr/bin(但你需要将其添加到你的 PATH)。
create_gpp_symlink.sh
ln -s $(which g++) $HOME/usr/bin/x86_64-linux-gnu-g++-7之后,ROOT 将能够找到假编译器并应该正常工作。
Check out similar posts by category:
ROOT
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow