Sublime Forum

Display error output from cuda compiler in editor window

#1

Hi there!

I have a quick question: I am using ST3’s build system for scons to compile my source code. The code is written in C++ / Cuda so some files have the extension *.cu and *.cuh. For C++ files (such as *.cpp, *.h)
compiler errors are displayed nicely in the corresponding line in the text editor. For files with the cuda extensions this does not work. Any idea how to get the compiler error output back into the editor? Thanks a lot!

0 Likes

#2

I think you just need to set the file_regex in your build system (I guess you wrote one to build Cuda files).
By default for C it is

"file_regex": "(.+[^:]):(\\d+):(\\d+): (?:fatal )?((?:error|warning): .+)$"
0 Likes

#3

Thanks for the hint! Though, I did not manage to solve the problem. I guess due to my limited regex knowledge :confused:

This here is the build script which highlights the error output for c++ correctly (cpp and h extensions) and which also works to just fine to compile the whole c++/cuda project. Just the errors in *.cu and *.cuh files are missing.

{
“shell_cmd”: “scons --dbg”,
“file_regex”: “^(.+):([0-9]+):([0-9]+)”,
“working_dir”: “${project_path:${folder}}”,
“selector”: [“source.c++”, “source.python”, “sconstruct”]
}

Any help is highly appreciated!

0 Likes

#4

Maybe post what the error looks like for cuda files

0 Likes

#5

This is how ST3’s console output looks like e.g.:

src/boundaries/cbound.cu(871): error: variable “p_mpiPps” has already been defined

src/boundaries/cbound.cu(871): error: expected a “;”

src/boundaries/cbound.cu(901): warning: parsing restarts here after previous syntax error

0 Likes

#6

Try something like:
^(.)((\d+)(?::(\d+))?):\s((?:error|warning):.+)$

0 Likes