RcppCore / Rcpp

Seamless R and C++ Integration
https://www.rcpp.org
GNU General Public License v2.0
735 stars 211 forks source link

Rcpp compication fails. #1051

Closed rafaleo closed 4 years ago

rafaleo commented 4 years ago

sessionInfo()


R version 3.3.3 (2017-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale: [1] LC_COLLATE=Polish_Poland.1250 LC_CTYPE=Polish_Poland.1250 LC_MONETARY=Polish_Poland.1250 [4] LC_NUMERIC=C LC_TIME=Polish_Poland.1250

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

other attached packages: [1] pdftools_1.6

loaded via a namespace (and not attached): [1] tools_3.3.3 yaml_2.1.14 Rcpp_0.12.16

The compiler:
(base) C:\>R CMD config CC
c:/Rtools/mingw_64/bin/gcc

I call: `install.packages("Rcpp")`. And get an error (trying to compile, the normal version is installing correctly, but it's so old and I do need above 1.0.1+ or so.)

There is a binary version available but the source version is later: binary source needs_compilation Rcpp 0.12.16 1.0.4 TRUE

Do you want to install from sources the package which needs compilation? y/n: y installing the source package ‘Rcpp’

trying URL 'https://cran.rstudio.com/src/contrib/Rcpp_1.0.4.tar.gz' Content type 'application/x-gzip' length 2750216 bytes (2.6 MB) downloaded 2.6 MB

arch - i386 C:/Rtools/mingw_32/bin/g++ -I"C:/PROGRA~1/R/R-33~1.X/include" -DNDEBUG -I../inst/include/ -I"d:/Compiler/gcc-4.9.3/local330/include" -O2 -Wall -mtune=core2 -c api.cpp -o api.o In file included from ../inst/include/RcppCommon.h:135:0, from ../inst/include/Rcpp.h:27, from api.cpp:24: ../inst/include/Rcpp/lang.h: In function 'SEXPREC Rcpp::Rcpp_list7(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP)': ../inst/include/Rcpp/lang.h:45:55: error: 'Rf_list6' was not declared in this scope x0 = Rf_cons(x0, Rcpp_list6(x1, x2, x3, x4, x5, x6)); ^ ../inst/include/Rcpp/lang.h: In function 'SEXPREC Rcpp::Rcpp_lang7(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP)': ../inst/include/Rcpp/lang.h:53:56: error: 'Rf_list6' was not declared in this scope x0 = Rf_lcons(x0, Rcpp_list6(x1, x2, x3, x4, x5, x6)); ^ make: [C:/PROGRA~1/R/R-33~1.X/etc/i386/Makeconf:188: api.o] Error 1 Ostrzeżenie: uruchomione polecenie 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-33~1.X/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-33~1.X/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="Rcpp.dll" OBJECTS="api.o attributes.o barrier.o date.o module.o rcpp_init.o"' otrzymało status 2 ERROR: compilation failed for package 'Rcpp'

The downloaded source packages are in ‘C:\Users\cp\AppData\Local\Temp\RtmpaylezZ\downloaded_packages’


What may be wrong?
eddelbuettel commented 4 years ago

See #1048 and use Rcpp 1.0.4.2 from the Rcpp drat.

eddelbuettel commented 4 years ago

Otherwise, I can also recommend the R release from the 3.4. series in 2017, the 3.5. series in 2018, or the current 3.6.* series from 2019 which is about to be replaced come late April by R 4.0.0.

rafaleo commented 4 years ago

Thank you for very quick response. Does it mean I can try with R 3.5 and? I see. Thanks for suggestion.

eddelbuettel commented 4 years ago

Everything more recent that 3.3.* will work with Rcpp 1.0.4.

But it was noticed that R 3.3.* was not providing one function we needed; that was added in 1.0.4.2. So if you want to stick with your R version, that is the one you need. If you can (and want to) upgrade R (generally a good idea!) then the release also works.

Just the intersection of R 3.3. and Rcpp 1.0.4 bites -- our bad. But there is only a finite number of combinations we can check, which is why we do it with current* releases which are generally the way to go.