Closed brookslogan closed 4 months ago
Before building, have you tried removing all src/*.o
and src/*.so
files?
I didn't have a src/
directory (within my working directory at least), as I was attempting to install from CRAN or RSPM. Here's some testing of devtools-based installation:
devtools::install('~/<path>/mice', quick = TRUE, build = FALSE, upgrade = FALSE, keep_source = TRUE)
(from ESS) works even with a problematic home Rprofile. Existing src/*.o
files don't seem to interfere with re-installation, and devtools::clean_dll()
ing also doesn't introduce problems. devtools::install_github("amices/mice")
has the same error as install.packages()
though.pak::pkg_install("mice")
appears to succeed in building and installing directly from CRAN/RSPM from source, even after clearing its cache.)I should note that I am on Fedora, R version 4.1.3 (2022-03-10), devtools_2.4.5, Rcpp_1.0.12.
Thanks for trying.
I am not on Fedora and cannot reproduce. I fear I won't be able to help.
Thanks for checking on this. The fix for me was as simple as #647, though I haven't done extensive testing. Thought I'd at least throw it in a PR as an option.
Before submitting the issue
mice
package, see Discussions. For theoretical background about themice
methods, see Flexible Imputation of Missing Data.mice
(e.g. with thepackageVersion()
orsessionInfo()
function).Describe the bug A clear and concise description of what the bug is.
When a home Rprofile exists, and that .Rprofile produces output to stdout, installation of mice fails. (Likely the same for site Rprofiles without home Rprofiles.)
To Reproduce Create a reproducible example, see e.g. the
reprex
package. A good reprex uses simulated or public data to showcase the bug. We recommend using one of the incomplete datasets included in themice
package (e.g.mice::boys
) and thereprex()
function from thereprex
package.Paste the code and output of your reprex here.
Created on 2024-06-10 with reprex v2.0.2
Running within
reprex
appears to reproduce the problem but not the error message to the console; this is the relevant part from running outside reprex:Expected behavior A clear and concise description of what you expect to happen without the bug.
Installation succeeds.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
This appears to occur due to this line (or this Windows equivalent). Note that
Rcpp:::LdFlags()
is deprecated and produces an empty string, and hasn't been needed for long enough that it likely could be dropped now.User workarounds include temporarily renaming the problematic Rprofile, or producing output to stderr (e.g., with
message()
) instead of stdout in the Rprofile.