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

using Geany with R and compiled code #2532

Closed
jangorecki opened this issue Jun 20, 2020 · 5 comments
Closed

using Geany with R and compiled code #2532

jangorecki opened this issue Jun 20, 2020 · 5 comments

Comments

@jangorecki
Copy link

jangorecki commented Jun 20, 2020

Many R packages contains compiled code, most commonly C.
I found some docs about using Geany with R https://wiki.geany.org/howtos/using_geany_with_r but they not mention anything about compiling C code.
Could anyone extend documentation on how to setup Geany for R's compiled code? I can imagine this is probably R CMD SHLIB command somewhere there.
Presently on the line.

#include <R.h>

I am getting

data.table.h:2:10: fatal error: R.h: No such file or directory
 #include <R.h>
          ^~~~~
compilation terminated.
Compilation failed.

Not sure if that matters, but strictly speaking I am interested in C code being highlighted when there are compiler warning/error, so I can spot errors as I type. I do compilation of a package in a separate shell session.
Thank you.

@elextr
Copy link
Member

elextr commented Jun 21, 2020

If you compile C in a separate shell there is nothing Geany can do, if you compile it in Geany the compiler errors should be parsed and linked to the source line of the error.

Rists are welcome to upgrade the wiki article as required.

@jangorecki
Copy link
Author

jangorecki commented Jun 21, 2020

@elextr Thanks for feedback.

I tried to use command I seen during my compilation:

gcc -I"/usr/share/R/include" -DNDEBUG    -fopenmp -fpic  -O3 -mtune=native -c %f%

and it looks to work

gcc -I"/usr/share/R/include" -DNDEBUG    -fopenmp -fpic  -O3 -mtune=native -c "bmerge.c" (in directory: /home/jan/git/data.table/src)
Compilation finished successfully.

The thing is that I am not getting real-time response about errors.
I tried to put some code that uses an undeclared variable and no lines are getting marked as invalid. To spot the issue in the code I have to run compilation of the file again.
Maybe I just expect too much and such a real-time response about invalid code is not among the features of Geany?

@codebrainz
Copy link
Member

Maybe I just expect too much and such a real-time response about invalid code is not among the features of Geany?

Correct. Geany only reports errors given to it by the compiler when the compiler is executed. It doesn't do like some IDEs where they highlight errors/warnings in real-time as you type.

@jangorecki
Copy link
Author

@codebrainz Thank you. Any idea if there is any plugin that would allow that? or maybe an existing feature request for such functionality, so I can subscribe and be informed if such functionality will be available?
Closing this issue as solved, because compilation works fine.

@codebrainz
Copy link
Member

@jangorecki I'm not aware of any current ones. I had previously tried using libclang for C/C++ but ran into some issues integrating it as a plugin (mentioned in #1195). There is also some discussion #1458.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants