4

rstudio-server with "/bin/sh: x86_64-conda_cos6-linux-gnu-cc: command not found" fail when installing R package

I nearly try all methods to handle this fault.I sucessfully installed the dependent tools like(with conda):

conda install gcc_linux-64 
conda install gxx_linux-64
conda install gfortran_linux-64

or I've add conda path into $PATH:

which conda
#/usr/softwares/conda/location/bin/conda

$PATH
#-bash: /usr/softwares/sratoolkit/sratoolkit.2.9.6-ubuntu64/bin:/usr/softwares/conda/location/envs/bioinf/bin:/usr/softwares/conda/location/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/huangwb8/.aspera/connect/bin:/usr/lib/rstudio-server/bin: No such file or directory

Nothing can help. Because I can install R package normally in shell R or in pure R environment, and the failure only appears when I use rstudio-server. I think it's something wrong with my rstudio-server.But I don't know how to handle it. Looking for help!!

Weibin Huang
  • 41
  • 1
  • 3

2 Answers2

1

I also encountered such case during install packages within the Rstudio server using conda R. And as I install R package normally in shell R or in pure R environment, I noticed the compilation command.

x86_64-conda_cos6-linux-gnu-cc -I"/app/sys/miniconda3/envs/R-3.6.1/lib/R/include" -DNDEBUG   -DNDEBUG -D_FORTIFY_SOURCE=2 -O2  -I/app/sys/miniconda3/envs/R-3.6.1/include -Wl,-rpath-link,/app/sys/miniconda3/envs/R-3.6.1/lib -Iutf8lite/src -fpic  -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I/app/sys/miniconda3/envs/R-3.6.1/include -fdebug-prefix-map=/tmp/build/80754af9/r-base_1570124924484/work=/usr/local/src/conda/r-base-3.6.1 -fdebug-prefix-map=/app/sys/miniconda3/envs/R-3.6.1=/usr/local/src/conda-prefix  -c utf8lite/src/escape.c -o utf8lite/src/escape.o

Seems to me, the compilation process just uses the compiler within your conda env. For the installation within Rstudio-server, the compilation process cannot found its designated compiler (only the system default compiler exists). So my recommendation is either case:

  • Install R packages in shell R within your conda env. (Tried and worked)
  • Find the path of "x86_64-conda_cos6-linux-gnu-cc" and add it into your default path like ~/.bashrc or ~/.bash_profile, so your installation will find the compiler. (I haven't tried yet, maybe it works)
Long Qihan
  • 21
  • 1
1

You may use other newer versions if they are installed on your machine, like

x86_64-conda_cos7-linux-gnu-cc

In my case I changed CC=x86_64-conda_cos6-linux-gnu-cc in the configuration file.

Ahmad
  • 8,811
  • 11
  • 76
  • 141