0
votes

I'm trying to install r package "sparsesvd" using install.packages(), but got error during compilation. Any help is highly appreciated!

"unknown type name ‘R_CallMethodDef’"

I also tried conda install -c r r-sparsesvd; but got error.

Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  • r-sparsesvd

Current channels:

I tried

conda skeleton cran --recursive r-sparsesvd conda build r-sparsesvd.

While the 1st step was successful, the build failed.

Execution halted Tests failed for r-sparsesvd-0.1_4-r341h96ca727_0.tar.bz2

Here is the sessionInfo. Due to project reason, I have to use R3.3

R version 3.3.2 (2016-10-31) Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C
LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats graphics grDevices utils
datasets methods base

loaded via a namespace (and not attached): [1] tools_3.3.2

1
Thanks for the comment! But how would the archived one be different from the one chosen automatically by install.packages()?blueskyddd
There is another post related to the error unknown type name ‘R_CallMethodDef But the author did not give details on how to solve the problem. Could anyone help, please?blueskyddd

1 Answers

0
votes

This (once again) is not a problem with R, CRAN or its packages ...but apparently with Conda. On my system there is strictly no problem with this small package with very few dependencies:

R> install.packages("sparsesvd")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/sparsesvd_0.1-4.tar.gz'
Content type 'application/x-gzip' length 29729 bytes (29 KB)
==================================================
downloaded 29 KB

* installing *source* package ‘sparsesvd’ ...
** package ‘sparsesvd’ successfully unpacked and MD5 sums checked
** libs
gcc -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -march=native -c las2.c -o las2.o
gcc -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -march=native -c main.c -o main.o
gcc -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -march=native -c svdlib.c -o svdlib.o
gcc -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O3 -Wall -pipe   -std=gnu99 -march=native -c svdutil.c -o svdutil.o
svdutil.c: In function ‘svd_readBinFloat’:
svdutil.c:265:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     y = *((float *) &x);
     ^
svdutil.c: In function ‘svd_writeBinFloat’:
svdutil.c:290:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   int y = htonl(*((int *) &r));
   ^~~
gcc -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o sparsesvd.so las2.o main.o svdlib.o svdutil.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/sparsesvd/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (sparsesvd)

The downloaded source packages are in
    ‘/tmp/RtmpI3TPWj/downloaded_packages’
R>