R package mclust update fails on updated R 4.0.0

Update of R package mclust to version 6.1.1 failed in R system updated to 4.4.0 with following error:

  • installing source package 'mclust' ...
    ** package 'mclust' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    gfortran -O2 -mfpmath=sse -msse2 -mstackrealign -c dmvnorm.f -o dmvnorm.o
    make: gfortran: No such file or directory
    make: *** [C:/PROGRA~1/R/R-44~1.0/etc/x64/Makeconf:313: dmvnorm.o] Error 127
    ERROR: compilation failed for package 'mclust'
  • removing 'C:/Larry/R/win-library/4.3/mclust'
  • restoring previous 'C:/Larry/R/win-library/4.3/mclust'
    Warning in install.packages :
    installation of package ‘mclust’ had non-zero exit status

This error appears to be different from the error reported yesterday concerning incompatibility of R 4.4.0 with RStudio, (R.4.4.0 browser() incompatible with RStudio 2023.12.1 · Issue #14590 · rstudio/rstudio · GitHub) as the update of mclust also fails on a native Rgui window, though more gracefully, in that the Rgui simply returns without updating the package.

packageVersion('mclust')
[1] ‘6.1’
update.packages('mclust', type = 'source')
packageVersion('mclust')
[1] ‘6.1’

Running R 4.4.0 (newly updated yesterday), RStudio RStudio 2023.12.1+402 on Windows 11 up to date.
The update of mclust runs correctly on my university research desktop running R 4.3.3.
Larry Hunsicker

First of all, seems like you are installing packages with R 4.4.x into a library that you use (or used?) with R 4.3.x. Don't do that, it is going to fail in various ways. You need to use separate libraries for R 4.3.x and R 4.4.x.

Second,

make: gfortran: No such file or directory

means that you don't have a gfortran compiler installed, which on Windows means that you don't have Rtools 4.4 installed. If you compile packages from source, you need to install Rtools, a version that is appropriate for your R version. R 4.4.x needs Rtools 4.4 currently, install it from here: RTools: Toolchains for building R and R packages from source on Windows

1 Like

Thanks, Gabor. That fixed the problem.
Larry Hunsicker

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.