Open sambrilleman opened 2 years ago
I think the error comes from these lines in the cleanup.win
script:
https://github.com/stan-dev/rstanarm/blob/43b0796a2259165458dd9f5e0cbaf35853f7c3fd/cleanup.win#L5-L6
It tries to copy two folders to the testthat directory, but there are existing symlinks in those locations.
Probably, these two lines should be removed from cleanup.win
. Alternatively, you could try deleting the symlinks at tests/testthat/stan_files
and tests/testthat/stan_files
before building.
Actually, when I try installing on Windows 11 (having freshly installed RStudio, R, and Rtools42), it is able to build rstanarm, despite warnings about the copy commands failing. (Note: I did have to modify src/Makevars.win
by removing -flto=jobserver
and adding -Wa,-mbig-obj
to the PKG_CXXFLAGS
line, to avoid errors later in compilation).
https://stackoverflow.com/questions/31890021/mingw-too-many-sections-bug-while-compiling-huge-header-file-in-qt
https://digitalkarabela.com/mingw-w64-how-to-fix-file-too-big-too-many-sections/
In your case, it seems like it's not finding the RcppParallel
package because it is not parsing the -I'C:/Program Files/R/R-4.2.1/library/RcppParallel/include'
flag correctly. In my case, RcppParallel
is installed under my user library, which doesn't have any spaces in the path.
The RcppParallel::LdFlags()
function uses the utility function RcppParallel:::asBuildPath()
to convert the paths to an abbreviated form without spaces on Windows. Maybe StanHeaders:::CxxFlags()
and StanHeaders:::LdFlags()
should do something similar to avoid issues.
https://rdrr.io/cran/RcppParallel/src/R/utils.R
https://github.com/stan-dev/rstan/issues/873
I believe the RcppParallel path issue is fixed under the 2.26 preview of StanHeaders
as well
Summary:
Struggling to build rstanarm from source. I'm trying to bring the latest changes from
master
into thefeature/survival
branch and then build the package on Windows using R 4.2.1 and Rtools42. See the bottom of this post for my full traceback. Error feels familiar, but then again... 🤔I want to get this build working with R 4.2 to try and start unblocking all the issues people are describing in #500.
Reproducible Steps:
survival_2_21_3
branch: https://github.com/stan-dev/rstanarm/tree/survival_2_21_3roxygen2::roxygenize()
on R 4.2.1 with Rtools42RStanARM Version:
survival_2_21_3
branchR Version:
4.2.1
Operating System:
Windows 11