Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble loading Rcpp into R 4.0 #1100

Closed
mes86 opened this issue Jul 1, 2020 · 13 comments
Closed

Trouble loading Rcpp into R 4.0 #1100

mes86 opened this issue Jul 1, 2020 · 13 comments

Comments

@mes86
Copy link

mes86 commented Jul 1, 2020

I am having trouble getting Rcpp to load in R 4.0--the latest version of Rcpp was released before R 4.0 was released and so I am wondering whether I just need to wait for an update. Any thoughts would be appreciated!

I am able to install it:
install.packages("Rcpp", repo="http://archive.linux.duke.edu/cran/")

Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/src/contrib:
cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/mes86/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'http://archive.linux.duke.edu/cran/bin/windows/contrib/4.0/Rcpp_1.0.4.6.zip'
Content type 'application/zip' length 3167934 bytes (3.0 MB)
downloaded 3.0 MB

package ‘Rcpp’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\mes86\AppData\Local\Temp\1\Rtmp8a85Fi\downloaded_packages

##but am unable to load it into my library
library(Rcpp)
Error: package or namespace load failed for ‘Rcpp’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Users/mes86/Documents/R/win-library/4.0/Rcpp/libs/x64/Rcpp.dll':
LoadLibrary failure: The specified procedure could not be found.
In addition: Warning message:
package ‘Rcpp’ was built under R version 4.0.2

@eddelbuettel
Copy link
Member

WARNING: Rtools is required to build R packages but is not currently installed.

What part of "you don't have the tools to build from source, yet you asked for source" what not clear enough? Your R setup is incomplete for what you are trying to do.

@eddelbuettel
Copy link
Member

Actually we learned about

##but am unable to load it into my library
library(Rcpp)
Error: package or namespace load failed for ‘Rcpp’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Users/mes86/Documents/R/win-library/4.0/Rcpp/libs/x64/Rcpp.dll':
LoadLibrary failure: The specified procedure could not be found.
In addition: Warning message:
package ‘Rcpp’ was built under R version 4.0.2

the other day. Apparently an inadvertent change within R. It blocks Rcpp in R 4.0.0 on Windows, we were told it works with R 4.0.2 (and, if I recall correctly, 4.0.1). Please upgrade to R 4.0.2 and the pre-made R should work again for you.

@eddelbuettel
Copy link
Member

Closing as there was i) no follow-up and ii) never an Rcpp issue.

@maximylius
Copy link

Actually we learned about

##but am unable to load it into my library
library(Rcpp)
Error: package or namespace load failed for ‘Rcpp’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Users/mes86/Documents/R/win-library/4.0/Rcpp/libs/x64/Rcpp.dll':
LoadLibrary failure: The specified procedure could not be found.
In addition: Warning message:
package ‘Rcpp’ was built under R version 4.0.2

the other day. Apparently an inadvertent change within R. It blocks Rcpp in R 4.0.0 on Windows, we were told it works with R 4.0.2 (and, if I recall correctly, 4.0.1). Please upgrade to R 4.0.2 and the pre-made R should work again for you.

Hi there,
I am expieriencing the exact same issue you've quoted. I am also using R 4.0.0 on Windows but unfortunately there is no possibility for me to upgrade to R 4.0.2 (or later) due to institutional IT restrictions.

Do you see any other possibility of solving this issue? Maybe by using an older version of Rcpp or some other kind of fix?
Any help is very much appreciated.
Thanks and best regards

@eddelbuettel
Copy link
Member

No there isn't as it is triggered by a bug in R itself. Upgrade to R 4.0.3. If you can't then the issue is for once not "between keyboard and chair" but between your chair and your IT department. Truly sorry.

@maximylius
Copy link

Okay, that's unfortunate for me.
Thanks a lot for your quick reply though :)

@eddelbuettel
Copy link
Member

Pleasure, and sorry I have no better news. You should gently nudge your IT folks -- a release such as 4.0.3 (right now) is almost always preferable over a 4.0.0 just because some more things get shaken out. As for interim, maybe downgrade to 3.6.3 or use Docker or use an older Rcpp or ...

@kevinushey
Copy link
Contributor

The other option (if you can install Rtools yourself on your system) would be to install Rcpp from sources, rather than via the CRAN binaries.

You may also have luck if you use a MRAN checkpoint that provides a binary of Rcpp that was build using the same version of R as you have installed -- see https://cran.r-project.org/web/packages/checkpoint/index.html for more details.

@eddelbuettel
Copy link
Member

I could be wrong but I had been under the impression that one also wants an updated R version -- 4.0.2 or later -- to avoid this. I know we also made a change but was that enough to get things working under R 4.0.0 (and 4.0.1) on Windows?

@kevinushey
Copy link
Contributor

You might be right -- I can't recall the details exactly.

@maximylius
Copy link

Thanks a lot for your good hints. Finally, it looks like its working for me now: I had in fact access to Rtools and I was able to first install Rcpp 1.0.5 from source and then downgraded it (via devtools::install_version) to 1.03 - and luckily that made the problem disappear.
Surely not an elegant solution but one that worked for me and maybe others that have to work under such desperate conditions 😄

Thanks for mentioning MRAN checkpoint - I didn't try it out as I was already half way done with the other approach, but I'm sure it'll be useful to me in the future.

@eddelbuettel
Copy link
Member

You can try the current micro-release 1.0.5.4:

install.package("Rcpp", repos="https://rcppcore.github.io/drat", type="source")

If @kevinushey is correct and our change is sufficient it will work. If it also needs an R change you can still fall back to 1.0.3 (or maybe 1.0.4).

@maximylius
Copy link

Just tried out as suggested with the current micro release 1.0.5.4: and it indeed also works! Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants