New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
warning: attribute namespace "clang" is unrecognized; High Sierra / Fedora compilation with clang results in spurious clang errors in nvcc #13118
Comments
Any answers to this? |
@meganset @RedChallenger4 could you share what version of clang you are using which results in these warnings? |
cc @carlosgmartin @Jens1503 @waitwaitforget @RedChallenger4 @edwardchor @jordangarside @kumekay @teopb @marpaia @jun-yoon I'm having trouble reproducing this, and it is hard for me to understand how the current macro setup could be not working as we explicitly test (in the macro definition) whether or not the clang-namespaced attribute works or not. More info about the Clang version involved would help quite a bit. |
Thanks for looking into this. clang --version clang --version To build on w'CUDA & CUDNN I needed to set CUDNN_LIB_DIR/INCLUDE_DIR, |
Just tried a build now -- CPU only, on the clang version 6.0.1 machine -- and i'm not seeing all the |
@meganset Thanks for attempting. I haven't tried 9.1.0, maybe I can scrounge up a copy somewhere. |
I am currently getting this warning with clang 10.0.0 on osx 10.13.6 |
Yes, just rebuilt with clang 9.1.0 and still receive the |
I have tried it on clang 8.0.0, clang 9.0.0 and clang 10.0.0 on osx 10.13.6 high sierra and all got this warning : attribute namespace "clang" is unrecognized |
It sounds like this is a High Sierra specific issue. I don't have one box handy but I should get one in a few weeks. |
For information, I'm also seeing the same warning hundreds of lines when compiling PyTorch with clang on Fedora: /data/Workspace/pytorch/c10/core/TensorOptions.h(202): warning: attribute namespace "clang" is unrecognized
/data/Workspace/pytorch/c10/core/TensorOptions.h(217): warning: attribute namespace "clang" is unrecognized
/data/Workspace/pytorch/c10/core/TensorOptions.h(224): warning: attribute namespace "clang" is unrecognized
/data/Workspace/pytorch/c10/core/TensorOptions.h(231): warning: attribute namespace "clang" is unrecognized
/data/Workspace/pytorch/c10/core/TensorOptions.h(239): warning: attribute namespace "clang" is unrecognized
/data/Workspace/pytorch/c10/util/UniqueVoidPtr.h(69): warning: attribute namespace "clang" is unrecognized
/data/Workspace/pytorch/c10/core/Allocator.h(96): warning: attribute namespace "clang" is unrecognized I'm using clang 7.0.1 along with CUDA 10.1 and CuDNN 7.5.0 clang version 7.0.1 (Fedora 7.0.1-6.fc29)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin |
I am seeing the same warnings on a High Sierra box. I'm using clang 10.0.0 along with CUDA 10.1 and cuDNN 7.5.1
|
Interesting, when I changed the "MACOSX_DEPLOYMENT_TARGET" setting to "10.13" in the command and reinstall, that warnings didn't appear at the beginning of the compile, but came out again when progress approached about 70%. Here is the command:
I found on both the official guideline and the github page, it writes MACOSX_DEPLOYMENT_TARGET as fixed as 10.9: Not sure how the setting of "MACOSX_DEPLOYMENT_TARGET" places a difference in the compiling. Any insights? |
@mfuntowicz Your Fedora case is very unusual. I tried reproducing on a stock Fedora system with CUDA 10.1 and was unable to. What happens when you run the following test: test.cpp:
Compile with:
? I've gotten my grubby hands on a High Sierra machine so I'll try reproducing on it. |
@ezyang Thanks for having a look, here is the output: /data/Workspace/pytorch_clang_test echo '[[clang::warn_unused_result]] ✔ 3956 13:57:50
int f() { return 2; }' >> test.cpp
mfuntowicz@localhost /data/Workspace/pytorch_clang_test nvcc -ccbin clang -c test.cpp -std=c++11 -v --compiler-options=-Wall 127 ↵ 3962 13:56:07
#$ _SPACE_=
#$ _CUDART_=cudart
#$ _HERE_=/usr/bin
#$ _THERE_=/usr/bin
#$ _TARGET_SIZE_=
#$ _TARGET_DIR_=
#$ _TARGET_SIZE_=64
#$ NVVMIR_LIBRARY_DIR=/usr/share/cuda
#$ PATH=/usr/libexec/cuda/open64/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/mfuntowicz/bin
#$ INCLUDES="-I/usr/include/cuda"
#$ LIBRARIES="-L/usr/lib64"
#$ CUDAFE_FLAGS=
#$ PTXAS_FLAGS=
#$ clang -std=c++11 -c -x c++ -D__NVCC__ -Wall "-I/usr/include/cuda" -D__CUDACC_VER_MAJOR__=10 -D__CUDACC_VER_MINOR__=1 -D__CUDACC_VER_BUILD__=105 -m64 -o "test.o" "test.cpp" Let me know if you need any other thing on my side that can be helpful. |
I've managed to reproduce on a Fedora docker image. My command log:
|
This appears to be an NVIDIA bug. |
Fixes #13118. Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Make C10_NODISCARD macro more portable for nvcc+clang. Fixes #13118. Signed-off-by: Edward Z. Yang <ezyang@fb.com> gh-metadata: pytorch pytorch 20324 gh/ezyang/125/head
Fixes #13118. Signed-off-by: Edward Z. Yang <ezyang@fb.com> gh-metadata: pytorch pytorch 20324 gh/ezyang/125/head
Make C10_NODISCARD macro more portable for nvcc+clang. Fixes #13118. Signed-off-by: Edward Z. Yang <ezyang@fb.com> gh-metadata: pytorch pytorch 20324 gh/ezyang/125/head
Fixes #13118. Signed-off-by: Edward Z. Yang <ezyang@fb.com> gh-metadata: pytorch pytorch 20324 gh/ezyang/125/head
Make C10_NODISCARD macro more portable for nvcc+clang. Fixes #13118. Signed-off-by: Edward Z. Yang <ezyang@fb.com> gh-metadata: pytorch pytorch 20324 gh/ezyang/125/head
Fixes #13118. Signed-off-by: Edward Z. Yang <ezyang@fb.com> gh-metadata: pytorch pytorch 20324 gh/ezyang/125/head
Make C10_NODISCARD macro more portable for nvcc+clang. Fixes #13118. Signed-off-by: Edward Z. Yang <ezyang@fb.com> gh-metadata: pytorch pytorch 20324 gh/ezyang/125/head
🚀 Feature
Building for mac os generates a lot of new warnings related to C10_NODISCARD macro
(part of the change to make TensorOptions immutable #12630 )
e.g.
pytorch/aten/src/ATen/core/TensorOptions.h(120): warning: attribute namespace "clang" is unrecognized
pytorch/aten/src/ATen/core/TensorOptions.h(129): warning: attribute namespace "clang" is unrecognized
..
pytorch/aten/src/ATen/core/TensorOptions.h(173): warning: attribute namespace "clang" is unrecognized
is there a way to turn these off or fix some error i'm making in setup
thanks
The text was updated successfully, but these errors were encountered: