Unable to install hexbin in RStudio

Greetings,

I recently updated R and RStudio. Consequently, I have to reinstall a good number of packages, some with difficulty. In particular, reinstalling hexbin is quite problematic.
I’ve reinstalled my gcc compiler without success.
Any help would be greatly appreciated.

Cheers,
Jason

install.packages("hexbin")
#> 
#>   There is a binary version available but the source version is
#>   later:
#>        binary source needs_compilation
#> hexbin 1.27.3 1.28.0              TRUE
#> installing the source package 'hexbin'
#> Warning in install.packages("hexbin"): installation of package 'hexbin' had
#> non-zero exit status

Created on 2019-11-12 by the reprex package (v0.3.0)

Other console messages include:

* installing *source* package ‘hexbin’ ...
** package ‘hexbin’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran  -fPIC  -Wall -g -O2  -c hbin.f -o hbin.o
f951: Warning: Nonconforming tab character in column 1 of line 1 [-Wtabs]
.
.
.
f951: Warning: Nonconforming tab character in column 1 of line 88 [-Wtabs]
hbin.f:49:13:

   49 |    j1 = sx+.5
      |             1
Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion]
hbin.f:50:13:

   50 |    i1 = sy+.5
      |             1
Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion]
hbin.f:58:15:

   58 |      j2 = sx
      |               1

Warning: Nonconforming tab character at (1) [-Wtabs]
gfortran  -fPIC  -Wall -g -O2  -c hsm.f -o hsm.o


clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c reg.c -o reg.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o hexbin.so hbin.o hcell.o herode.o hsm.o reg.o -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [hexbin.so] Error 1
ERROR: compilation failed for package ‘hexbin’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/hexbin’
Warning in install.packages :
  installation of package ‘hexbin’ had non-zero exit status



System information
iMac OS Version: 10.14.6
RAM: 24BG

R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)

RStudio version 1.2.5019

1 Like

Would you be ok only installing the binary version of packages? This would avoid the issues with your compiler. For hexbin, this would mean using the previous release 1.27.3. The most recent release, 1.28.0, was released on Monday (2019-11-11), so the binary package hasn't been created for it yet.

To only install the binary versions of packages, you can run:

options(pkgType = "binary")
install.packages("hexbin")

To keep that setting across sessions, you can add options(pkgType = "binary") to ~/.Rprofile. Please see my other answer for more infromation on the pkgType option.

2 Likes