Help: Mclust/ rugarch installation

Hi, I tried to install mclust, but it doesn't work. Here's what the error shows:
"> install.packages("mclust")

There is a binary version available but the source version is later:
binary source needs_compilation
mclust 6.0.0 6.0.1 TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Yes
installing the source package ‘mclust’

trying URL 'https://cran.rstudio.com/src/contrib/mclust_6.0.1.tar.gz'
Content type 'application/x-gzip' length 2763121 bytes (2.6 MB)

downloaded 2.6 MB

  • installing source package ‘mclust’ ...
    ** package ‘mclust’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    gfortran -mmacosx-version-min=10.13 -fno-optimize-sibling-calls -fPIC -Wall -g -O2 -c dmvnorm.f -o dmvnorm.o
    make: gfortran: No such file or directory
    make: *** [dmvnorm.o] Error 1
    ERROR: compilation failed for package ‘mclust’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/mclust’
    Warning in install.packages :
    installation of package ‘mclust’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/tt/p3wngzv529gfbksf3bgsgyqh0000gn/T/RtmpHYU7hw/downloaded_packages’"

Would appreciate any help! Thanks

Two solutions: either you choose to install the binary package (answer "no" to installing from source), that will give you a slightly older version of the package but no compilation needed. Or, if you want to install from source, you need to install the compilation tools, especially gfortran, as described here.

2 Likes

@AlexisW is spot on. For the large majority of users, if at first you don’t succeed give up. Sometimes it’s possible to figure out what went wrong but you end up having the time it takes to fix it being subtracted from the time you spend using R for the purposes that brought you to it in the first place.

This applies to updates, also. I’ve got in the habit of

update.packages(ask = FALSE)

This topic was automatically closed 21 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.