zpneal / backbone

R backbone package - Extract the backbone from weighted and unweighted networks
https://www.rbackbone.net
40 stars 8 forks source link

Installation / compilation error on Windows #41

Closed privefl closed 1 year ago

privefl commented 1 year ago
> install.packages("backbone", type = "source")

Installing package into ‘C:/Users/au639593/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/backbone_2.1.1.tar.gz'
Content type 'application/x-gzip' length 1390314 bytes (1.3 MB)
downloaded 1.3 MB

* installing *source* package 'backbone' ...
** package 'backbone' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
C:/Rtools/mingw_32/bin/g++  -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG  -I"C:/Users/au639593/Documents/R/win-library/3.6/Rcpp/include"        -O2 -Wall  -mtune=generic -c RcppExports.cpp -o RcppExports.o
C:/Rtools/mingw_32/bin/g++  -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG  -I"C:/Users/au639593/Documents/R/win-library/3.6/Rcpp/include"        -O2 -Wall  -mtune=generic -c fastball.cpp -o fastball.o
fastball.cpp: In function 'Rcpp::List fastball_cpp(Rcpp::List, int)':
fastball.cpp:12:30: error: '>>' should be '> >' within a nested template argument list
   std::vector<std::vector<int>> oneLocs (numRows);
                              ^
make: *** [C:/PROGRA~1/R/R-36~1.1/etc/i386/Makeconf:215: fastball.o] Error 1
ERROR: compilation failed for package 'backbone'
* removing 'C:/Users/au639593/Documents/R/win-library/3.6/backbone'
* restoring previous 'C:/Users/au639593/Documents/R/win-library/3.6/backbone'
Warning in install.packages :
  installation of package ‘backbone’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\au639593\AppData\Local\Temp\Rtmpy2zXHX\downloaded_packages’
zpneal commented 1 year ago

Thanks for this! I can see the issue in the C++ code, but before applying the fix you supplied (thanks for that too!), I'm trying to figure out exactly how widespread it is. The package recently passed the CRAN checks on r-oldrel-windows, so I'm thinking it may be fairly limited.

privefl commented 1 year ago

Happened to me with R 3.6.1, but does not seem to be a problem with R 4.2.2 for some reason..

zpneal commented 1 year ago

It looks like this compilation error occurs in earlier versions of R that use C++, not C++11. I made the change in the /devel branch (and closed the pull request to the /release branch). If you have a minute, can you try installing from source using the /devel branch. It should work on R 3.6.1 now.

privefl commented 1 year ago

Yes, the change I made worked just fine.