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

Unable to install httpuv - R 3.5.3 #360

Open
ms609 opened this issue Apr 27, 2023 · 2 comments
Open

Unable to install httpuv - R 3.5.3 #360

ms609 opened this issue Apr 27, 2023 · 2 comments

Comments

@ms609
Copy link

ms609 commented Apr 27, 2023

A different underlying issue, I think, to #353
Occurs also under R3.5.0 (which is where I'd really like to install).

> install.packages("httpuv")
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 ---
Warning: unable to access index for repository https://cloud.r-project.org/bin/windows/contrib/3.5:
  cannot open URL 'https://cloud.r-project.org/bin/windows/contrib/3.5/PACKAGES'
Package which is only available in source form, and may need
  compilation of C/C++/Fortran: 'httpuv'
Do you want to attempt to install these from sources? (Yes/no/cancel) yes
installing the source package 'httpuv'

trying URL 'https://cloud.r-project.org/src/contrib/httpuv_1.6.9.tar.gz'
Content type 'application/x-gzip' length 1875081 bytes (1.8 MB)
downloaded 1.8 MB

In R CMD INSTALL
* installing *source* package 'httpuv' ...
** package 'httpuv' successfully unpacked and MD5 sums checked
** libs
c:/Rtools/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-35~1.3/include" -DNDEBUG -Ilibuv/include -D_WIN32_WINNT=0x0600 -DSTRICT_R_HEADERS -I"C:/Users/pjjg18/Documents/R/win-library/3.5/Rcpp/include" -I"C:/Users/pjjg18/Documents/R/win-library/3.5/later/include"      -DSTRICT_R_HEADERS   -O2 -Wall  -mtune=generic -c RcppExports-legacy.cpp -o RcppExports-legacy.o
c:/Rtools/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-35~1.3/include" -DNDEBUG -Ilibuv/include -D_WIN32_WINNT=0x0600 -DSTRICT_R_HEADERS -I"C:/Users/pjjg18/Documents/R/win-library/3.5/Rcpp/include" -I"C:/Users/pjjg18/Documents/R/win-library/3.5/later/include"      -DSTRICT_R_HEADERS   -O2 -Wall  -mtune=generic -c RcppExports.cpp -o RcppExports.o
c:/Rtools/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-35~1.3/include" -DNDEBUG -Ilibuv/include -D_WIN32_WINNT=0x0600 -DSTRICT_R_HEADERS -I"C:/Users/pjjg18/Documents/R/win-library/3.5/Rcpp/include" -I"C:/Users/pjjg18/Documents/R/win-library/3.5/later/include"      -DSTRICT_R_HEADERS   -O2 -Wall  -mtune=generic -c callback.cpp -o callback.o
In file included from callback.cpp:1:0:
callback.h:21:8: error: 'function' in namespace 'std' does not name a template type
   std::function<void (void)> fun;
        ^
callback.h:24:36: error: expected ')' before '<' token
   StdFunctionCallback(std::function<void (void)> fun)
                                    ^
callback.h: In member function 'virtual void StdFunctionCallback::operator()()':
callback.h:29:9: error: 'fun' was not declared in this scope
     fun();
         ^
callback.h: At global scope:
callback.h:34:24: error: variable or field 'invoke_later' declared void
 void invoke_later(std::function<void(void)> f, double secs = 0);
                        ^
callback.h:34:19: error: 'function' is not a member of 'std'
 void invoke_later(std::function<void(void)> f, double secs = 0);
                   ^
callback.h:34:33: error: expected primary-expression before 'void'
 void invoke_later(std::function<void(void)> f, double secs = 0);
                                 ^
callback.h:34:48: error: expected primary-expression before 'double'
 void invoke_later(std::function<void(void)> f, double secs = 0);
                                                ^
callback.cpp:12:24: error: variable or field 'invoke_later' declared void
 void invoke_later(std::function<void(void)> f, double secs) {
                        ^
callback.cpp:12:19: error: 'function' is not a member of 'std'
 void invoke_later(std::function<void(void)> f, double secs) {
                   ^
callback.cpp:12:33: error: expected primary-expression before 'void'
 void invoke_later(std::function<void(void)> f, double secs) {
                                 ^
callback.cpp:12:48: error: expected primary-expression before 'double'
 void invoke_later(std::function<void(void)> f, double secs) {
                                                ^
make: *** [C:/PROGRA~1/R/R-35~1.3/etc/x64/Makeconf:215: callback.o] Error 1
ERROR: compilation failed for package 'httpuv'
* removing 'C:/Users/pjjg18/Documents/R/win-library/3.5/httpuv'

The downloaded source packages are in
        'C:\Users\pjjg18\AppData\Local\Temp\RtmpWu6ibu\downloaded_packages'
Warning message:
In install.packages("httpuv") :
  installation of package 'httpuv' had non-zero exit status
> sessionInfo()
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
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] 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
@gadenbuie
Copy link
Member

Hi @ms609, I think you're running into an issue caused by changes in CRAN policy around packages that contain C++ code. If you're interested in the backstory, there's an article on the tidyverse blog that explains the change.

The fix as described there is that for R <= 3.5, you may need to make a small change in your ~/.R/Makevars file to add the following line:

CXX_STD=CXX11

Please try this and let us know how it goes.

@ms609
Copy link
Author

ms609 commented May 4, 2023

Thanks for the suggestion; this sounds like a likely explanation. As I have multiple versions of R installed, I'll have to have a proper stab at setting up the Makevars for 3.5, which I've not got round to yet – but I'll let you know how I get on.

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

2 participants