Oneapi致命错误:compare:系统重新启动后没有这样的文件或目录



我有一个项目已经为我的研究工作了一年多,Oneapi已经集成了6个多月,一切正常。昨天我更新了一些测试代码,并运行了测试,没有任何异常。今天我重新启动了我的机器(Ubuntu 20.04.2 LTS,64位(进行更新,现在当我试图编译这个项目时,它给出了:

In file included from /opt/intel/oneapi/tbb/2021.2.0/env/../include/oneapi/tbb/enumerable_thread_specific.h:26,
from /opt/intel/oneapi/tbb/2021.2.0/env/../include/oneapi/tbb/combinable.h:22,
from /opt/intel/oneapi/tbb/2021.2.0/env/../include/oneapi/tbb.h:35,
from ...file name omitted for privacy...
/opt/intel/oneapi/tbb/2021.2.0/env/../include/oneapi/tbb/concurrent_vector.h:33:10: fatal error: compare: No such file or directory
33 | #include <compare>
|          ^~~~~~~~~
compilation terminated.

这只发生在系统重新启动后(可能断开了一些链接?(,并且只发生在需要concurrent_vector.h 的文件中

理想情况下,我更喜欢一个不需要重新安装oneapi的修复程序,apt-get updateapt-get upgrade没有修复它,也没有重新启动系统。

刚刚遇到了同样的事情。如果使用-std=c++20:进行编译,则看起来TBB自动包含<compare>

https://github.com/oneapi-src/oneTBB/blob/9e15720bc7744f85dff611d34d65e9099e077da4/include/oneapi/tbb/detail/_config.h#L253

#define __TBB_CPP20_COMPARISONS_PRESENT                 __TBB_CPP20_PRESENT

GCC只在libstdc++-10中添加了比较头。

对我来说,这看起来像是TBB中的一个bug。我在这里开了一期。

作为一个修补程序,我能够将我的项目降级到C++17。如果这不是一个选项,您可以考虑复制detail/_config.h,在副本中定义__TBB_CPP20_COMPARISONS_PRESENT 0,并在包含任何TBB标头之前将其包含在内。包含的保护程序应确保您的版本取代损坏的TBB版本。

相关内容

最新更新