[cfe-dev] Parsing CUDA AST using clang

Aditya Atluri via cfe-dev cfe-dev at lists.llvm.org
Sat Mar 9 12:48:03 PST 2019


Hi,
I am trying to make my toy ast matchers to parse cuda code. But I am
getting an error (log.txt)


-- 
- Aditya Atluri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190309/76e1804b/attachment.html>
-------------- next part --------------
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "add_tmp.cu"
No compilation database found in /Users/adityaatluri/Code/Clang/t06 or any parent directory
fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
error: cannot find libdevice for sm_20. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
error: GPU arch sm_20 is supported by CUDA versions between 7.0 and 8.0 (inclusive), but installation at /usr/local/cuda is 10.0.  Use --cuda-path to specify a different CUDA install, pass a different GPU arch with --cuda-gpu-arch, or pass --no-cuda-version-check.
error: unable to handle compilation, expected exactly one compiler job in ' "/Users/adityaatluri/Code/Clang/t06/clang-tool" "-cc1" "-triple" "x86_64-apple-macosx10.12.0" "-target-sdk-version=10.0" "-aux-triple" "nvptx64-nvidia-cuda" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-fsyntax-only" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "add_tmp.cu" "-mrelocation-model" "pic" "-pic-level" "2" "-mthread-model" "posix" "-mdisable-fp-elim" "-masm-verbose" "-munwind-tables" "-faligned-alloc-unavailable" "-target-cpu" "penryn" "-dwarf-column-info" "-debugger-tuning=lldb" "-ggnu-pubnames" "-target-linker-version" "305" "-resource-dir" "/Users/adityaatluri/Code/Clang/lib/clang/9.0.0" "-internal-isystem" "/Users/adityaatluri/Code/Clang/lib/clang/9.0.0/include/cuda_wrappers" "-internal-isystem" "/usr/local/cuda/include" "-include" "__clang_cuda_runtime_wrapper.h" "-stdlib=libc++" "-internal-isystem" "/Users/adityaatluri/Code/Clang/t06/../include/c++/v1" "-stdlib=libc++" "-internal-isystem" "/Users/adityaatluri/Code/Clang/t06/../include/c++/v1" "-fdeprecated-macro" "-fdebug-compilation-dir" "/Users/adityaatluri/Code/Clang/t06" "-ferror-limit" "19" "-fmessage-length" "0" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fobjc-runtime=macosx-10.12.0" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdiagnostics-show-option" "-x" "cuda" "/Users/adityaatluri/Code/Clang/t06/add_tmp.cu";  "/Users/adityaatluri/Code/Clang/t06/clang-tool" "-cc1" "-triple" "nvptx64-nvidia-cuda" "-aux-triple" "x86_64-apple-darwin16.7.0" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-fsyntax-only" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "add_tmp.cu" "-mrelocation-model" "static" "-mthread-model" "posix" "-mdisable-fp-elim" "-no-integrated-as" "-faligned-alloc-unavailable" "-fcuda-is-device" "-target-cpu" "sm_20" "-dwarf-column-info" "-debugger-tuning=gdb" "-target-linker-version" "305" "-resource-dir" "/Users/adityaatluri/Code/Clang/lib/clang/9.0.0" "-internal-isystem" "/Users/adityaatluri/Code/Clang/lib/clang/9.0.0/include/cuda_wrappers" "-internal-isystem" "/usr/local/cuda/include" "-include" "__clang_cuda_runtime_wrapper.h" "-stdlib=libc++" "-internal-isystem" "/Users/adityaatluri/Code/Clang/t06/../include/c++/v1" "-stdlib=libc++" "-internal-isystem" "/Users/adityaatluri/Code/Clang/t06/../include/c++/v1" "-fdeprecated-macro" "-fno-dwarf-directory-asm" "-fdebug-compilation-dir" "/Users/adityaatluri/Code/Clang/t06" "-ferror-limit" "19" "-fmessage-length" "0" "-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions" "-fdiagnostics-show-option" "-x" "cuda" "/Users/adityaatluri/Code/Clang/t06/add_tmp.cu"; '
Error while processing /Users/adityaatluri/Code/Clang/t06/add_tmp.cu.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_tmp.cu
Type: application/octet-stream
Size: 224 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190309/76e1804b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Main.mk
Type: application/octet-stream
Size: 1195 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190309/76e1804b/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Main.cpp
Type: application/octet-stream
Size: 1422 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190309/76e1804b/attachment-0002.obj>


More information about the cfe-dev mailing list