0

After loading R 4.0.0 on Ubuntu 20.04.

R version 4.0.0 (2020-04-24) -- "Arbor Day"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-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.

And with the following packages loaded:

> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.0.0

I try to install package mclust and R get stuck when preparing for lazy loading.

> install.packages('mclust')
Installing package into ‘/home/marc/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/mclust_5.4.6.tar.gz'
Content type 'application/x-gzip' length 2877519 bytes (2.7 MB)
==================================================
downloaded 2.7 MB

* installing *source* package ‘mclust’ ...
** package ‘mclust’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-Do_dS_/r-base-4.0.0=. -fstack-protector-strong  -c dmvnorm.f -o dmvnorm.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-Do_dS_/r-base-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-Do_dS_/r-base-4.0.0=. -fstack-protector-strong  -c mclust.f -o mclust.o
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-Do_dS_/r-base-4.0.0=. -fstack-protector-strong  -c mclustaddson.f -o mclustaddson.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o mclust.so dmvnorm.o init.o mclust.o mclustaddson.o -llapack -lblas -lgfortran -lm -lquadmath -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
installing to /home/marc/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-mclust/00new/mclust/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading

I have wait for all night, but the installation is still stuck at the same point. Does anybody know how to solve this?

I have installed different packages with no problems. Here a complete list of packages already installed at my library directory:

marc@hera:~/R/x86_64-pc-linux-gnu-library/4.0$ ls 
askpass     DEoptimR   generics     later       pkgbuild       readxl       tibble
assertthat  desc       ggplot2      lazyeval    pkgconfig      rematch      tictoc
backports   deSolve    glue         lifecycle   pkgload        remotes      tidyr
base64enc   digest     gridExtra    lspline     plotly         reprex       tidyselect
BH          diptest    gtable       lubridate   plyr           reshape2     tidyverse
blob        dplyr      gtools       magrittr    praise         rlang        tinytex
broom       egg        haven        markdown    prettyunits    rmarkdown    utf8
callr       ellipsis   hexbin       mime        processx       robustbase   uuid
cellranger  evaluate   highr        modelr      progress       rprojroot    vctrs
cli         fansi      hms          modeltools  promises       rstudioapi   viridisLite
clipr       farver     htmltools    mstate      ps             rvest        webshot
coda.base   flexmix    htmlwidgets  muhaz       purrr          scales       whisker
colorspace  flexsurv   httr         munsell     qpdf           selectr      withr
crayon      flextable  isoband      mvtnorm     quadprog       spatial      xfun
crosstalk   forcats    jsonlite     nlme        R6             stringi      xml2
curl        foreign    kableExtra   officer     RColorBrewer   stringr      yaml
data.table  fs         kernlab      openssl     Rcpp           sys          zip
DBI         gdata      knitr        pdftools    RcppArmadillo  systemfonts
dbplyr      gdtools    labeling     pillar      readr          testthat

marc1s
  • 779
  • 6
  • 24
  • Maybe try `sudo Rscript -e "install.packages('mclust')"` directly in the Terminal? There also used to be an Ubuntu package that could be installed via `sudo apt install r-cran-mclust`, but it doesn't work for me anymore. – JBGruber Jun 04 '20 at 09:20
  • @JBGruber Doing as you suggest (`sudo Rscript -e...`) happens exactly the same. In this case, it tries to install the package at "/usr/loca/lib/R/site-library", I guess because I am running Rscript as root. I also tried the apt option with no success. – marc1s Jun 04 '20 at 09:32
  • I also noticed that `mclust` is already installed according to your `ls` query. Is there maybe something wrong with that folder? But I'm only guessing here. The two approaches above usually work for me. – JBGruber Jun 04 '20 at 09:52
  • The `mclust` folder is empty. I forgot to remove it. After trying to install `mclust` I got two folders in the library directory `00LOCK-mclust` and `mclust`. I had to remove the first because otherwise I can not try to install again. I will remove the folder in the output to avoid confusions. – marc1s Jun 04 '20 at 09:57
  • In this case you might have more luck trying it on the mailing list for `R` and `Ubuntu`: https://cran.r-project.org/bin/linux/ubuntu/README.html#reporting-problems – JBGruber Jun 04 '20 at 10:05
  • 1
    @JBGruber Thank you. I've just send the problem in the mailing list. See if I am lucky. If the problem solves, I will post the solution here. – marc1s Jun 04 '20 at 10:18

2 Answers2

1

I've followed @JBGruber suggestion of contacting the R linux mailing list. There I get more information, I've included the repository:

sudo add-apt-repository ppa:c2d4u.team/c2d4u4.0+
sudo apt-get update
sudo apt install r-cran-mclust

I really don't know well what I have done, but now it works.

marc1s
  • 779
  • 6
  • 24
  • 1
    Imagine `apt` like the `install.packages` command in `R`. Usually you get your packages from the CRAN server. A PPA is an alternative source for packages (like GitHub in the `R` world). Now there are two ways to install `R` packages: 1. from source (meaning you have to compile them) or 2. as a binary (meaning someone compiled them for you). Your compilation failed so you get the binary through this new PPA. Hope that helps. – JBGruber Jun 06 '20 at 15:37
0

For me, the problem is with openblas-pthread. I changed it to default blas or openblas-openmp then I can install mclust normally.

bya
  • 33
  • 5