r-lib / fastmap

Fast map implementation for R
https://r-lib.github.io/fastmap/
Other
133 stars 7 forks source link

Cannot install on R3.5 #34

Closed ms609 closed 6 months ago

ms609 commented 1 year ago

I'm trying to debug one of my packages on a clean install of R3.5.3 but cannot install "fastmap", a dependency of "devtools". (It also fails on R3.5.0 and 3.5.2.) I see:

> install.packages("fastmap")
Installing package into ‘C:/Users/pjjg18/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---

  There is a binary version available but the source version is later:
        binary source needs_compilation
fastmap  1.0.1  1.1.1              TRUE

installing the source package ‘fastmap’

trying URL 'https://cloud.r-project.org/src/contrib/fastmap_1.1.1.tar.gz'
Content type 'application/x-gzip' length 46412 bytes (45 KB)
downloaded 45 KB

* installing *source* package 'fastmap' ...
** package 'fastmap' successfully unpacked and MD5 sums checked
** libs
c:/Rtools/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-35~1.3/include" -DNDEBUG -Ilib/      -DR_NO_REMAP   -O2 -Wall  -mtune=generic -c fastmap.cpp -o fastmap.o
fastmap.cpp: In function 'SEXPREC* C_map_has(SEXP, SEXP)':
fastmap.cpp:115:23: error: 'si_map' has no member named 'contains'
     bool found = map->contains(key);
                       ^
make: *** [C:/PROGRA~1/R/R-35~1.3/etc/x64/Makeconf:215: fastmap.o] Error 1
ERROR: compilation failed for package 'fastmap'
* removing 'C:/Users/pjjg18/Documents/R/win-library/3.5/fastmap'
* restoring previous 'C:/Users/pjjg18/Documents/R/win-library/3.5/fastmap'
In R CMD INSTALL

The downloaded source packages are in
        ‘C:\Users\pjjg18\AppData\Local\Temp\RtmpQLSLIb\downloaded_packages’
Warning message:
In install.packages("fastmap") :
  installation of package ‘fastmap’ had non-zero exit status

sessionInfo() reports:

R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

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

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

Is "fastmap" supported on R3.5?

terriableCoder commented 1 year ago

Have you solved this problem yet? I have the same problem o(╥﹏╥)o

wch commented 1 year ago

You might need to use a newer version of R. Because of changes in R 4.3, packages are no longer allowed to specify SystemRequirements: C++11, which is necessary for this package to compile on R 3.5 and below. In other words, the R/CRAN maintainers required us to make a change which causes this package to not build on 3.5 and below.

See this for more information: https://www.tidyverse.org/blog/2023/03/cran-checks-compiled-code/ Notably:

After making these changes, the package should install without trouble on R 3.6 and above. It may not build on R <= 3.5 on systems with very old compilers, though it is likely that the vast majority of users will have a newer version of R and/or have recent enough compilers.