1

I downloaded bioconductor and attempted to install a package ("limma") which installed successfully, however when I tried to update bioconductor I keep getting errors relating to invalid compiler options. It seems to be specific to gcc, the gfortran packages install without issue.

Here is the output:

[xxx]$ su -c 'R'
Password: 

R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> source("http://bioconductor.org/biocLite.R")
Bioconductor version 2.11 (BiocInstaller 1.8.3), ?biocLite for help
> biocLite("BiocUpgrade")
BioC_mirror: http://bioconductor.org
Using Bioconductor version 2.11 (BiocInstaller 1.8.3), R version 2.15.
Old packages: 'Biobase', 'foreign', 'IRanges', 'lattice', 'MASS', 'Matrix',
  'mvtnorm', 'nlme', 'rpart', 'survival', 'waveslim', 'wavethresh'
Update all/some/none? [a/s/n]: a
trying URL 'http://bioconductor.org/packages/2.11/bioc/src/contrib/Biobase_2.18.0.tar.gz'
Content type 'application/x-gzip' length 1913386 bytes (1.8 Mb)
opened URL
==================================================
downloaded 1.8 Mb

trying URL 'http://cran.fhcrc.org/src/contrib/foreign_0.8-52.tar.gz'
Content type 'application/x-gzip' length 318387 bytes (310 Kb)
opened URL
==================================================
downloaded 310 Kb

trying URL 'http://bioconductor.org/packages/2.11/bioc/src/contrib/IRanges_1.16.5.tar.gz'
Content type 'application/x-gzip' length 699291 bytes (682 Kb)
opened URL
==================================================
downloaded 682 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/lattice_0.20-13.tar.gz'
Content type 'application/x-gzip' length 367715 bytes (359 Kb)
opened URL
==================================================
downloaded 359 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/MASS_7.3-23.tar.gz'
Content type 'application/x-gzip' length 472005 bytes (460 Kb)
opened URL
==================================================
downloaded 460 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/Matrix_1.0-11.tar.gz'
Content type 'application/x-gzip' length 1676392 bytes (1.6 Mb)
opened URL
==================================================
downloaded 1.6 Mb

trying URL 'http://cran.fhcrc.org/src/contrib/mvtnorm_0.9-9994.tar.gz'
Content type 'application/x-gzip' length 322279 bytes (314 Kb)
opened URL
==================================================
downloaded 314 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/nlme_3.1-108.tar.gz'
Content type 'application/x-gzip' length 694594 bytes (678 Kb)
opened URL
==================================================
downloaded 678 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/rpart_4.1-0.tar.gz'
Content type 'application/x-gzip' length 808365 bytes (789 Kb)
opened URL
==================================================
downloaded 789 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/survival_2.37-2.tar.gz'
Content type 'application/x-gzip' length 1714302 bytes (1.6 Mb)
opened URL
==================================================
downloaded 1.6 Mb

trying URL 'http://cran.fhcrc.org/src/contrib/waveslim_1.7.1.tar.gz'
Content type 'application/x-gzip' length 703759 bytes (687 Kb)
opened URL
==================================================
downloaded 687 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/wavethresh_4.6.1.tar.gz'
Content type 'application/x-gzip' length 525390 bytes (513 Kb)
opened URL
==================================================
downloaded 513 Kb

* installing *source* package ‘Biobase’ ...
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe     -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4      -m64 -mtune=generic  -c Rinit.c -o Rinit.o
cc1: error: unrecognized command line option "-fstack-protector"
cc1: error: invalid parameter `ssp-buffer-size'
Rinit.c:1: error: bad value (generic) for -mtune= switch
make: *** [Rinit.o] Error 1
ERROR: compilation failed for package ‘Biobase’
* removing ‘/usr/lib64/R/library/Biobase’
* restoring previous ‘/usr/lib64/R/library/Biobase’
* installing *source* package ‘foreign’ ...
** package ‘foreign’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe     -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4      -m64 -mtune=generic  -c R_systat.c -o R_systat.o
cc1: error: unrecognized command line option "-fstack-protector"
cc1: error: invalid parameter `ssp-buffer-size'
R_systat.c:1: error: bad value (generic) for -mtune= switch
make: *** [R_systat.o] Error 1
ERROR: compilation failed for package ‘foreign’
* removing ‘/usr/lib64/R/library/foreign’
* restoring previous ‘/usr/lib64/R/library/foreign’
* installing *source* package ‘IRanges’ ...
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe     -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4      -m64 -mtune=generic  -c AEbufs.c -o AEbufs.o
cc1: error: unrecognized command line option "-fstack-protector"
cc1: error: invalid parameter `ssp-buffer-size'
AEbufs.c:1: error: bad value (generic) for -mtune= switch
make: *** [AEbufs.o] Error 1
ERROR: compilation failed for package ‘IRanges’
* removing ‘/usr/lib64/R/library/IRanges’
* restoring previous ‘/usr/lib64/R/library/IRanges’
* installing *source* package ‘lattice’ ...
** package ‘lattice’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe     -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4      -m64 -mtune=generic  -c init.c -o init.o
cc1: error: unrecognized command line option "-fstack-protector"
cc1: error: invalid parameter `ssp-buffer-size'
init.c:1: error: bad value (generic) for -mtune= switch
make: *** [init.o] Error 1
ERROR: compilation failed for package ‘lattice’
* removing ‘/usr/lib64/R/library/lattice’
* restoring previous ‘/usr/lib64/R/library/lattice’
* installing *source* package ‘MASS’ ...
** package ‘MASS’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe     -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4      -m64 -mtune=generic  -c MASS.c -o MASS.o
cc1: error: unrecognized command line option "-fstack-protector"
cc1: error: invalid parameter `ssp-buffer-size'
MASS.c:1: error: bad value (generic) for -mtune= switch
make: *** [MASS.o] Error 1
ERROR: compilation failed for package ‘MASS’
* removing ‘/usr/lib64/R/library/MASS’
* restoring previous ‘/usr/lib64/R/library/MASS’
* installing *source* package ‘mvtnorm’ ...
** package ‘mvtnorm’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe     -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4      -m64 -mtune=generic  -c miwa.c -o miwa.o
cc1: error: unrecognized command line option "-fstack-protector"
cc1: error: invalid parameter `ssp-buffer-size'
miwa.c:1: error: bad value (generic) for -mtune= switch
make: *** [miwa.o] Error 1
ERROR: compilation failed for package ‘mvtnorm’
* removing ‘/usr/lib64/R/library/mvtnorm’
* restoring previous ‘/usr/lib64/R/library/mvtnorm’
* installing *source* package ‘rpart’ ...
** package ‘rpart’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe     -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4      -m64 -mtune=generic  -c anova.c -o anova.o
cc1: error: unrecognized command line option "-fstack-protector"
cc1: error: invalid parameter `ssp-buffer-size'
anova.c:1: error: bad value (generic) for -mtune= switch
make: *** [anova.o] Error 1
ERROR: compilation failed for package ‘rpart’
* removing ‘/usr/lib64/R/library/rpart’
* restoring previous ‘/usr/lib64/R/library/rpart’
* installing *source* package ‘survival’ ...
** package ‘survival’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe     -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4      -m64 -mtune=generic  -c agexact.c -o agexact.o
cc1: error: unrecognized command line option "-fstack-protector"
cc1: error: invalid parameter `ssp-buffer-size'
agexact.c:1: error: bad value (generic) for -mtune= switch
make: *** [agexact.o] Error 1
ERROR: compilation failed for package ‘survival’
* removing ‘/usr/lib64/R/library/survival’
* restoring previous ‘/usr/lib64/R/library/survival’
* installing *source* package ‘waveslim’ ...
** package ‘waveslim’ successfully unpacked and MD5 sums checked
** libs
gfortran -m64   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-    protector --param=ssp-buffer-size=4  -m64 -mtune=generic -I/usr/lib64/gfortran/modules  -c     bell-p-w.f -o bell-p-w.o
bell-p-w.f:131.15:

         MAXIT=(K+3)*ROOTN                                              
               1
Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1)
bell-p-w.f:344.18:

      INTEGER N, I, L, K, IFAULT                                        
                  1
Warning: Unused variable 'i' declared at (1)
bell-p-w.f:345.36:

      DOUBLE PRECISION V(N), RN, STD, DSUM, DWSUM, ZERO, ONE,           
                                    1
Warning: Unused variable 'std' declared at (1)
bell-p-w.f:346.18:

     * TWO, ZFLOAT                                                      
                  1
Warning: Unused variable 'zfloat' declared at (1)
bell-p-w.f: In function ‘dpss’:
bell-p-w.f:203:0: warning: ‘sum’ may be used uninitialized in this function [-Wmaybe-    uninitialized]
bell-p-w.f:207:0: warning: ‘ssnorm’ may be used uninitialized in this function [-Wmaybe-    uninitialized]
bell-p-w.f:203:0: warning: ‘diff’ may be used uninitialized in this function     [-Wmaybe-    uninitialized]
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe     -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4      -m64 -mtune=generic  -c dwt.c -o dwt.o
cc1: error: unrecognized command line option "-fstack-protector"
cc1: error: invalid parameter `ssp-buffer-size'
dwt.c:1: error: bad value (generic) for -mtune= switch
make: *** [dwt.o] Error 1
ERROR: compilation failed for package ‘waveslim’
* removing ‘/usr/lib64/R/library/waveslim’
* restoring previous ‘/usr/lib64/R/library/waveslim’
* installing *source* package ‘Matrix’ ...
** package ‘Matrix’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -DNTIMER -I./SuiteSparse_config -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-    protector --param=ssp-buffer-size=4  -m64 -mtune=generic  -c CHMfactor.c -o CHMfactor.o
cc1: error: unrecognized command line option "-fstack-protector"
cc1: error: invalid parameter `ssp-buffer-size'
CHMfactor.c:1: error: bad value (generic) for -mtune= switch
make: *** [CHMfactor.o] Error 1
ERROR: compilation failed for package ‘Matrix’
* removing ‘/usr/lib64/R/library/Matrix’
* restoring previous ‘/usr/lib64/R/library/Matrix’
* installing *source* package ‘nlme’ ...
** package ‘nlme’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include   -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector     --param=ssp-buffer-size=4  -m64 -mtune=generic  -c corStruct.c -o corStruct.o
cc1: error: unrecognized command line option "-fstack-protector"
cc1: error: invalid parameter `ssp-buffer-size'
corStruct.c:1: error: bad value (generic) for -mtune= switch
make: *** [corStruct.o] Error 1
ERROR: compilation failed for package ‘nlme’
* removing ‘/usr/lib64/R/library/nlme’
* restoring previous ‘/usr/lib64/R/library/nlme’
* installing *source* package ‘wavethresh’ ...
** package ‘wavethresh’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe     -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4      -m64 -mtune=generic  -c WAVDE.c -o WAVDE.o
cc1: error: unrecognized command line option "-fstack-protector"
cc1: error: invalid parameter `ssp-buffer-size'
WAVDE.c:1: error: bad value (generic) for -mtune= switch
make: *** [WAVDE.o] Error 1
ERROR: compilation failed for package ‘wavethresh’
* removing ‘/usr/lib64/R/library/wavethresh’
* restoring previous ‘/usr/lib64/R/library/wavethresh’

The downloaded source packages are in
        ‘/tmp/RtmpKXUsRY/downloaded_packages’
Updating HTML index of packages in '.Library'

Making packages.html  ... done
There were 13 warnings (use warnings() to see them)

I am running: Linux fedora 3.6.8-2.fc17.x86_64 gcc-4.7.2-2.fc17.x86_64 R 2.15.2 However all I see in /usr/bin is gcc34, so I'm not exactly sure. I have to start R with sudo because for all but the package data.tables, it doesn't have access to install in the directories.

Joe
  • 320
  • 1
  • 4
  • 15
  • Can you show me the output of `su -c gcc --v --version` ? – fons Feb 14 '13 at 00:48
  • Here is the output, it looks like it is 3.4: `gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-24.fc17) Copyright (C) 2006 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.` I remember installing 3.4 when I was getting cuda setup but I thought I had restored the link correctly after I was finished. Any suggestions? – Joe Feb 14 '13 at 01:02
  • If R is calling the old version of gcc when compiling packages, that could be the problem. I think gcc > 4.2 is required for R 2.15.2. Can you either update gcc, or rearrange your PATH so a newer version of gcc is found first? – Kevin Ushey Feb 14 '13 at 01:03
  • Here is the output of echo $PATH :`/opt/cuda/bin:/lib64/mpich2/bin:/opt/cuda/bin:/usr/lib64/mpich2/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/local/sbin:/usr/sbin:/home/joe/.local/bin:/home/joe/bin` I have tried to update by yum but it sees 4.7 is installed already and quits. I've tried to remake the link and I don't see any path variables to remove in .bashrc or .bash_profile. – Joe Feb 14 '13 at 01:11

2 Answers2

9

I had a similar problem trying to install mvtnorm in R on Ubuntu. I was getting the error:

gcc: error: unrecognized command line option "-fstack-protector-strong"

I looked into which version of gcc was being used by default

which gcc
/home/ralien/anaconda3/bin/gcc

It turns out that, for some reason, Anaconda uses a gcc, g++, and gfortran compiler that is really old: version 4.8.5. This version doesn't seem to support the -fstack-protector-strong argument.

I checked the gcc, g++, and gfortran version in /usr/bin and saw that my system compilers were much newer, 5.4 or so. The trick is to force R to use the new compilers by creating

~/.R/Makevars

and changing the path for ALL compilers to the system version. So the Makevars file would contain the entries:

CC=/usr/bin/gcc
CXX=/usr/bin/g++
FC=/usr/bin/gfortran
F77=/usr/bin/gfortran

You can then use R CMD INSTALL to compile the package with the new version of gcc, g++, and gfortran.

Or at least this worked for me.

Nate
  • 1,888
  • 3
  • 18
  • 26
  • Not sure why but I had a more complicated set of paths for all the compilers. getting everything from /usr/bin seems to have worked wonders. Thank you! – Michael Roswell Mar 02 '21 at 00:24
2

Modify your PATH to make sure that a gcc compiler more recent than gcc 3.2 is found.

If necessary, create a link to the recent one (assuming you want to still keep gcc 3.2 around):

mkdir $HOME/bin
ln -s /usr/bin/gcc-VERSION $HOME/bin/gcc
export PATH=$HOME/bin:$PATH
# proceed to your normal installation

VERSION indicates the gcc version of the compiler normally used in your system

jbaums
  • 27,115
  • 5
  • 79
  • 119
fons
  • 4,905
  • 4
  • 29
  • 49
  • I removed the nvidia path I had added to my .bash rc and ran 'su -c "ln -s /usr/bin/x86_64-redhat-linux-gcc /usr/bin/gcc"'. I opened a new terminal window and ran 'gcc -v' and it reads 4.7 now. This seems to be working, I did this before I saw your post, should I change it? – Joe Feb 14 '13 at 01:24
  • Have the link be in the home versus in /usr/bin. – Joe Feb 14 '13 at 01:46
  • Doing it in $HOME/bin is less intrusive . But it seems that cuda is doing the wrong thing anyway by providing its system-wide gcc so, whatever works best for you :) – fons Feb 14 '13 at 01:51
  • A bit late but CUDA requires a bit of going backwards in terms of versions and setting things up to get it to compile. Last time I checked it looked like nvidia gave up after FC 16. – Joe Feb 28 '13 at 16:22