Why is building my package taking so long in RStudio?

Building my package takes an age in RStudio. If I use R from the terminal and build with devtools, or by running the command R CMD INSTALL --no-multiarch --with-keep.source blma, the build runs much more quickly, so I think this is an RStudio issue.

I think the fault is at least partially mine, because I'm using RcppEigen and was using a lot of templates in my code. With the current version of Eigen, this produces a slew of warnings, most of which are spurious. I'm trying to build https://github.com/certifiedwaif/blma. It's my first package, so comments on how I could do things better are also very welcome!


Hmm, I bet this will help me see what's going on!

That more or less fixes the problem. To be specific, once you add

CPPFLAGS= -Wno-ignored-attributes

to your ~/.R/Makevars, the thousands of lines of spurious errors go away, and builds in RStudio become reasonably fast again. But this does raise the question of why RStudio deals so poorly with moderate amounts of output like this?


You might want to move this into the RStudio IDE category, if you feel you've isolated the problem to the IDE (which it sounds like you do). Also, when you say "moderate amounts of output" do you mean for warnings in general, or something of a specific type?

Thanks, I've now done this. And yes, I mean specifically for the compiler warnings that come from the C++ compiler. But RStudio doesn't seem to deal well with large amounts of text in the terminal/console/build window. The thousands of lines of errors from the C++ compiler were just one concrete example. I was wondering if that might be worth looking into?


Can you please file this as a bug report at https://github.com/rstudio/rstudio/issues? We've known about this issue for quite a while but unfortunately haven't yet made the investment to properly handle this.

The primary issue here is that output in the build pane is not appropriately virtualized, so package compiles which emit a lot of text cause the IDE to hang while attempting to process all of that text. (I thought we might already have an issue logged for this, but can't find one!)

Sure, I'd be only too happy to do that.