markvanderloo/stringdist

Error installing the package on R v4.3.0.

Closed this issue · 2 comments

I get an Error while installing the package on R v4.3.0.

Installing stringdist [0.9.6.3] ...
	FAILED
Error installing package 'stringdist':
======================================

* installing to library ‘/home/user/renv/staging/1’
* installing *source* package ‘stringdist’ ...
** package ‘stringdist’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0’
gcc -I"/usr/local/lib/R/include" -DNDEBUG -I../inst/include  -I/usr/local/include   -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c R_register_native.c -o R_register_native.o
gcc -I"/usr/local/lib/R/include" -DNDEBUG -I../inst/include  -I/usr/local/include   -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c Rstringdist.c -o Rstringdist.o
Rstringdist.c: In function ‘R_afind’:
Rstringdist.c:356:26: error: lvalue required as left operand of assignment
  356 |   VECTOR_ELT(out_list,0) = out_loc;
      |                          ^
Rstringdist.c:362:26: error: lvalue required as left operand of assignment
  362 |   VECTOR_ELT(out_list,1) = out_dist;
      |                          ^
make: *** [/usr/local/lib/R/etc/Makeconf:191: Rstringdist.o] Error 1
ERROR: compilation failed for package ‘stringdist’
* removing ‘/home/user/renv/staging/1/stringdist’
Error: install of package 'stringdist' failed [error code 1]

My session info:

> sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               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    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

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

other attached packages:
[1] shinythemes_1.2.0 shiny_1.6.0      

loaded via a namespace (and not attached):
 [1] knitr_1.42        xfun_0.38         rlang_0.4.10      DBI_1.1.3         renv_0.13.1       promises_1.2.0.1 
 [7] xtable_1.8-4      bit_4.0.5         htmltools_0.5.1.1 httpuv_1.5.5      rmarkdown_2.21    grid_4.3.0       
[13] evaluate_0.20     ellipsis_0.3.1    fastmap_1.1.0     yaml_2.3.7        lifecycle_1.0.0   compiler_4.3.0   
[19] Rcpp_1.0.6        later_1.1.0.1     digest_0.6.27     R6_2.5.0          magrittr_2.0.1    tools_4.3.0      
[25] withr_2.4.1       bit64_4.0.5       mime_0.10         cachem_1.0.4  

Hi there, both install.packages("stringdist") and the github version (make test) in the master branch build fine for me on R 4.3.0. It seems you are trying to install an older version as the current version is 0.9.10 and you are installing 0.9.6.3.

Thank you, that solved the problem for me!

I found out that in my renv.lock file there was a repository linked that obviously didn't have the 0.9.10 version. Updating the repository solved the problem.