I just updated to the latest TBB source release and started using the new CMake support files, primarily calling tbb_build to build the library. Initially, however, I found dismal performance and completely serialized behaviour was the result. After hacking around I managed to turn on make's verbose setting (it would be nice if there was an easy and documented way to do this in tbb_build's interface), and I discovered that -std=c++11 was not being passed to the compiler. Using CMake's normal mechanism for choosing the language standard didn't work, so I ended up adding this to MAKE_ARGS:
This seems surprising considering that TBB now requires C++11, I believe. Really I would prefer that it respect the usual CMake options, or at least (again) it should be a documented part of the tbb_build interface.
Hi Andrew, thank you for the feedback!
Currently the only way to pass the desired standard is MAKE_ARGS. You can pass custom arguments supported by TBB make-system (described in <tbb>/build/index.html) or/and other make-arguments. For standard there is an option "stdver":
tbb_build(TBB_ROOT <tbb> CONFIG_DIR <var> MAKE_ARGS stdver=c++11)
We will work on auto detection of the standard in CMake environment to use it during the TBB build. Moreover, we will work on improvement of debug capabilities for this module.
I have just been trying to get the latest release to build from source using make (with gcc 8.2 on linux), and I happen to notice that the stdver=xxx option has the proper effect on the release build, but doesn't appear to affect the debug build. Is this a bug in the makefile or is it intentional for some reason?
Hi Andrew, could you please provide more details how you reproduce the problem? What command do you use and how do you check the effect?
I was not able to reproduce the problem on Fedora 29 with gcc 8.2.1.
Just for your information: we are working on automatic stdver insertion based on CMAKE_CXX_STANDARD.
I'm not sure what else to tell you. I am using OEL7.1 and a locally built version off GCC 8.2.0. To repeat, I am using "make" and not "cmake" in instance.
I run "make stdver=c++17" and all the g++ invocations during the ensuing release build include the command line argument -std=c++17, while the g++ command lines for the debug build do not.
Andrew, could you please run the commands below and provide output? You can see that in my case concurrent_hash_map.cpp for both debug and release was compiled with -std=c++17.
$> cd /tmp/
$> git clone https://github.com/01org/tbb.git
Cloning into 'tbb'...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 12336 (delta 0), reused 0 (delta 0), pack-reused 12335
Receiving objects: 100% (12336/12336), 33.96 MiB | 2.56 MiB/s, done.
Resolving deltas: 100% (9850/9850), done.
$> cd tbb
$> make stdver=c++17 | grep concurrent_hash_map.cpp
../../build/Makefile.tbb:32: CONFIG: cfg=debug arch=intel64 compiler=gcc target=linux runtime=cc8_libc2.28_kernel4.18.16
g++ -o concurrent_hash_map.o -c -MMD -DTBB_USE_DEBUG -DDO_ITT_NOTIFY -g -O0 -DUSE_PTHREAD -m64 -mrtm -fPIC -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wextra -Wno-parentheses -Wno-sized-deallocation -std=c++17 -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_hash_map.cpp
../../build/Makefile.tbb:32: CONFIG: cfg=release arch=intel64 compiler=gcc target=linux runtime=cc8_libc2.28_kernel4.18.16
g++ -o concurrent_hash_map.o -c -MMD -DDO_ITT_NOTIFY -g -O2 -DUSE_PTHREAD -m64 -mrtm -fPIC -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wextra -Wno-parentheses -Wno-sized-deallocation -std=c++17 -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_hash_map.cpp
$> make --version
GNU Make 4.2.1
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.