Building Tools are missing in RStudio

1.2k Views Asked by At

First of all, I am working on a Mac. I am trying to install Blotter from GitHub. I found several descriptions of how to do that but my RStudio tells me that I am missing Building tools and gives me a link (https://www.cnet.com/how-to/install-command-line-developer-tools-in-os-x/) where it is described to do that. So far so good. I downloaded Xcode and the command line tools for Mac and installed those. Nothing changed even after restarting R. Then I found this https://cran.r-project.org/bin/macosx/tools/. I installed it and during that, it told me that I had to do the following

"This package will install clang 6.0.0 for OS X 10.11 (El Capitan) or higher with OpenMP support in /usr/local/clang6

In order to use this compiler you have to add /usr/local/clang6/bin to the PATH environment variable such as export PATH=/usr/local/clang6/bin:$PATH"

So I changed the environmental variable path as follows http://blog.tonytsai.name/blog/2018-05-07-setting-path-variable-for-gs-command-in-rstudio/. How I changed the PATH variable. Again I restarted R but still, nothing changed. I still get the notice that the building tool is missing.

Somehow it seems to me that I installed everything correctly but R doesn't recognize the Programmes. Does anyone have an idea? I tried to search for settings to tell R that I installed the command line tool but couldn't really find anything helpful.

2

There are 2 best solutions below

3
tcratius On

Ok, a bit of an update.

Best I can see it that Blotter is built and stored on R-Forge packages under a package called RStrategist

In R console type/cut & paste this.

install.packages('RStrategist',repos='http://R-Forge.r-project.org')

Rstrat

See R forR-Forge for more details. Once this has been installed run instead.

library(RStrategist)

Unfortunately, I am not willing to install this package and see if it works mainly because 1) don't need it nor know how to use it, 2) not sure how good packages are from R-forge, though it seems legit, but, this brings me back to point one.

0
tbacher On

So before i read the updated answer of Conrad Thiele i was trying around bit. Basically i deleted R, R Studio, Xcode and Command Line tools. Then i installed Xcode, Command Line tools, R and RStudio. Then i followed the notice on https://cran.r-project.org about the tools and installed both stated tools. As mentioned in the original question the Clang package tells you to change the Environmental Variable. And there was the mistake i believe. I originally simply pasted "PATH=/usr/local/clang6/bin:$PATH" into the the ".Renviron" file. With reading up online i noticed that "export PATH=/usr/local/clang6/bin:$PATH" is actually a Command for the Mac Terminal. After executing it, it sill didn't work but then i remembered that i still had the Path "PATH=/usr/local/clang6/bin:$PATH" in the the ".Renviron" file. Once i deleted that it worked. So i guess the key was that with changing the Environmental Variable correctly R found the connection with the right tool. Patients paid off.