hexbin package installation issue

I'm having issues installing R packages. Stuck at 'hexbin' package installation with the below error;

Error Log:

gcc -m64 -std=gnu99 -shared -L/usr/lib64/R/lib -L/usr/local/lib64 -o hexbin.so hbin.o hcell.o herode.o hsm.o reg.o -lgfortran -lm -lquadmath -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
/usr/bin/ld: cannot find -lquadmath
collect2: error: ld returned 1 exit status
make: *** [hexbin.so] Error 1
ERROR: compilation failed for package ‘hexbin’

  • removing ‘/home/adt4-dev/R/x86_64-redhat-linux-gnu-library/3.4/hexbin’
    Warning in install.packages :
    installation of package ‘hexbin’ had non-zero exit status

System Information:

  • RStudio Edition: Server
  • RStudio Version: 1.0.153
  • OS Version: Amazon Linux
  • R Version: 3.4.1

This usually implies that you are missing the relevant Fortran libraries. You should be able to install them via your package manager; IIRC for Redhat this is:

yum install gcc-gfortran

Also, the GCC has been reinstalled, just in case;

$ which gcc
/usr/bin/gcc

$ gcc --version
gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)

I wonder if the Fortran libraries are bundled separately. What packages are listed by:

yum search gfortran

Do you see anything mentioning libgfortran? If so, does installing those help? For example:

sudo yum install libgfortran

You could also try searching for libgfortran, in case it's installed somewhere that R isn't looking:

sudo updatedb
locate libgfortran

I see, on my VM:

and R seems to be able to find the library when located there.

$ yum search gfortran -- gives this;

gcc- gfortran .noarch : Fortran support
gcc44- gfortran .x86_64 : Fortran support
gcc48- gfortran .x86_64 : Fortran support
gcc64- gfortran .x86_64 : Fortran support
lib gfortran .i686 : Fortran runtime
lib gfortran .x86_64 : Fortran runtime

$ locate libgfortran. -- gives this;

/usr/lib/libgfortran.so

/usr/lib/gcc/x86_64-amazon-linux/4.8.5/libgfortran.a

/usr/lib/gcc/x86_64-amazon-linux/4.8.5/libgfortran.so

/usr/lib/gcc/x86_64-amazon-linux/4.8.5/libgfortran.spec

/usr/lib/gcc/x86_64-amazon-linux/4.8.5/libgfortranbegin.a

/usr/lib/gcc/x86_64-amazon-linux/4.8.5/32/libgfortran.a

/usr/lib/gcc/x86_64-amazon-linux/4.8.5/32/libgfortran.so

/usr/lib/gcc/x86_64-amazon-linux/4.8.5/32/libgfortranbegin.a

/usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgfortran.a

/usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgfortran.so

/usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgfortran.spec

/usr/lib/gcc/x86_64-amazon-linux/6.4.1/32/libgfortran.a

/usr/lib/gcc/x86_64-amazon-linux/6.4.1/32/libgfortran.so

/usr/lib64/libgfortran.so.3

/usr/lib64/libgfortran.so.3.0.0

/usr/lib64/R/lib/libgfortran.so.3

/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2002.libgfortran.bz2

/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2003.libgfortran.bz2

/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2004.libgfortran.bz2

/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2005.libgfortran.bz2

/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2006.libgfortran.bz2

/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2007.libgfortran.bz2

/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2008.libgfortran.bz2

/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2009.libgfortran.bz2

/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2010.libgfortran.bz2

/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2011.libgfortran.bz2

/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2012.libgfortran.bz2

/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2002.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2003.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2004.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2005.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2006.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2007.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2008.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2009.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2010.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2011.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2012.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2013.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2014.libgfortran.bz2

/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2015.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog.libgfortran.bz2
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/checksum_data
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/checksum_type
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/command_line
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/from_repo
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/from_repo_revision
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/from_repo_timestamp
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/installed_by
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/origin_url
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/reason
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/releasever
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/var_awsdomain
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/var_awsregion
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/var_uuid

$ yum search gfortran

Loaded plugins: priorities, update-motd, upgrade-helper
============================ N/S matched: gfortran =============================
gcc-gfortran.noarch : Fortran support
gcc44-gfortran.x86_64 : Fortran support
gcc48-gfortran.x86_64 : Fortran support
gcc64-gfortran.x86_64 : Fortran support
libgfortran.i686 : Fortran runtime
libgfortran.x86_64 : Fortran runtime

$ locate libgfortran

/usr/lib/libgfortran.so
/usr/lib/gcc/x86_64-amazon-linux/4.8.5/libgfortran.a
/usr/lib/gcc/x86_64-amazon-linux/4.8.5/libgfortran.so
/usr/lib/gcc/x86_64-amazon-linux/4.8.5/libgfortran.spec
/usr/lib/gcc/x86_64-amazon-linux/4.8.5/libgfortranbegin.a
/usr/lib/gcc/x86_64-amazon-linux/4.8.5/32/libgfortran.a
/usr/lib/gcc/x86_64-amazon-linux/4.8.5/32/libgfortran.so
/usr/lib/gcc/x86_64-amazon-linux/4.8.5/32/libgfortranbegin.a
/usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgfortran.a
/usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgfortran.so
/usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgfortran.spec
/usr/lib/gcc/x86_64-amazon-linux/6.4.1/32/libgfortran.a
/usr/lib/gcc/x86_64-amazon-linux/6.4.1/32/libgfortran.so
/usr/lib64/libgfortran.so.3
/usr/lib64/libgfortran.so.3.0.0
/usr/lib64/R/lib/libgfortran.so.3
/usr/lib64/R/lib/libgfortran.so.3.0.0
/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2002.libgfortran.bz2
/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2003.libgfortran.bz2
/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2004.libgfortran.bz2
/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2005.libgfortran.bz2
/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2006.libgfortran.bz2
/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2007.libgfortran.bz2
/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2008.libgfortran.bz2
/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2009.libgfortran.bz2
/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2010.libgfortran.bz2
/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2011.libgfortran.bz2
/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog-2012.libgfortran.bz2
/usr/share/doc/gcc48-gfortran-4.8.5/ChangeLog.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2002.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2003.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2004.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2005.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2006.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2007.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2008.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2009.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2010.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2011.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2012.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2013.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2014.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog-2015.libgfortran.bz2
/usr/share/doc/gcc64-gfortran-6.4.1/ChangeLog.libgfortran.bz2
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/checksum_data
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/checksum_type
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/command_line
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/from_repo
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/from_repo_revision
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/from_repo_timestamp
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/installed_by
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/origin_url
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/reason
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/releasever
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/var_awsdomain
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/var_awsregion
/var/lib/yum/yumdb/l/026361e2155744084a6e78c42b24e94624d1838d-libgfortran-6.4.1-1.45.amzn1-x86_64/var_uuid

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.

@kevinushey, thanks for the response. As suggested I installed fortran yum package, but still getting the same issue as before.

$which gfortran
/usr/bin/gfortran

$gfortran --version
GNU Fortran (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)