Difficulty installing hdf5r - r

I'm trying to install a package on Bioconductor called "Herper" and it requires "hdf5r" to be updated. I'm trying to update using compilation to get the most recent version of this package. Previously, I had issues with finding the hdf5 library but was able to rectify this by first installing hdf5 using homebrew and then using the following code to specify the location of the hdf5 library.
install.packages("hdf5r", configure.args = "--with-hdf5=/opt/homebrew/Cellar/hdf5/1.12.2_2/bin/h5cc")
Now I'm getting a new error where R is trying to find the object 'hdf5r.so'.
Here is where I believe things start going wrong:
ld: warning: ignoring file /opt/homebrew/Cellar/hdf5/1.12.2_2/lib/libhdf5_hl.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/Cellar/hdf5/1.12.2_2/lib/libhdf5.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
installing to /Library/Frameworks/R.framework/Versions/4.2/Resources/library/00LOCK-hdf5r/00new/hdf5r/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘hdf5r’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/00LOCK-hdf5r/00new/hdf5r/libs/hdf5r.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.2/Resources/library/00LOCK-hdf5r/00new/hdf5r/libs/hdf5r.so, 0x0006): symbol not found in flat namespace (_H5P_CLS_ATTRIBUTE_CREATE_ID_g)
Error: loading failed
Execution halted
ERROR: loading failed
I'm quite new to coding, so I believe the 00LOCK folders are temporary folders? Because I cannot find the path that R is searching for. Let me know if you guys have any solutions to this!
Cheers,
G

Related

Cannot install vroom under R.4.0.5 on HPC node

To install another package that depends on vroom (which failed) on a HPC node, I sought to install vroom manually.
I tried to install the package manually but it fails too:
My code:
install.packages("vroom")
error message:
installing to /home/leuph1/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-vroom/00new/vroom/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘vroom’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/leuph1/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-vroom/00new/vroom/libs/vroom.so':
/home/leuph1/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-vroom/00new/vroom/libs/vroom.so: undefined symbol: __cxa_init_primary_exception
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/leuph1/R/x86_64-pc-linux-gnu-library/4.0/vroom’
Warning in install.packages :
installation of package ‘vroom’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpgPcp9Y/downloaded_packages’
I have tried under different R versions (3.5.3 up to 4.1.1) but keep having the same issue no matter what version I chose.
I have also deleted any 00LOCK-"package-name" folder that might have arisen in the process in the corresponding R Version package folder, but to no avail.
Can anybody help me out here?
Many thanks in advance,
Philibertus88

Trouble Installing qdap package into R

I want to install "qdap" package to run a text mining project. I tried installing the package in many different ways:
1. intsall.packages("qdap")
2. Downloading the file locally then installing
3. Using devtools
library(devtools)
install_github("trinker/qdapDictionaries")
install_github("trinker/qdapRegex")
install_github("trinker/qdapTools")
install_github("trinker/qdap")
I always had the same problem. It seems to be related to rJava package. I tried to install rJava but I wasn't successful.
I'm more of a data analyst than a developer so I don't have much experience with development (using terminal commands or fixing java on my mac).
I'd really like to use this "qdap" package. Could you please help me figure out in a simple manner?
Here's the error message after I install the package:
The downloaded source packages are in
‘/private/var/folders/hk/r0tjy0t57n79lvkh2_fc7snm0000gn/T/RtmpsSJ6Mg/downloaded_packages’
✓ checking for file ‘/private/var/folders/hk/r0tjy0t57n79lvkh2_fc7snm0000gn/T/RtmpsSJ6Mg/remotes42b1730aa4f/trinker-qdap-7f390f7/DESCRIPTION’ (437ms)
─ preparing ‘qdap’: (1.1s)
✓ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts (1.3s)
─ checking for empty or unneeded directories
Removed empty directory ‘qdap/tools’
─ looking to see if a ‘data/datalist’ file should be added
─ building ‘qdap_2.4.2.tar.gz’
* installing *source* package ‘qdap’ ...
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Warning in system("/usr/libexec/java_home", intern = TRUE) :
running command '/usr/libexec/java_home' had status 1
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so
Reason: image not found
ERROR: lazy loading failed for package ‘qdap’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/qdap’
Error: Failed to install 'qdap' from GitHub:
(converted from warning) installation of package ‘/var/folders/hk/r0tjy0t57n79lvkh2_fc7snm0000gn/T//RtmpsSJ6Mg/file42b3e031f25/qdap_2.4.2.tar.gz’ had non-zero exit status
Maybe the key is in the following
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
and
Warning in system("/usr/libexec/java_home", intern = TRUE) :
running command '/usr/libexec/java_home' had status 1
Are you sure you have installed a JVM? And if yes, the correct one? Because it seems to not find it.
You can download JVM from here.
I hope this helps!

Can't install package 'Liszt' (not in CRAN) in R 3.6.3

I want to install a package that is not found in CRAN.
Below is a downloadlink to the package.
The package makes use of JAGS, of which i have the 64 bit 4.3.0 version of.
rjags and r2jags packages are installed. Rtools is connected to the pathway. I checked this using
Sys.which("make")
## "C:\\rtools40\\usr\\bin\\make.exe"
Connection to path was done with devtools from this Stacklink:
How to add Rtools\bin to the system path in R
I use the following code to install the downloaded .tar.gz package:
install.packages("C:/Program Files/R/R-3.6.3/Liszt_0.8-5_1.tar.gz", repos=NULL,
type="source")
The package won't installl, instead i get the following error:
* installing *source* package 'Liszt' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'Liszt'
finding HTML links ... done
A3ModelFun html
A5ModelFun html
Caterpillar html
LL html
Liszt-package html
extract html
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
Error: package or namespace load failed for 'rjags':
.onLoad failed in loadNamespace() for 'rjags', details:
call: fun(libname, pkgname)
error: Failed to locate any version of JAGS version 4
The rjags package is just an interface to the JAGS library
Make sure you have installed JAGS-4.x.y.exe (for any x >=0, y>=0) from
http://www.sourceforge.net/projects/mcmc-jags/files
Error : package 'rjags' could not be loaded
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/Sneve/Documents/R/win-library/3.6/Liszt'
Warning in install.packages :
installation of package ‘C:/PROGRA~1/R/R-36~1.3/Liszt_0.8-5_1.tar.gz’ had non-zero exit status
I am trying for a while no, but no success. Any help is much appreciated.
Website providing the package:
http://www.possinghamlab.org/2016-05-30-04-33-10/list-length-analysis.html
package is available here:
http://www.possinghamlab.org/images/LLA/Liszt_0.8-5_1.tar.gz
I installed the 64 Bit version of JAGS. Appearently, the package needs both the 32 and the 64 bit version installed on the PC to be able to work. After i installed also the 32 bit version of JAGS, package installed with no problem.

Why does installed "igraph" package return "libicui18n.so.58: cannot open shared object file"after loading?

I was trying to install the package igraph in R using the command install.packages("igraph"). After the installation, during testing phase it showed the following error:
testing if installed package can be loaded Error: package or namespace
load failed for ‘igraph’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object
'/home/midhun/R/x86_64-redhat-linux-gnu-library/3.5/igraph/libs/igraph.so':
libicui18n.so.58: cannot open shared object file: No such file or
directory Error: loading failed Execution halted ERROR: loading
failed
removing ‘/home/midhun/R/x86_64-redhat-linux-gnu-library/3.5/igraph’
The downloaded source packages are in
‘/tmp/RtmpLVDism/downloaded_packages’ Warning message: In
install.packages("igraph") : installation of package ‘igraph’ had
non-zero exit status
Why this is happening? What could be a solution?
The library igraph requires library files such as:
libicui18n.so.58, libicuuc.so.58, libgfortran, etc.
These were either not installed in the proper library folder or were existing as previous versions. For example, in my case, libicuuc.so.58 was required to be installed in usr/lib64. Make sure that dependencies are installed correctly to solve such problems.

R: package installation trouble in Ubuntu

I'm running on Ubuntu 16.04 (on a Lenovo ThinkPak T450). I have installed R version 3.4.1, installed by following the instructions here via Rbloggers.
From here, I would like to start installing packages, but if I run R from the command line without root privileges, I cannot access a CRAN mirror. That is, when I run install.packages('dplyr') (or any install.packages('blah')) I get the following error
--- Please select a CRAN mirror for use in this session ---
Error: .onLoad failed in loadNamespace() for 'tcltk', details:
call: fun(libname, pkgname)
error: Can't find a usable init.tcl in the following directories:
/opt/anaconda1anaconda2anaconda3/lib/tcl8.5 ./lib/tcl8.5 ./lib/tcl8.5 ./library ./library ./tcl8.5.18/library ./tcl8.5.18/library
With that error, no CRAN mirror dialog box appears and hence no installation of packages. Note: this error does not happen when I start R with root privileges (i.e., start via > sudo R), but I do not want to install packages as root.
Thanks in advance for any help you can send my way!
Edit: Specifying the repo also results in error (in the file paths below, I replaced my user-name with user-name).
E.g.: install.packages('Rcpp',repos='http://cran.us.r-project.org') terminates with:
installing to /home/user-name/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/libs
** R
** 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 ‘Rcpp’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/user-name/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/libs/Rcpp.so':
/home/user-name/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/libs/Rcpp.so: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/user-name/R/x86_64-pc-linux-gnu-library/3.4/Rcpp’
E.g., install.packages('dplyr',repos='http://cran.us.r-project.org') terminates with:
installing to /home/user-name/R/x86_64-pc-linux-gnu-library/3.4/dplyr/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/user-name/R/x86_64-pc-linux-gnu-library/3.4/bindrcpp/libs/bindrcpp.so':
/home/user-name/anaconda3/lib/R/bin/exec/../../lib/../.././libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/user-name/R/x86_64-pc-linux-gnu-library/3.4/bindrcpp/libs/bindrcpp.so)
ERROR: lazy loading failed for package ‘dplyr’
* removing ‘/home/user-name/R/x86_64-pc-linux-gnu-library/3.4/dplyr’
As pointed out by DirkEddelbuettel in the comments, the issue was a mixing of Anaconda and R. To fix this problem:
I uninstalled the R packages from Anaconda by first looking at > conda list and realizing that the package was r-base; hence running > conda remove r-base.
Next, by looking at the output of > which R, it was clear that we were still trying to execute from the ../anaconda3/bin/.. directory. I suspect there is a quick way to change this via an export or bashrc amendment (or something similar), but for me, the quickest work-around was to run > sudo apt-get install r-base r-base-dev, which took all of 0.2 seconds as they were already installed, but it did affect the directory which the system looks in to the appropriate one, for me this is /usr/bin/R/.
From here I've been able to install everything I've needed.
Note: Thinking back, I suspect the "mixing" happened when I installed rpy2 via conda.

Resources