Skip to content
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

Clicking on the error does not take the cursor to that line number. #2213

Closed
mrprajesh opened this issue Jul 10, 2019 · 7 comments

Comments

@mrprajesh
Copy link
Contributor

commented Jul 10, 2019

I am using Geany 1.34 on Linux Mint 19.
It happens after compiling the .cu files/cuda. When there are some compilation errors, clicking on that error does not take the cursor to the corresponding line number. Looks like it works fine with .c and .cpp files.

I am unsure if this is a bug or some options that disabled this feature(could not find on google). Thank you.

@elextr

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

The error messages need to be understood by Geany to get the line numbers, clearly the compiler you are using does not generate errors in a format Geany understands.

You can teach it to understand other formats by setting a regular expression as described in the manual here.

@mrprajesh

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2019

I use Nvidia CUDA compiler(nvcc ). It generates errors of this type.

hello.cu(394): error: too few arguments in function call
hello.cu(382): warning: variable "a" was declared but never referenced

It contains the line number inside () braces but not col number
So, I think the regex is this ^(.+) ( ([0-9]+) )
If you do not mind, could you tell which config files I should put this variable error_regex into?
There are a lot -- under Tools > Config >
Thank you.

@elextr

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

You can set it in the Menu->Build->Set Build Commands dialog.

@mrprajesh

This comment has been minimized.

Copy link
Contributor Author

commented Jul 11, 2019

Thank you very much elextr for your help. My earlier regex needed some edit. I have finally made it work with this.

^(.+)\(([0-9]+)\)

This is going to save me a lot of time; in debugging a few 100 lines of CUDA code. Thank you.

@mrprajesh mrprajesh closed this Jul 11, 2019
@b4n

This comment has been minimized.

Copy link
Member

commented Jul 11, 2019

Shouldn't we add it to the filetypes.CUDA.conf file we provide then?

@elextr

This comment has been minimized.

Copy link
Member

commented Jul 11, 2019

@b4n PRs are welcome :)

@mrprajesh

This comment has been minimized.

Copy link
Contributor Author

commented Jul 12, 2019

I can PR. Can someone confirm the following:
Should we add the variable error_regex=^(.+)\\(([0-9]+)\\) into the file data/filedefs/filetypes.CUDA.conf under [build_settings] ?

is it right and is there anything else we need to edit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.