NVIDIA / NVIDIA/cccl

Missing symbols in MSVC C++ compilation, many headers fail to compile

Open
#1,006 4 comments 0 reactions 0 assignees View on GitHub
libcu++
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

**Simple reproducer and more info at this repo**: https://github.com/lpisha/test_cudastd_msvc

This is in the context of projects which contain both C++ and CUDA source files, where the C++ files are compiled with MSVC and the CUDA files with nvcc. The project uses the CUDA Standard Library across host and device code, so common headers which get included by both .cpp and .cu files include parts of the CUDA Standard Library.

During C++ compilation, two headers in the CUDA Standard Library, `` and ``, expect that MSVC will have declared / defined certain symbols, but it has not, causing compilation errors. About half of the headers in the CUDA Standard Library include these two headers, making much of the library unusable.

This bug does not arise in the compilation of .cu files with nvcc, only in the compilation of .cpp files with MSVC.

The issues with `` were introduced between VS 2019 and VS 2022 due to changes to the MSVC headers. The issues with `` do not appear to be version-related; it appears that the `libcudacxx` code could never have worked on MSVC in the C++ context.

Please see the README at https://github.com/lpisha/test_cudastd_msvc for more info.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.