CRAN Package Check Results for Package inline

Last updated on 2024-12-27 15:48:58 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 0.3.20 2.48 47.65 50.13 OK
r-devel-linux-x86_64-debian-gcc 0.3.20 1.94 33.81 35.75 OK
r-devel-linux-x86_64-fedora-clang 0.3.20 78.40 OK
r-devel-linux-x86_64-fedora-gcc 0.3.20 77.80 OK
r-devel-windows-x86_64 0.3.20 4.00 99.00 103.00 OK
r-patched-linux-x86_64 0.3.20 2.30 41.72 44.02 ERROR
r-release-linux-x86_64 0.3.20 1.90 41.15 43.05 ERROR
r-release-macos-arm64 0.3.20 45.00 OK
r-release-macos-x86_64 0.3.20 76.00 OK
r-release-windows-x86_64 0.3.20 5.00 93.00 98.00 OK
r-oldrel-macos-arm64 0.3.20 45.00 OK
r-oldrel-macos-x86_64 0.3.20 79.00 OK
r-oldrel-windows-x86_64 0.3.20 4.00 103.00 107.00 OK

Check Details

Version: 0.3.20
Check: examples
Result: ERROR Running examples in ‘inline-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: cfunction > ### Title: Inline C, C++, Fortran function calls from R > ### Aliases: cfunction setCMethod > ### Keywords: file > > ### ** Examples > > > x <- as.numeric(1:10) > n <- as.integer(10) > > ## Not run: > ##D ## A simple Fortran example - n and x: assumed-size vector > ##D code <- " > ##D integer i > ##D do 1 i=1, n(1) > ##D 1 x(i) = x(i)**3 > ##D " > ##D cubefn <- cfunction(signature(n="integer", x="numeric"), code, convention=".Fortran") > ##D print(cubefn) > ##D > ##D cubefn(n, x)$x > ##D > ##D ## Same Fortran example - now n is one number > ##D code2 <- " > ##D integer i > ##D do 1 i=1, n > ##D 1 x(i) = x(i)**3 > ##D " > ##D cubefn2 <- cfunction(signature(n="integer", x="numeric"), implicit = "none", > ##D dim = c("", "(*)"), code2, convention=".Fortran") > ##D > ##D cubefn2(n, x)$x > ##D > ##D ## Same in F95, now x is fixed-size vector (length = n) > ##D code3 <- "x = x*x*x" > ##D cubefn3 <- cfunction(sig = signature(n="integer", x="numeric"), implicit = "none", > ##D dim = c("", "(n)"), code3, language="F95") > ##D cubefn3(20, 1:20) > ##D print(cubefn3) > ##D > ##D ## Same example in C > ##D code4 <- " > ##D int i; > ##D for (i = 0; i < *n; i++) > ##D x[i] = x[i]*x[i]*x[i]; > ##D " > ##D cubefn4 <- cfunction(signature(n="integer", x="numeric"), code4, language = "C", convention = ".C") > ##D cubefn4(20, 1:20) > ##D > ##D ## Give the function in the source code a name > ##D cubefn5 <- cfunction(signature(n="integer", x="numeric"), code4, language = "C", convention = ".C", > ##D name = "cubefn") > ##D code(cubefn5) > ## End(Not run) > > ## use of a module in F95 > modct <- "module modcts + double precision, parameter :: pi = 3.14159265358979 + double precision, parameter :: e = 2.71828182845905 + end" > > getconstants <- "x(1) = pi + x(2) = e" > > cgetcts <- cfunction(getconstants, module = "modcts", implicit = "none", + includes = modct, sig = c(x = "double"), dim = c("(2)"), language = "F95") > > cgetcts(x = 1:2) $x [1] 3.141593 2.718282 > print(cgetcts) An object of class 'CFunc' function (x) .Primitive(".Fortran")(<pointer: 0x7f4c0f875100>, x = as.double(x)) <environment: 0x558a900241c0> code: 1: module modcts 2: double precision, parameter :: pi = 3.14159265358979 3: double precision, parameter :: e = 2.71828182845905 4: end 5: SUBROUTINE file3c03f8b1b7d32 ( x ) 6: USE modcts 7: IMPLICIT none 8: DOUBLE PRECISION x(2) 9: x(1) = pi 10: x(2) = e 11: RETURN 12: END 13: > > ## Use of .C convention with C code > ## Defining two functions, one of which calls the other > sigSq <- signature(n="integer", x="numeric") > codeSq <- " + for (int i=0; i < *n; i++) { + x[i] = x[i]*x[i]; + }" > sigQd <- signature(n="integer", x="numeric") > codeQd <- " + squarefn(n, x); + squarefn(n, x); + " > > fns <- cfunction( list(squarefn=sigSq, quadfn=sigQd), + list(codeSq, codeQd), + convention=".C") > > squarefn <- fns[["squarefn"]] > quadfn <- fns[["quadfn"]] > > squarefn(n, x)$x [1] 1 4 9 16 25 36 49 64 81 100 > quadfn(n, x)$x [1] 1 16 81 256 625 1296 2401 4096 6561 10000 > > ## Alternative declaration using 'setCMethod' > setCMethod(c("squarefn", "quadfn"), list(sigSq, sigQd), + list(codeSq, codeQd), convention=".C") > > squarefn(n, x)$x [1] 1 4 9 16 25 36 49 64 81 100 > quadfn(n, x)$x [1] 1 16 81 256 625 1296 2401 4096 6561 10000 > > ## Use of .Call convention with C code > ## Multyplying each image in a stack with a 2D Gaussian at a given position > code <- " + SEXP res; + int nprotect = 0, nx, ny, nz, x, y; + PROTECT(res = Rf_duplicate(a)); nprotect++; + nx = INTEGER(GET_DIM(a))[0]; + ny = INTEGER(GET_DIM(a))[1]; + nz = INTEGER(GET_DIM(a))[2]; + double sigma2 = REAL(s)[0] * REAL(s)[0], d2 ; + double cx = REAL(centre)[0], cy = REAL(centre)[1], *data, *rdata; + for (int im = 0; im < nz; im++) { + data = &(REAL(a)[im*nx*ny]); rdata = &(REAL(res)[im*nx*ny]); + for (x = 0; x < nx; x++) + for (y = 0; y < ny; y++) { + d2 = (x-cx)*(x-cx) + (y-cy)*(y-cy); + rdata[x + y*nx] = data[x + y*nx] * exp(-d2/sigma2); + } + } + UNPROTECT(nprotect); + return res; + " > funx <- cfunction(signature(a="array", s="numeric", centre="numeric"), code) ERROR(s) during compilation: source code errors or compiler configuration errors! make cmd is make -f '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/etc/Makeconf' -f '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/share/make/shlib.mk' -f '/home/hornik/.R/Makevars-gcc' SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB='file3c03f8616606b2.so' CXX_DEFS=-DR_NO_REMAP OBJECTS='file3c03f8616606b2.o' make would use make[1]: Entering directory '/home/hornik/tmp/scratch/RtmpBHT2YH' g++-14 -std=gnu++17 -I"/home/hornik/tmp/R.check/r-patched-gcc/Work/build/include" -DNDEBUG -I/usr/local/include -D_FORTIFY_SOURCE=3 -fpic -g -O2 -Wall -pedantic -mtune=native -DR_NO_REMAP -c file3c03f8616606b2.cpp -o file3c03f8616606b2.o if test "zfile3c03f8616606b2.o" != "z"; then \ echo g++-14 -std=gnu++17 -shared -L"/home/hornik/tmp/R.check/r-patched-gcc/Work/build/lib" -Wl,-O1 -o file3c03f8616606b2.so file3c03f8616606b2.o -L"/home/hornik/tmp/R.check/r-patched-gcc/Work/build/lib" -lR; \ g++-14 -std=gnu++17 -shared -L"/home/hornik/tmp/R.check/r-patched-gcc/Work/build/lib" -Wl,-O1 -o file3c03f8616606b2.so file3c03f8616606b2.o -L"/home/hornik/tmp/R.check/r-patched-gcc/Work/build/lib" -lR; \ fi make[1]: Leaving directory '/home/hornik/tmp/scratch/RtmpBHT2YH' Program source: 1: #include <R.h> 2: #include <Rdefines.h> 3: #include <R_ext/Error.h> 4: 5: 6: extern "C" { 7: SEXP file3c03f8616606b2 ( SEXP a, SEXP s, SEXP centre ); 8: } 9: 10: SEXP file3c03f8616606b2 ( SEXP a, SEXP s, SEXP centre ) { 11: 12: SEXP res; 13: int nprotect = 0, nx, ny, nz, x, y; 14: PROTECT(res = Rf_duplicate(a)); nprotect++; 15: nx = INTEGER(GET_DIM(a))[0]; 16: ny = INTEGER(GET_DIM(a))[1]; 17: nz = INTEGER(GET_DIM(a))[2]; 18: double sigma2 = REAL(s)[0] * REAL(s)[0], d2 ; 19: double cx = REAL(centre)[0], cy = REAL(centre)[1], *data, *rdata; 20: for (int im = 0; im < nz; im++) { 21: data = &(REAL(a)[im*nx*ny]); rdata = &(REAL(res)[im*nx*ny]); 22: for (x = 0; x < nx; x++) 23: for (y = 0; y < ny; y++) { 24: d2 = (x-cx)*(x-cx) + (y-cy)*(y-cy); 25: rdata[x + y*nx] = data[x + y*nx] * exp(-d2/sigma2); 26: } 27: } 28: UNPROTECT(nprotect); 29: return res; 30: 31: warning("your C program does not return anything!"); 32: return R_NilValue; 33: } Compilation ERROR, function(s)/method(s) not created! Error in compileCode(f, code, language, verbose) : using C++ compiler: ‘g++-14 (Debian 14.2.0-8) 14.2.0’ file3c03f8616606b2.cpp: In function ‘SEXPREC* file3c03f8616606b2(SEXP, SEXP, SEXP)’: file3c03f8616606b2.cpp:31:3: error: ‘warning’ was not declared in this scope; did you mean ‘Rf_warning’? 31 | warning("your C program does not return anything!"); | ^~~~~~~ | Rf_warning make[1]: *** [/home/hornik/tmp/R.check/r-patched-gcc/Work/build/etc/Makeconf:202: file3c03f8616606b2.o] Error 1 Calls: cfunction -> compileCode Execution halted Flavor: r-patched-linux-x86_64

Version: 0.3.20
Check: examples
Result: ERROR Running examples in ‘inline-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: cfunction > ### Title: Inline C, C++, Fortran function calls from R > ### Aliases: cfunction setCMethod > ### Keywords: file > > ### ** Examples > > > x <- as.numeric(1:10) > n <- as.integer(10) > > ## Not run: > ##D ## A simple Fortran example - n and x: assumed-size vector > ##D code <- " > ##D integer i > ##D do 1 i=1, n(1) > ##D 1 x(i) = x(i)**3 > ##D " > ##D cubefn <- cfunction(signature(n="integer", x="numeric"), code, convention=".Fortran") > ##D print(cubefn) > ##D > ##D cubefn(n, x)$x > ##D > ##D ## Same Fortran example - now n is one number > ##D code2 <- " > ##D integer i > ##D do 1 i=1, n > ##D 1 x(i) = x(i)**3 > ##D " > ##D cubefn2 <- cfunction(signature(n="integer", x="numeric"), implicit = "none", > ##D dim = c("", "(*)"), code2, convention=".Fortran") > ##D > ##D cubefn2(n, x)$x > ##D > ##D ## Same in F95, now x is fixed-size vector (length = n) > ##D code3 <- "x = x*x*x" > ##D cubefn3 <- cfunction(sig = signature(n="integer", x="numeric"), implicit = "none", > ##D dim = c("", "(n)"), code3, language="F95") > ##D cubefn3(20, 1:20) > ##D print(cubefn3) > ##D > ##D ## Same example in C > ##D code4 <- " > ##D int i; > ##D for (i = 0; i < *n; i++) > ##D x[i] = x[i]*x[i]*x[i]; > ##D " > ##D cubefn4 <- cfunction(signature(n="integer", x="numeric"), code4, language = "C", convention = ".C") > ##D cubefn4(20, 1:20) > ##D > ##D ## Give the function in the source code a name > ##D cubefn5 <- cfunction(signature(n="integer", x="numeric"), code4, language = "C", convention = ".C", > ##D name = "cubefn") > ##D code(cubefn5) > ## End(Not run) > > ## use of a module in F95 > modct <- "module modcts + double precision, parameter :: pi = 3.14159265358979 + double precision, parameter :: e = 2.71828182845905 + end" > > getconstants <- "x(1) = pi + x(2) = e" > > cgetcts <- cfunction(getconstants, module = "modcts", implicit = "none", + includes = modct, sig = c(x = "double"), dim = c("(2)"), language = "F95") > > cgetcts(x = 1:2) $x [1] 3.141593 2.718282 > print(cgetcts) An object of class 'CFunc' function (x) .Primitive(".Fortran")(<pointer: 0x7f927c347100>, x = as.double(x)) <environment: 0x555b7a4d75b0> code: 1: module modcts 2: double precision, parameter :: pi = 3.14159265358979 3: double precision, parameter :: e = 2.71828182845905 4: end 5: SUBROUTINE file378a136bef7eab ( x ) 6: USE modcts 7: IMPLICIT none 8: DOUBLE PRECISION x(2) 9: x(1) = pi 10: x(2) = e 11: RETURN 12: END 13: > > ## Use of .C convention with C code > ## Defining two functions, one of which calls the other > sigSq <- signature(n="integer", x="numeric") > codeSq <- " + for (int i=0; i < *n; i++) { + x[i] = x[i]*x[i]; + }" > sigQd <- signature(n="integer", x="numeric") > codeQd <- " + squarefn(n, x); + squarefn(n, x); + " > > fns <- cfunction( list(squarefn=sigSq, quadfn=sigQd), + list(codeSq, codeQd), + convention=".C") > > squarefn <- fns[["squarefn"]] > quadfn <- fns[["quadfn"]] > > squarefn(n, x)$x [1] 1 4 9 16 25 36 49 64 81 100 > quadfn(n, x)$x [1] 1 16 81 256 625 1296 2401 4096 6561 10000 > > ## Alternative declaration using 'setCMethod' > setCMethod(c("squarefn", "quadfn"), list(sigSq, sigQd), + list(codeSq, codeQd), convention=".C") > > squarefn(n, x)$x [1] 1 4 9 16 25 36 49 64 81 100 > quadfn(n, x)$x [1] 1 16 81 256 625 1296 2401 4096 6561 10000 > > ## Use of .Call convention with C code > ## Multyplying each image in a stack with a 2D Gaussian at a given position > code <- " + SEXP res; + int nprotect = 0, nx, ny, nz, x, y; + PROTECT(res = Rf_duplicate(a)); nprotect++; + nx = INTEGER(GET_DIM(a))[0]; + ny = INTEGER(GET_DIM(a))[1]; + nz = INTEGER(GET_DIM(a))[2]; + double sigma2 = REAL(s)[0] * REAL(s)[0], d2 ; + double cx = REAL(centre)[0], cy = REAL(centre)[1], *data, *rdata; + for (int im = 0; im < nz; im++) { + data = &(REAL(a)[im*nx*ny]); rdata = &(REAL(res)[im*nx*ny]); + for (x = 0; x < nx; x++) + for (y = 0; y < ny; y++) { + d2 = (x-cx)*(x-cx) + (y-cy)*(y-cy); + rdata[x + y*nx] = data[x + y*nx] * exp(-d2/sigma2); + } + } + UNPROTECT(nprotect); + return res; + " > funx <- cfunction(signature(a="array", s="numeric", centre="numeric"), code) ERROR(s) during compilation: source code errors or compiler configuration errors! make cmd is make -f '/home/hornik/tmp/R.check/r-release-gcc/Work/build/etc/Makeconf' -f '/home/hornik/tmp/R.check/r-release-gcc/Work/build/share/make/shlib.mk' -f '/home/hornik/.R/Makevars-gcc' SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB='file378a1364b8cbce.so' CXX_DEFS=-DR_NO_REMAP OBJECTS='file378a1364b8cbce.o' make would use make[1]: Entering directory '/home/hornik/tmp/scratch/RtmpUVTB3D' g++-14 -std=gnu++17 -I"/home/hornik/tmp/R.check/r-release-gcc/Work/build/include" -DNDEBUG -I/usr/local/include -D_FORTIFY_SOURCE=3 -fpic -g -O2 -Wall -pedantic -mtune=native -DR_NO_REMAP -c file378a1364b8cbce.cpp -o file378a1364b8cbce.o if test "zfile378a1364b8cbce.o" != "z"; then \ echo g++-14 -std=gnu++17 -shared -L"/home/hornik/tmp/R.check/r-release-gcc/Work/build/lib" -Wl,-O1 -o file378a1364b8cbce.so file378a1364b8cbce.o -L"/home/hornik/tmp/R.check/r-release-gcc/Work/build/lib" -lR; \ g++-14 -std=gnu++17 -shared -L"/home/hornik/tmp/R.check/r-release-gcc/Work/build/lib" -Wl,-O1 -o file378a1364b8cbce.so file378a1364b8cbce.o -L"/home/hornik/tmp/R.check/r-release-gcc/Work/build/lib" -lR; \ fi make[1]: Leaving directory '/home/hornik/tmp/scratch/RtmpUVTB3D' Program source: 1: #include <R.h> 2: #include <Rdefines.h> 3: #include <R_ext/Error.h> 4: 5: 6: extern "C" { 7: SEXP file378a1364b8cbce ( SEXP a, SEXP s, SEXP centre ); 8: } 9: 10: SEXP file378a1364b8cbce ( SEXP a, SEXP s, SEXP centre ) { 11: 12: SEXP res; 13: int nprotect = 0, nx, ny, nz, x, y; 14: PROTECT(res = Rf_duplicate(a)); nprotect++; 15: nx = INTEGER(GET_DIM(a))[0]; 16: ny = INTEGER(GET_DIM(a))[1]; 17: nz = INTEGER(GET_DIM(a))[2]; 18: double sigma2 = REAL(s)[0] * REAL(s)[0], d2 ; 19: double cx = REAL(centre)[0], cy = REAL(centre)[1], *data, *rdata; 20: for (int im = 0; im < nz; im++) { 21: data = &(REAL(a)[im*nx*ny]); rdata = &(REAL(res)[im*nx*ny]); 22: for (x = 0; x < nx; x++) 23: for (y = 0; y < ny; y++) { 24: d2 = (x-cx)*(x-cx) + (y-cy)*(y-cy); 25: rdata[x + y*nx] = data[x + y*nx] * exp(-d2/sigma2); 26: } 27: } 28: UNPROTECT(nprotect); 29: return res; 30: 31: warning("your C program does not return anything!"); 32: return R_NilValue; 33: } Compilation ERROR, function(s)/method(s) not created! Error in compileCode(f, code, language, verbose) : using C++ compiler: ‘g++-14 (Debian 14.2.0-8) 14.2.0’ file378a1364b8cbce.cpp: In function ‘SEXPREC* file378a1364b8cbce(SEXP, SEXP, SEXP)’: file378a1364b8cbce.cpp:31:3: error: ‘warning’ was not declared in this scope; did you mean ‘Rf_warning’? 31 | warning("your C program does not return anything!"); | ^~~~~~~ | Rf_warning make[1]: *** [/home/hornik/tmp/R.check/r-release-gcc/Work/build/etc/Makeconf:202: file378a1364b8cbce.o] Error 1 Calls: cfunction -> compileCode Execution halted Flavor: r-release-linux-x86_64