Ubuntu 16.04 gcc8中的Intel TBB:std :: uncaught_exception()已弃用

时间:2018-07-11 16:31:28

标签: ubuntu-16.04 intel c++17 tbb gcc8

我想在我的Ubuntu 16.04 Server Edition中以gcc版本8.1.0(Ubuntu 8.1.0-5ubuntu1〜16.04)正确安装和配置Intel TBB的最新稳定版本。 我下载了用于Linux的TBB最新稳定版本:https://github.com/01org/tbb/releases/download/2018_U5/tbb2018_20180618oss_lin.tgz,然后按照此视频教程中给出的说明进行操作: https://www.youtube.com/watch?v=4nrDZjyIOXE我在此文件/home/marco/tbb2018_20180618oss/bin/tbbvars.sh的以下行中进行了修改:

#TBBROOT=SUBSTITUTE_INSTALL_DIR_HERE

进入

TBBROOT=/home/marco/tbb2018_20180618oss

然后,按照我执行的同一视频教程:

marco@PC:~/tbb2018_20180618oss/bin$ . ./tbbvars.sh intel64
marco@PC:~/tbb2018_20180618oss/bin$

在主目录tbb2018_20180618oss中,我创建了一个测试目录,并用一个简单的test.cpp文件填充了该文件:

marco@PC:~/tbb2018_20180618oss/test$ nano test.cpp

test.cpp在哪里:

#include <tbb/tbb.h>
#include <tbb/parallel_for.h>

int main() {
  return 0;
}

编译时,我得到了一些难以理解的警告列表,因为我实际上没有在test.cpp中放置任何内容:

marco@PC:~/tbb2018_20180618oss/test$ g++ -std=c++17 test.cpp -ltbb -otest
In file included from /home/marco/tbb2018_20180618oss/include  
/tbb/tbb.h:77,
                 from test.cpp:1:
/home/marco/tbb2018_20180618oss/include/tbb/task_group.h: In destructor  
‘tbb::internal::task_group_base::~task_group_base()’:
/home/marco/tbb2018_20180618oss/include/tbb/task_group.h:131:53: warning: 
‘bool  
std::uncaught_exception()’ is deprecated [-Wdeprecated-declarations]
             bool stack_unwinding_in_progress = std::uncaught_exception();
                                                     ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/8/new:40,
                 from /usr/include/c++/8/ext/new_allocator.h:33,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits
/c++allocator.h:33,
                 from /usr/include/c++/8/bits/allocator.h:46,
                 from /usr/include/c++/8/memory:63,
                 from /home/marco/tbb2018_20180618oss/include
/tbb/tbb_stddef.h:427,
                 from /home/marco/tbb2018_20180618oss/include
/tbb/aligned_space.h:24,
                 from /home/marco/tbb2018_20180618oss/include
/tbb/tbb.h:35,
                 from test.cpp:1:
/usr/include/c++/8/exception:102:8: note: declared here
   bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __attribute__   
((__pure__));
        ^~~~~~~~~~~~~~~~~~
In file included from /home/marco/tbb2018_20180618oss/include 
/tbb/tbb.h:77,
                 from test.cpp:1:
/home/marco/tbb2018_20180618oss/include/tbb/task_group.h:131:72: warning: 
  ‘bool   
std::uncaught_exception()’ is deprecated [-Wdeprecated-declarations]
             bool stack_unwinding_in_progress = std::uncaught_exception();
                                                                        ^
In file included from /usr/include/c++/8/new:40,
                 from /usr/include/c++/8/ext/new_allocator.h:33,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits  
/c++allocator.h:33,
                 from /usr/include/c++/8/bits/allocator.h:46,
                 from /usr/include/c++/8/memory:63,
                 from /home/marco/tbb2018_20180618oss/include
/tbb/tbb_stddef.h:427,
                 from /home/marco/tbb2018_20180618oss/include  
/tbb/aligned_space.h:24,
                 from /home/marco/tbb2018_20180618oss/include
/tbb/tbb.h:35,
                 from test.cpp:1:
/usr/include/c++/8/exception:102:8: note: declared here
   bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __attribute__ 
((__pure__));
        ^~~~~~~~~~~~~~~~~~
In file included from /home/marco/tbb2018_20180618oss/include
/tbb/tbb.h:77,
                 from test.cpp:1:
/home/marco/tbb2018_20180618oss/include/tbb/task_group.h:131:72: warning: 
 ‘bool    
std::uncaught_exception()’ is deprecated [-Wdeprecated-declarations]
             bool stack_unwinding_in_progress = std::uncaught_exception();
                                                                        ^
In file included from /usr/include/c++/8/new:40,
                 from /usr/include/c++/8/ext/new_allocator.h:33,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits
/c++allocator.h:33,
                 from /usr/include/c++/8/bits/allocator.h:46,
                 from /usr/include/c++/8/memory:63,
                 from /home/marco/tbb2018_20180618oss/include
/tbb/tbb_stddef.h:427,
                 from /home/marco/tbb2018_20180618oss/include  
/tbb/aligned_space.h:24,
                 from /home/marco/tbb2018_20180618oss/include
/tbb/tbb.h:35,
                 from test.cpp:1:
/usr/include/c++/8/exception:102:8: note: declared here
   bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __attribute__ 
((__pure__));
        ^~~~~~~~~~~~~~~~~~
marco@PC:~/tbb2018_20180618oss/test$
`

我想念什么?如何解决问题? 期待您的帮助。 马可

1 个答案:

答案 0 :(得分:2)

可以安全地忽略警告。当前,TBB在C ++ 17中使用了一些不推荐使用的东西。我们将尝试在以后的版本中修复警告。