sm package not installing on Mac

Error Information:

ERROR:
compilation failed for package ‘sm’

  • removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/sm’
    Warning in install.packages :
    installation of package ‘sm’ had non-zero exit status

Description of issue -
I am trying to install the 'sm' package. When I run install.packages('sm'), I get the following in the console:
'Do you want to install from sources the package which needs compilation? (Yes/no/cancel) '
I type yes. However, then I get an error and warning.

Steps taken so far -

System Information:

  • RStudio Edition: Desktop
  • RStudio Version: 1.2.5019
  • OS Version: macOS Sierra
  • R Version:

Also:

  • RStudio diagnostics report:
  • Your sessionInfo():
  • RStudio crash report:
  • RStudio application log files:

From Troubleshooting Guide: Using RStudio

Hi, welcome!

Please post the whole error message, you are omitting the important parts.

Hello and thanks!

Here is the whole message that appears in my console after I try to install.packages('sm') :

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

trying URL 'https://cran.rstudio.com/src/contrib/sm_2.2-5.6.tar.gz'
Content type 'application/x-gzip' length 256355 bytes (250 KB)
==================================================
downloaded 250 KB

* installing *source* package ‘sm’ ...
** package ‘sm’ successfully unpacked and MD5 sums checked
** libs
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c fgamma.c -o fgamma.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c init.c -o init.o
gfortran  -fPIC -Wall -g -O2  -c  variogram.f90 -o variogram.o
make: gfortran: No such file or directory
make: *** [variogram.o] Error 1
ERROR: compilation failed for package ‘sm’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/sm’
Warning in install.packages :
  installation of package ‘sm’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/cd/j_g3l9fs1rq1sl92bj2nn9q00000gn/T/RtmptbwAdn/downloaded_packages’

R is not being able to find the compiler, if you don't need the latest version you could answer "no" and get the binary version which doesn't need compilation, if you still want the source version, the first thing to try is installing/updating Xcode in your system, you need it for compiling packages on macOS

xcode-select --install

Here are some installation instructions

1 Like

That worked (i.e. answering no). 'sm' is now installed. Thank you very much!

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