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

Move R-specific interface code from main library to R interface repo #28

Open
imciner2 opened this issue Apr 7, 2022 · 2 comments
Open

Comments

@imciner2
Copy link
Member

imciner2 commented Apr 7, 2022

The merging of osqp/osqp#396 in the main OSQP library repo will allow us to move the R-specific printing functions to the R repo, removing the need to include the R headers and code in the main library.

This is also possible to do with the memory allocation functions currently, and hopefully the timing/interrupt functions will move to this as well, so we can then move all R-interface specific code to the interface and remove it from the main library repo - allowing us to then remove the R CMake parts from the main library and only have it here in the interface.

@imciner2
Copy link
Member Author

imciner2 commented Aug 4, 2022

The R-specific code for the printing functions is:

# include <R_ext/Print.h>

# define c_print Rprintf
    /* Some CRAN builds complain about __VA_ARGS__, so just print */
    /* out the error messages on R without the __FUNCTION__ trace */
# undefine c_eprint
# define c_eprint Rprintf

This should be placed into a header file, and then the OSQP_CUSTOM_PRINTING CMake option should be set to the header file containing that code.

@bnaras
Copy link
Collaborator

bnaras commented Oct 19, 2023

@imciner2 As I only started looking into this now, it is not clear to me which commit the above code snippet refers to. But I am happy to make any change.

One note, however: Lines 385-394 are unnecessary because CRAN procedures indicate that such details (e.g. CFLAGS, CPPFLAGS) should be set in environment variables to CMAKE. Indeed, in the currently released version 0.6.3, I just comment them out.

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

2 participants