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

Fix R-devel tests, fix R API calls for R 4.5.0 R_NO_REMAP changes #242

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

glin
Copy link
Contributor

@glin glin commented Jan 6, 2025

Same as rstudio/r-docker#120, the R-devel tests have been failing for a few months because the test package uses C API that now needs Rf_ prepended:

R_VERSION=devel make test-ubuntu-2404

g++ -std=gnu++11 -I"/opt/R/devel/lib/R/include" -DNDEBUG   -I/usr/local/include    -fpic  -g -O2  -DR_NO_REMAP -c subtract.cpp -o subtract.o
In file included from subtract.cpp:2:
subtract.cpp: In function 'SEXPREC* subtract(SEXP, SEXP)':
subtract.cpp:6:25: error: 'allocVector' was not declared in this scope; did you mean 'Rf_allocVector'?
    6 |   SEXP result = PROTECT(allocVector(REALSXP, 1));
      |                         ^~~~~~~~~~~
/opt/R/devel/lib/R/include/Rinternals.h:388:36: note: in definition of macro 'PROTECT'
  388 | #define PROTECT(s)      Rf_protect(s)
      |                                    ^
subtract.cpp:7:21: error: 'asReal' was not declared in this scope
    7 |   REAL(result)[0] = asReal(a) - asReal(b);
      |                     ^~~~~~
make: *** [/opt/R/devel/lib/R/etc/Makeconf:204: subtract.o] Error 1
ERROR: compilation failed for package 'testpkg'

@glin glin requested a review from gaborcsardi January 6, 2025 21:04
@glin glin merged commit 45b0805 into main Jan 6, 2025
228 checks passed
@glin glin deleted the fix-r-devel branch January 6, 2025 21:44
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

Successfully merging this pull request may close these issues.

2 participants