GithubHelp home page GithubHelp logo

Comments (9)

bheld avatar bheld commented on May 27, 2024 2

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.

akukanov avatar akukanov commented on May 27, 2024 1

I opened a bug: https://developercommunity.visualstudio.com/content/problem/278652/vs-157-incorrectly-reports-c2530-with-permissive-o.html

from onetbb.

alexey-katranov avatar alexey-katranov commented on May 27, 2024

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.

ras0219-msft avatar ras0219-msft commented on May 27, 2024

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.

Dimension4 avatar Dimension4 commented on May 27, 2024

@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.

alexey-katranov avatar alexey-katranov commented on May 27, 2024

@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.

akukanov avatar akukanov commented on May 27, 2024

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.

bheld avatar bheld commented on May 27, 2024

Do you happen to know if Intel has reported this bug to Microsoft?

from onetbb.

akukanov avatar akukanov commented on May 27, 2024

A workaround was added into TBB 2019 Update 1.

from onetbb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.