Yo back up now and give a brother room // The fuse is lit and I'm about to go boom // Mercy mercy mercy me // My life is a cage but on stage I'm free
Okay, so for some reason I can't install Boom on one of our machines ("stat1002", which we'll call "A"). We have a nearly identical machine ("stat1003", which we'll call "B") that I CAN install it on. Other R packages with C++ install just fine -- e.g. Rcpp and dplyr. (Here's Boom's src/Makevars file, by the way.)
sessionInfo()
# R version 3.2.3 (2015-12-10)
# Platform: x86_64-pc-linux-gnu (64-bit)
# Running under: Ubuntu 14.04.4 LTS
g++ --version
# g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
make --version
# GNU Make 3.81
ar --version
# GNU ar (GNU Binutils for Ubuntu) 2.24
My coworker Erik noticed that there's a file (/usr/share/R/debian/r-cran.mk) that's in A's R installation that isn't in B's. Maybe that has something to do with it?
sessionInfo()
# R version 3.2.3 (2015-12-10)
# Platform: x86_64-pc-linux-gnu (64-bit)
# Running under: Ubuntu 14.04.4 LTS
g++ --version
# g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
make --version
# GNU Make 3.81
ar --version
# GNU ar (GNU Binutils for Ubuntu) 2.24
boom_install_b.log is the log of what happens when I (successfully) install Boom from CRAN on machine B.
boom_install_a-1.log is the log of what happens when I try to install Boom from CRAN on machine A.
After reading some StackOverflow threads (e.g. this one and this one), I made a ~/.R/Makevars file with the following lines:
CXX=g++-4.8
CXX1X=g++-4.8
But there were issues with C++11 support not activating (see boom_install_a-2.log).
So I changed ~/.R/Makevars to have:
CXX=g++-4.8
CXX1X=g++-4.8
CXX1XFLAGS=-std=c++11
which yielded the partially successful boom_install_a-3.log, except for some reason there's a line break that forces -o to be taken as a command. So, like, whaaaaaaaat?
This is really weird because everything else installs perfectly OK without any make variable setting -- see Rcpp_reinstall_a.log, where I successfully reinstall Rcpp after commenting out the lines in ~/.R/Makevars o_O
Then I went into Boom's source, edited the src/Makevars#98 to have $(shell echo $^)
because I read that shell
removes newlines1, 2 and tried different variations of that, but for whatever reason "-o Boom.so" still went to a new line :/
It's so frustrating D: I don't know what else to do! Tic-tic-tic-tic Boom!
Drew pointed out that:
The third error isn't a newline problem. It's trying to generate Boom.so but $CXX is blank again at that point for some reason. (https://twitter.com/wrathematics/status/784458657471819780)
And suggested to try setting the first line:
all: $(SHLIB)
$(SHLIB): libboom.a
and to "try setting CXX in Makevars over .R/M[akevars]" (https://twitter.com/wrathematics/status/784458928881098753)
So I commented out the variable settings in ~/.R/Makevars and changed src/Makevars to start with:
all: $(SHLIB)
$(SHLIB): libboom.a
CXX=g++-4.8
CXX1X=g++-4.8
CXX_STD = CXX11
CXX1XFLAGS=-std=c++11
which yields the yet-again-only-partially-successful boom_install_a-4.log. Maybe this /usr/share/R/debian/r-cran.mk file that is present on machine A but not B has something to with it?