This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to install PEER in R?

Hi,

I installed PEER in R using the commands

https://github.com/PMBio/peer/wiki/Installation-instructions

which I encountered this error

  $ R CMD INSTALL --no-multiarch R_peer_source_1.3.tgz    
   $ make: *** [/usr/lib/R/etc/Makeconf:181: array_helper.o] Error 
    1ERROR: compilation failed for package ‘peer’
    * removing ‘/home/sahar/R/x86_64-pc-linux-gnu-library/4.0/peer’


 $ R CMD INSTALL  R_peer_source_1.3.tgz
$ make: *** [/usr/lib/R/etc/Makeconf:181: array_helper.o] Error 
1ERROR: compilation failed for package ‘peer’
* removing ‘/home/sahar/R/x86_64-pc-linux-gnu-library/4.0/peer’

To solve this problem, this solution was suggested, which I used, but again I got this error

sudo update-alternatives --remove-all gcc
update-alternatives: error: no alternatives for gcc

sudo update-alternatives --remove-all g++
update-alternatives: error: no alternatives for g++

sudo apt-get install gcc-5.5 g++-5.5
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gcc-5.5
E: Couldn't find any package by glob 'gcc-5.5'
E: Couldn't find any package by regex 'gcc-5.5'
E: Unable to locate package g++-5.5
E: Couldn't find any package by glob 'g++-5.5'
E: Couldn't find any package by regex 'g++-5.5'

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5.5 10
update-alternatives: error: alternative path /usr/bin/gcc-5.5 doesn't exist

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5.5 10
update-alternatives: error: alternative path /usr/bin/g++-5.5 doesn't exist

 

 sudo update-alternatives --config gcc
 update-alternatives: error: no alternatives for gcc

sudo update-alternatives --config g++
update-alternatives: error: no alternatives for g++

 

gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

What solution do you suggest to solve this problem?

peer r rstudio rna-seq

1 answer

It seems to be on CRAN, so your best bet would likely be to use conda. Once conda is installed you can create an environment with PEER.

conda create -n peer -c conda-forge -c bioconda r-peer

Once the environment is created you can activate it and use it when needed.

conda activate peer

Related tutorial on speeding up conda with mamba

Mamba is recommending R v3.3.1 as a dependency, so trying to install PEER within a newer version on R might cause problems. It's also properly showing a C++ compiler as one of the dependencies it will install, which should help bypass your problem.

mamba repoquery depends -a r-peer

 Name   Version Build    Channel             
──────────────────────────────────────────────
 r-peer 1.3     r3.3.1_0 bioconda/linux-64   
 libgcc 4.8.4   1        conda-forge/linux-64
 r      3.3.1   r3.3.1_1 pkgs/r/linux-64     

Log in to answer this question.