xgboost
xgboost copied to clipboard
[MSVC][permissive-] xgboost failed to build with error C3779 under /permissive- on MSVC
Hi all, The MSVC team recently added xgboost as part of RWC testing. But we found error C3779 when building xgboost with '/permissive-'. Could you please take a quick look at the issue? Thanks in advance.
Repro steps:
- git clone https://github.com/dmlc/xgboost.git F:\gitP\dmlc\xgboost
- cd F:\gitP\dmlc\xgboost & mkdir build_amd64
- set CL= /permissive-
- cd F:\gitP\dmlc\xgboost\build_amd64
- cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON ..
- msbuild /m /p:Platform=x64 /p:Configuration=Release xgboost.sln /t:Rebuild
Expected Behavior xgboost could build successfully with '/permissive-'.
Actual Behavior build.log
test_regen.cc
F:\gitP\dmlc\xgboost\tests\cpp\tree\test_regen.cc(69,30): error C3779: 'xgboost::anonymous-namespace'::RegenTest::Iter': a function that returns 'auto' cannot be used before it is defined F:\gitP\dmlc\xgboost\tests\cpp\tree\test_regen.cc(60): note: see declaration of 'xgboost::
anonymous-namespace'::RegenTest::Iter'
F:\gitP\dmlc\xgboost\tests\cpp\tree\test_regen.cc(63,10): note: This diagnostic occurred in the compiler generated function 'size_t xgboost::`anonymous-namespace'::RegenTest::TestTreeMethod(std::string,std::string,bool) const'
I don't currently have a windows machine at hand, would you like to submit a fix?
@trivialfis No. We recently failed to build xgboost with '/permissive-'. So, I reported a new issue here.
@xiaoxiao-Xu Thank you for reporting this issue. We provide a pre-compiled binary for our Windows users, and we do not enable /permissive-
flag in our build pipeline. Thus, this issue does not directly affect our users, and we will not prioritize this issue for a while. Thanks for your understanding.
Ok. Thanks for your first look. If the issue was fixed, please let me know.
New errors detected under /permissive- and /std:c++latest.
F:\gitP\dmlc\xgboost\tests\cpp\data\test_sparse_page_dmatrix.cc(93,75): error C2039: 'value': is not a member of 'std' [F:\gitP\dmlc\xgboost\build_amd64\testxgboost.vcxproj]
F:\gitP\dmlc\xgboost\tests\cpp\tree\test_regen.cc(69,30): error C3779: 'xgboost::anonymous-namespace'::RegenTest::Iter': a function that returns 'auto' cannot be used before it is defined [F:\gitP\dmlc\xgboost\build_amd64\testxgboost.vcxproj]