Closed DanOvando closed 4 years ago
This seems to have gotten onto the mailing list but not here (where it is probably more useful
I would rewrite this as follows (or something like this) [untested!]
sf <- function(x,package="TMB",cond=TRUE) {
sprintf('-I"%s"',system.file(x,package=package)[cond])
}
ppflags <- paste(sf("include"),
sf("include",package="RcppEigen",cond=useRcppEigen),
sf("include/contrib",cond=useContrib),
"-DTMB_SAFEBOUNDS"[safebounds],
paste0("-DLIB_UNLOAD=R_unload_",libname)[safeunload],
"-DWITH_LIBTMB"[libtmb],
paste0("-DTMB_LIB_INIT=R_init_",libname)[libinit],
"-DCPPAD_FORWARD0SWEEP_TRACE"[tracesweep]
)
@DanOvando
Does this solve it?:
devtools::install_github("kaskr/adcomp/TMB", ref="quote_path")
And does it work on Windows? (shortPathName mixed with quotes...)
Edit: My first try had issues with precompile. Second try added to same branch.
That does it, thanks! I can confirm that TMB::runExample
now works on both my mac and windows builds when renv is activated.
Merged
Description:
compilation of TMB models fails when run inside of an
renv
environmentReproducible Steps:
I'm migrating my projects to be build around
renv
for dependency management. This however is creating some problems for TMB.To reproduce
Works just fine.
install
renv
run
renv::init()
run
renv::install("TMB")
run
and I get the following error
I submitted an issue first over at
renv
, and they suggested the following"Based on this output, the issue here is that the path to the TMP include directory is not being quoted.
I'd recommend filing a bug for the package author, indicating that the paths created here:
https://github.com/kaskr/adcomp/blob/ea5238611af919a67e60ba129a83a7abf1768d58/TMB/R/TMB.R#L1083-L1091
need to be quoted, to ensure spaces (and other special characters) are properly handled."
I'd try and mess with it myself but will admit that in this context I'm not entirely clear what "needs to be quoted" means
TMB Version:
1.7.18
R Version:
4.0.2
Operating System:
macOS 10.15.6