kokkos / kokkos/mdspan

Still cannot build mdspan under MSVC 2019

Open
#26 15 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
507
Forks
87
Avg merge
15h 27m
Merged PRs (30d)
2

Description

@dhollman In the conclusion to our discussion related to issue #22, you expressed that you have a version of mdspan (master?) working in Visual Studio. You expressed the need to set the compiler option /Zc:__cplusplus, which I have done. Can you provide details concerning the working setup that you are using? I am still unable to build mdspan from Visual Studio 2019.

I am using Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28804.1 for x64 under Visual Studio 2019 v. 16.6.0 Preview 4.0.

  • We are limited to the C++14 standard (CMAKE_CXX_STANDARD 14).
  • CXX FLAGS are /Gy /fp:precise /DWIN32 /D_WINDOWS /MP /wd4251 /arch:AVX2 /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /EHa /Zc:__cplusplus -openmp /W4

The error I see is:

C:\work\kinetictheory\draco\src\experimental\__p0009_bits\trait_backports.hpp(64,1): error C2371: 'std::is_assignable_v': redefinition; different basic types 
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.26.28801\include\type_traits(685): message : see declaration of 'std::is_assignable_v' [C:\work\vs2019-x64-Debug\draco\src\experimental\test\Ut_experimental_tst_mdspan_exe.vcxproj]
C:\work\kinetictheory\draco\src\experimental\__p0009_bits\trait_backports.hpp(65,1): error C2371: 'std::is_constructible_v': redefinition; different basic types 
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.26.28801\include\type_traits(638): message : see declaration of 'std::is_constructible_v' [C:\work\vs2019-x64-Debug\draco\src\experimental\test\Ut_experimental_tst_mdspan_exe.vcxproj]
C:\work\kinetictheory\draco\src\experimental\__p0009_bits\trait_backports.hpp(66,1): error C2371: 'std::is_convertible_v': redefinition; different basic types 
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.26.28801\include\type_traits(473): message : see declaration of 'std::is_convertible_v' [C:\work\vs2019-x64-Debug\draco\src\experimental\test\Ut_experimental_tst_mdspan_exe.vcxproj]
C:\work\kinetictheory\draco\src\experimental\__p0009_bits\trait_backports.hpp(67,1): error C2371: 'std::is_default_constructible_v': redefinition; different basic types 
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.26.28801\include\type_traits(656): message : see declaration of 'std::is_default_constructible_v' [C:\work\vs2019-x64-Debug\draco\src\experimental\test\Ut_experimental_tst_mdspan_exe.vcxproj]
C:\work\kinetictheory\draco\src\experimental\__p0009_bits\trait_backports.hpp(68,1): error C2371: 'std::is_trivially_destructible_v': redefinition; different basic types 
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.26.28801\include\type_traits(824): message : see declaration of 'std::is_trivially_destructible_v' [C:\work\vs2019-x64-Debug\draco\src\experimental\test\Ut_experimental_tst_mdspan_exe.vcxproj]
C:\work\kinetictheory\draco\src\experimental\__p0009_bits\trait_backports.hpp(69,1): error C2371: 'std::is_same_v': redefinition; different basic types 
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.26.28801\include\xtr1common(79): message : see declaration of 'std::is_same_v' [C:\work\vs2019-x64-Debug\draco\src\experimental\test\Ut_experimental_tst_mdspan_exe.vcxproj]
C:\work\kinetictheory\draco\src\experimental\__p0009_bits\trait_backports.hpp(70,1): error C2371: 'std::is_empty_v': redefinition; different basic types 
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.26.28801\include\type_traits(536): message : see declaration of 'std::is_empty_v' [C:\work\vs2019-x64-Debug\draco\src\experimental\test\Ut_experimental_tst_mdspan_exe.vcxproj]
C:\work\kinetictheory\draco\src\experimental\__p0009_bits\trait_backports.hpp(71,1): error C2371: 'std::is_void_v': redefinition; different basic types 
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.26.28801\include\type_traits(156): message : see declaration of 'std::is_void_v' [C:\work\vs2019-x64-Debug\draco\src\experimental\test\Ut_experimental_tst_mdspan_exe.vcxproj]
C:\work\kinetictheory\draco\src\experimental\__p0009_bits\subspan.hpp(484,1): error C3546: '...': there are no parameter packs available to expand 
    tstFunction_Traits.cc
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.26.28801\include\xstring(4342,5): error C2976: 'std::_Compressed_pair': too few template arguments 
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.26.28801\include\xmemory(1319): message : see declaration of 'std::_Compressed_pair' [C:\work\vs2019-x64-Debug\draco\src\experimental\test\Ut_experimental_tst_mdspan_exe.vcxproj]

I also attempted to build the examples provided in the mdspan repository. Using the attached CMakeSettings.json for option x64-Debug, I ran into the following errors:

CMakeSettings.json.txt


    Checking Build System
    ctest_extents_ctors.vcxproj -> C:\work\vs2019-x64-Debug\mdspan\compilation_tests\Debug\ctest_extents_ctors.exe
    ctest_constexpr_layouts.vcxproj -> C:\work\vs2019-x64-Debug\mdspan\compilation_tests\Debug\ctest_constexpr_layouts.exe
    ctest_constructor_sfinae.vcxproj -> C:\work\vs2019-x64-Debug\mdspan\compilation_tests\Debug\ctest_constructor_sfinae.exe
    Building Custom Rule C:/work/vs2019-x64-Debug/mdspan/tests/googletest-src/googletest/CMakeLists.txt
    ctest_constexpr_subspan.cpp
    ctest_standard_layout.cpp
    ctest_constexpr_dereference.cpp
    ctest_no_unique_address.cpp
    gtest.vcxproj -> C:\work\vs2019-x64-Debug\mdspan\lib\Debug\gtestd.lib
C:\work\kinetictheory\mdspan\compilation_tests\ctest_constexpr_dereference.cpp(80,1): fatal error C1001: Internal compiler error. 
    (compiler file 'msc1.cpp', line 1533)
     To work around this problem, try simplifying or changing the program near the locations listed above.
    If possible please provide a repro here: https://developercommunity.visualstudio.com
    Please choose the Technical Support command on the Visual C++
     Help menu, or open the Technical Support help file for more information
  C:\work\kinetictheory\mdspan\compilation_tests\ctest_constexpr_dereference.cpp(77,1): message : while evaluating constexpr function 'simple_static_sum_test_1' [C:\work\vs2019-x64-Debug\mdspan\compilation_tests\ctest_constexpr_dereference.vcxproj]
    INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\CL.exe'
        Please choose the Technical Support command on the Visual C++
        Help menu, or open the Technical Support help file for more information

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported Visual Studio 2019 build using the attached CMakeSettings.json.txt and the listed compiler flags. Start with experimental/__p0009_bits/trait_backports.hpp, experimental/__p0009_bits/subspan.hpp, and compilation_tests/ctest_constexpr_dereference.cpp, then compare the reported errors. Done means the mdspan examples and tests build successfully under the stated MSVC configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.