Comments (9)
Simply removing /permissive- (e.g. set Comformance Mode to No in the C/C++ options) gets past this issue. I would think Intel would fix this soon)
from onetbb.
I opened a bug: https://developercommunity.visualstudio.com/content/problem/278652/vs-157-incorrectly-reports-c2530-with-permissive-o.html
from onetbb.
I have failed to reproduce the issue with Visual Studio (without vcpkg). I tried c++17 and c++latest but tbb/tbb.h
is compiled successfully. Is it possible to capture the compiler switches (in the output log) when the compiler is invoked with vcpkg?
from onetbb.
If I understand the issue correctly, then the only relevance vcpkg has is that it adds the folder containing tbb/tbb.h
to the MSBuild additional include directories (which translates to a /I
). Notably, we don't modify the user's /std:xyz
setting.
from onetbb.
@alexey-katranov The compiler for the debug build is invoked with
CL.exe /c /I. /Zi /nologo /W4 /WX- /diagnostics:classic /Od /D _WINDLL /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"C:\libs\vcpkg\buildtrees\tbb\src\tbb-633b01ad27e012e1dc4e392c3230250d1f4967a4\build\vs2013\x64\tbb\Debug\\" /Fd"C:\libs\vcpkg\buildtrees\tbb\src\tbb-633b01ad27e012e1dc4e392c3230250d1f4967a4\build\vs2013\x64\tbb\Debug\vc141.pdb" /Gd /TP /FC /errorReport:queue /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include ..\..\src\tbb\concurrent_hash_map.cpp ..\..\src\tbb\concurrent_queue.cpp ..\..\src\tbb\concurrent_vector.cpp ..\..\src\tbb\dynamic_link.cpp ..\..\src\tbb\itt_notify.cpp ..\..\src\tbb\cache_aligned_allocator.cpp ..\..\src\tbb\pipeline.cpp ..\..\src\tbb\queuing_mutex.cpp ..\..\src\tbb\queuing_rw_mutex.cpp ..\..\src\tbb\reader_writer_lock.cpp ..\..\src\tbb\spin_rw_mutex.cpp ..\..\src\tbb\x86_rtm_rw_mutex.cpp ..\..\src\tbb\spin_mutex.cpp ..\..\src\tbb\critical_section.cpp ..\..\src\tbb\mutex.cpp ..\..\src\tbb\recursive_mutex.cpp ..\..\src\tbb\condition_variable.cpp ..\..\src\tbb\tbb_thread.cpp ..\..\src\tbb\concurrent_monitor.cpp ..\..\src\tbb\semaphore.cpp ..\..\src\tbb\private_server.cpp ..\..\src\rml\client\rml_tbb.cpp ..\..\src\tbb\tbb_misc.cpp ..\..\src\tbb\tbb_misc_ex.cpp ..\..\src\tbb\task.cpp ..\..\src\tbb\task_group_context.cpp ..\..\src\tbb\governor.cpp ..\..\src\tbb\market.cpp ..\..\src\tbb\arena.cpp ..\..\src\tbb\scheduler.cpp ..\..\src\tbb\observer_proxy.cpp ..\..\src\tbb\tbb_statistics.cpp ..\..\src\tbb\tbb_main.cpp ..\..\src\old\concurrent_vector_v2.cpp ..\..\src\old\concurrent_queue_v2.cpp ..\..\src\old\spin_rw_mutex_v2.cpp ..\..\src\old\task_v2.cpp
I just verified the error on another machine.
from onetbb.
@Dimension4 I tried your command but it does not reproduce the issue. Could you, please, repeat my experiment to understand if the issue relates to the specific environment or vcpkg somehow? I source the Visual Studio environment for 'x64' and build the TBB sources with the provided command:
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.7.1
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
> CL.exe /c /I. /Zi /nologo /W4 /WX- /diagnostics:classic /Od /D _WINDLL /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"C:\libs\vcpkg\buildtrees\tbb\src\tbb-633b01ad27e012e1dc4e392c3230250d1f4967a4\build\vs2013\x64\tbb\Debug\\" /Fd"C:\libs\vcpkg\buildtrees\tbb\src\tbb-633b01ad27e012e1dc4e392c3230250d1f4967a4\build\vs2013\x64\tbb\Debug\vc141.pdb" /Gd /TP /FC /errorReport:queue /c /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /DDO_ITT_NOTIFY /GS /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0502 /D__TBB_BUILD=1 /W4 /I../../src /I../../src/rml/include /I../../include ..\..\src\tbb\concurrent_hash_map.cpp ..\..\src\tbb\concurrent_queue.cpp ..\..\src\tbb\concurrent_vector.cpp ..\..\src\tbb\dynamic_link.cpp ..\..\src\tbb\itt_notify.cpp ..\..\src\tbb\cache_aligned_allocator.cpp ..\..\src\tbb\pipeline.cpp ..\..\src\tbb\queuing_mutex.cpp ..\..\src\tbb\queuing_rw_mutex.cpp ..\..\src\tbb\reader_writer_lock.cpp ..\..\src\tbb\spin_rw_mutex.cpp ..\..\src\tbb\x86_rtm_rw_mutex.cpp ..\..\src\tbb\spin_mutex.cpp ..\..\src\tbb\critical_section.cpp ..\..\src\tbb\mutex.cpp ..\..\src\tbb\recursive_mutex.cpp ..\..\src\tbb\condition_variable.cpp ..\..\src\tbb\tbb_thread.cpp ..\..\src\tbb\concurrent_monitor.cpp ..\..\src\tbb\semaphore.cpp ..\..\src\tbb\private_server.cpp ..\..\src\rml\client\rml_tbb.cpp ..\..\src\tbb\tbb_misc.cpp ..\..\src\tbb\tbb_misc_ex.cpp ..\..\src\tbb\task.cpp ..\..\src\tbb\task_group_context.cpp ..\..\src\tbb\governor.cpp ..\..\src\tbb\market.cpp ..\..\src\tbb\arena.cpp ..\..\src\tbb\scheduler.cpp ..\..\src\tbb\observer_proxy.cpp ..\..\src\tbb\tbb_statistics.cpp ..\..\src\tbb\tbb_main.cpp ..\..\src\old\concurrent_vector_v2.cpp ..\..\src\old\concurrent_queue_v2.cpp ..\..\src\old\spin_rw_mutex_v2.cpp ..\..\src\old\task_v2.cpp
task_v2.cpp
spin_rw_mutex_v2.cpp
concurrent_queue_v2.cpp
concurrent_vector_v2.cpp
tbb_main.cpp
tbb_statistics.cpp
observer_proxy.cpp
scheduler.cpp
arena.cpp
market.cpp
governor.cpp
task_group_context.cpp
task.cpp
tbb_misc_ex.cpp
tbb_misc.cpp
rml_tbb.cpp
private_server.cpp
semaphore.cpp
concurrent_monitor.cpp
tbb_thread.cpp
Generating Code...
Compiling...
condition_variable.cpp
recursive_mutex.cpp
mutex.cpp
critical_section.cpp
spin_mutex.cpp
x86_rtm_rw_mutex.cpp
spin_rw_mutex.cpp
reader_writer_lock.cpp
queuing_rw_mutex.cpp
queuing_mutex.cpp
pipeline.cpp
cache_aligned_allocator.cpp
itt_notify.cpp
dynamic_link.cpp
concurrent_vector.cpp
concurrent_queue.cpp
concurrent_hash_map.cpp
Generating Code...
> cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.14.26428.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
from onetbb.
Indeed, adding /permissive- allows to reproduce the issue (with VS 15.7.4 / compiler version 19.14.26431 in my case).
However, this is a compiler bug. The code is perfectly valid, compliant C++; the reference is explicitly initialized in the initializer list of the constructor, as it can be seen in the code:
https://github.com/01org/tbb/blob/615bb971db8784ab6c005a856e8ed3e8cea61d9b/include/tbb/task_group.h#L96
Note also that this is seemingly a regression in VS, because at least the initial release of VS 2017 (15.0.something) compiles the code even with /permissive-.
I have tried to remove inheritance from no_copy and explicitly declare the default ctor and copy ctor as deleted, however this did not help. The only other way to work it around I could think of is to use a pointer instead of reference; but this is quite undesirable.
from onetbb.
Do you happen to know if Intel has reported this bug to Microsoft?
from onetbb.
A workaround was added into TBB 2019 Update 1.
from onetbb.
Related Issues (20)
- Possible data race reported by clang thread sanitizer HOT 6
- Disable TBBmalloc info message when compiling VS2022 HOT 2
- Is resumable task exception safe? HOT 4
- oneTBB 2021.11.0 APT package missing FindTBB.cmake HOT 6
- (Delete this issue) [Duplicate] Impossible to build the last version oneTBB 2021.11.0 on Windows with GCC 13.2
- Impossible to build the last version oneTBB 2021.11.0 on Windows with GCC 13.2 HOT 2
- Is there any reason we cannot implement a parallel_reduce for a rvalue range? HOT 2
- How to build TBB with static-libgcc and static-libstdc++ ? HOT 3
- Generating random numbers in parallel HOT 3
- oneTBB to schedule work execution on Intel GPUs HOT 1
- link fails building oneTBB from conan HOT 3
- `tbb::task_arena::enqueue` should at least document that execution order isn't guaranteed HOT 3
- Compiling errors while building with mingw gcc 13.2.0 HOT 1
- Update Node using TBB Nodes HOT 2
- Facing Deadlock issue with nested TBB HOT 8
- Accessible non-virtual destructor HOT 5
- Will using different versions of the library conflict with each other and cause undefined behavior? HOT 3
- TBB cannot be build from FetchContent if OVERRIDE_FIND_PACKAGE is specified
- Build fails within freedesktop runtime HOT 2
- ASAN with gcc11 (RTLD_DEEPBIND flag which is incompatible with sanitizer runtime) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onetbb.