Closed ecmerkle closed 1 year ago
pkgload::load_all()
creates a debug build by default, as it is for package development. Set the PKG_BUILD_EXTRA_FLAGS=false
env var if you want a release build, see the README.
Thank you, that solved it! In case it helps anyone, I added the following line to ~/.Renviron
PKG_BUILD_EXTRA_FLAGS="false"
This is probably not optimal if you want to switch back and forth between debug build and release build, but it is what I was searching for.
Just stumbled on this thread from elsewhere, the default of a debug build caused me lots of headaches previously, was not aware it could be changed so easily -- just a small vote for a different default from me.
pkgload::load_all()
is primarily for development, hence the default.
If you want to use a package, the best is to install it, instead of using load_all()
.
maybe it is an rstudio issue, but I've had cases where this debug build is triggered by a request to document the package -- the build is not able to complete, and it breaks the existing installation.
That's possible, dependending on your project options. You can set "Always use --preclean when installing package" to make sure that a clean build is installed instead of a debug build.
the problem with preclean is that it will always recompile the software, which is unnecessary :/
Well, it is necessary, if previously it was compiled as a debug build.
pkgbuild/pkgload could store the debug build in a different directory I guess.
Yes but it has never compiled successfully as a debug build, the comment is unrelated to that. with preclean on, unnecessary compilations happen, with preclean off, debug builds are attempted which fail and break the installation, necessitating a new (non debug) build.
Right, then you need to set that env var, and debug builds are never produced.
And in general, I think
load_all()
.
Hello, I have an R package (blavaan) that compiles an rstan model during installation. When I am developing the package, I typically load new changes via
After upgrading from Ubuntu 20.04 (focal) to Ubuntu 22.04 (jammy), I noticed that the compilation time is much longer using the above command, and the subsequent Stan model runs an order of magnitude slower than it previously did. But if I build the same package via
R CMD build
and then install it viainstall.packages()
, the compilation proceeds as normal and the Stan model is fast again.I am guessing that my system is the problem but also wondered whether you've heard of anything like this before. In case it helps, my R package is on github here. Thanks!