user2315094
user2315094

Reputation: 809

Intel TBB in Ubuntu 16.04 gcc8: std::uncaught_exception()’ is deprecated

I would like to properly install and configure the latest stable release of Intel TBB in my Ubuntu 16.04 Server Edition with gcc version 8.1.0 (Ubuntu 8.1.0-5ubuntu1~16.04). I downloaded the latest stable release of TBB for linux : https://github.com/01org/tbb/releases/download/2018_U5/tbb2018_20180618oss_lin.tgz and then, following the instructions given in this video tutorial: https://www.youtube.com/watch?v=4nrDZjyIOXE I modified in this file /home/marco/tbb2018_20180618oss/bin/tbbvars.sh this line:

#TBBROOT=SUBSTITUTE_INSTALL_DIR_HERE

into

TBBROOT=/home/marco/tbb2018_20180618oss

And then, following the same video tutorial I executed:

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

Within the main directory tbb2018_20180618oss I created a test dir and filled it with a simple test.cpp file :

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

Where test.cpp is :

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

int main() {
  return 0;
}

Compiling I got a list of warnings which are not really understandable, since I didn't put anything actually in 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$
`

What am I missing? How to solve the problem? Looking forward to your kind help. Marco

Upvotes: 0

Views: 443

Answers (1)

Alex
Alex

Reputation: 632

The warnings can be safely ignored. Currently, TBB uses some deprecated stuff in C++17. We will try to fix warnings in future releases.

Upvotes: 2

Related Questions