marbel
marbel

Reputation: 7714

gcc error installing R packages in ubuntu 16.04

I'm getting a gccerror while trying to install several R packages for example devtools and plyr give the same errors.

gcc: error: unrecognized command line option '-fstack-protector-strong'
gcc: error: unrecognized command line option '-Wdate-time'
/usr/lib/R/etc/Makeconf:132: recipe for target 'devtools.o' failed

I'm using ubuntu 16.04 and R: 3.3.2. I had a working version of R but there were issues with some libraries, so I did: apt-get remove r-base-core and followed this to re-install

It would be great to get a set of instructions to re-install R if needed and fix the gcc error.

BTW: I also had an anaconda version, that I've removed.

EDIT:

$ gcc --version
gcc (Ubuntu 4.8.5-4ubuntu2) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Upvotes: 1

Views: 1489

Answers (1)

marbel
marbel

Reputation: 7714

In case anyone gets this again, the simplest solution was to upgrade gcc to gcc.4.9. Then everything works as expected.

Upvotes: 2

Related Questions