hexbin
hexbin copied to clipboard
Error with package loading
Hi, I was trying to install the Hexbin but came across this error. It is compiled successfully, but unable to be loaded. Is there any way to overcome this?
> install.packages('hexbin')
Installing package into ‘/home/kirant/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/hexbin_1.27.2.tar.gz'
Content type 'application/x-gzip' length 491560 bytes (480 KB)
==================================================
downloaded 480 KB
* installing *source* package ‘hexbin’ ...
** package ‘hexbin’ successfully unpacked and MD5 sums checked
** libs
gfortran -fpic -g -O2 -fstack-protector-strong -c hbin.f -o hbin.o
gfortran -fpic -g -O2 -fstack-protector-strong -c hcell.f -o hcell.o
gfortran -fpic -g -O2 -fstack-protector-strong -c herode.f -o herode.o
gfortran -fpic -g -O2 -fstack-protector-strong -c hsm.f -o hsm.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c reg.c -o reg.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o hexbin.so hbin.o hcell.o herode.o hsm.o reg.o -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
installing to /home/kirant/R/x86_64-pc-linux-gnu-library/3.4/hexbin/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘hexbin’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/kirant/R/x86_64-pc-linux-gnu-library/3.4/hexbin/libs/hexbin.so':
libgfortran.so.4: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/kirant/R/x86_64-pc-linux-gnu-library/3.4/hexbin’
The downloaded source packages are in
‘/tmp/Rtmp2whtdX/downloaded_packages’
Warning message:
In install.packages("hexbin") :
installation of package ‘hexbin’ had non-zero exit status
My sessionInfo() is:
> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.6 LTS
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=ru_RU.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=ru_RU.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=ru_RU.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=ru_RU.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.4 tools_3.4.4
See #8.
I solved this by installing gcc-fortran on Manjaro. Error was similar:
gfortran -fno-optimize-sibling-calls -fpic -g -O2 -c hbin.f -o hbin.o
make: gfortran: No such file or directory
make: *** [/usr/lib64/R/etc/Makeconf:191: hbin.o] Error 127
ERROR: compilation failed for package ‘hexbin’
* removing ‘/home/mundo/R/x86_64-pc-linux-gnu-library/3.6/hexbin’
this might be the answer for ubuntu 16.06 https://stackoverflow.com/questions/46516394/how-to-install-libgfortran-so-4-on-ubuntu-16-06/46516499