0

我想在我的 Ubuntu 16.04 服务器版和 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$
`

我错过了什么?如何解决问题?期待您的帮助。马可

4

1 回答 1

2

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

于 2018-07-12T14:32:48.910 回答