I am using R 4.0.1 on MacOS 10.15.10. I try to install mvtnorm() package. Unfortunately, I need the most current version. The binaries of mvtnorm() are build using R < 4. As such I need to install from source. Here is what I get
install.packages("mvtnorm") There is a binary version available but the source version is later: binary source needs_compilation mvtnorm 1.1-0 1.1-1 TRUE Do you want to install from sources the package which needs compilation? (Yes/no/cancel) y installing the source package ‘mvtnorm’ trying URL 'https://cran.rstudio.com/src/contrib/mvtnorm_1.1-1.tar.gz' Content type 'application/x-gzip' length 163902 bytes (160 KB) ================================================== downloaded 160 KB * installing *source* package ‘mvtnorm’ ... ** package ‘mvtnorm’ successfully unpacked and MD5 sums checked ** using staged installation ** libs /usr/local/Cellar/llvm/8.0.0_1/bin/clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c C_FORTRAN_interface.c -o C_FORTRAN_interface.o In file included from C_FORTRAN_interface.c:8: In file included from ./mvtnorm.h:2: /Library/Frameworks/R.framework/Resources/include/R.h:55:11: fatal error: 'stdlib.h' file not found # include <stdlib.h> /* Not used by R itself, but widely assumed in packages */ ^~~~~~~~~~ 1 error generated. make: *** [C_FORTRAN_interface.o] Error 1 ERROR: compilation failed for package ‘mvtnorm’ * removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/mvtnorm’ * restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/mvtnorm’ Warning in install.packages : installation of package ‘mvtnorm’ had non-zero exit status The downloaded source packages are in ‘/private/var/folders/py/z1sgc8b17l5fp8pmrpnrjykm0000gn/T/Rtmpdrwvh2/downloaded_packages’ > ####
I already have the latest Xcode:
Profs-MacBook-Pro: xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Profs-MacBook-Pro: softwareupdate --install -a
Software Update Tool
Finding available software
No updates are available.
Any suggestion is welcome!