problem installing nloptr 2.0.0 on debian 9 with R 4.2.0 and cmake 3.23.1 - r

on my machine debian 9 (stretch), i have installed R4.2.0 from source.
i have problem to install nloptr 2.0.0 using syntax:
if (!require("nloptr", quietly = TRUE)) BiocManager::install("nloptr")
the error i get is:
/opt/R/4.2.0/lib/R/etc/Makeconf:177: recipe for target 'test-C-API.o' failed
make: *** [test-C-API.o] Error 1
ERROR: compilation failed for package ‘nloptr’
* removing ‘/home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr’
The downloaded source packages are in
‘/tmp/Rtmpqk35gk/downloaded_packages’
Warning message:
In install.packages(...) :
installation of package ‘nloptr’ had non-zero exit status
I have tried, also, to install it by copying compiled binaries i have found online, but then i have this error:
> library(nloptr)
Error: package or namespace load failed for ‘nloptr’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr/libs/nloptr.so':
/home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr/libs/nloptr.so: invalid ELF header
I have checked the header and machine info, but i dont know what to do next:
base) root#kanta:/home/ezop/R/x86_64-pc-linux-gnu-library/4.2# file /home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr/libs/nloptr.so
/home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr/libs/nloptr.so: Mach-O 64-bit x86_64 dynamically linked shared library, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|WEAK_DEFINES|BINDS_TO_WEAK|NO_REEXPORTED_DYLIBS|HAS_TLV_DESCRIPTORS>
(base) root#kanta:/home/ezop/R/x86_64-pc-linux-gnu-library/4.2# uname -a
Linux kanta 4.9.0-18-amd64 #1 SMP Debian 4.9.303-1 (2022-03-07) x86_64 GNU/Linux

I was having the same problem a few minutes ago. I tried installing cmake and gfortran but with little success. I noticed, when I was trying install.packages("nloptr") for the last time, this error message: There are binary versions available but the source versions are later. Do you want to install from sources the package which needs compilation?.
Jenny Bryan explains here that a simple "No" would do.
I hope this is useful for you too.

Related

How to install edgeR package using R4.2.0, BiocManager?

I tried to install edgeR with the following:
if (!require("BiocManager", quietly = TRUE)); install.packages("BiocManager"; BiocManager::install("edgeR")
This is the message I got
Bioconductor version 3.15 (BiocManager 1.30.18), R 4.2.0 (2022-04-22)
Installing package(s) 'edgeR' Warning: unable to access index for
repository
https://bioconductor.org/packages/3.15/bioc/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/bioc/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Warning: unable to access index for repository
https://bioconductor.org/packages/3.15/data/annotation/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/data/annotation/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Warning: unable to access index for repository
https://bioconductor.org/packages/3.15/data/experiment/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/data/experiment/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Warning: unable to access index for repository
https://bioconductor.org/packages/3.15/workflows/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/workflows/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Warning: unable to access index for repository
https://bioconductor.org/packages/3.15/books/bin/macosx/big-sur-arm64/contrib/4.2:
cannot open URL
'https://bioconductor.org/packages/3.15/books/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Package which is only available in source form, and may need
compilation of C/C++/Fortran: ‘edgeR’
Do you want to attempt to install these from sources? (Yes/no/cancel)
so I pressed yes, then,i got the warning message
ld: warning: directory not found for option
'-L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1'
ld: warning: directory not found for option
'-L/opt/R/arm64/gfortran/lib' ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see
invocation) make: *** [edgeR.so] Error 1 ERROR: compilation failed for
package ‘edgeR’
removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/edgeR’
The downloaded source packages are in
‘/private/var/folders/kt/6_fbqvnx7p94hxygb7x6qbnc0000gr/T/RtmpG39FBI/downloaded_packages’
Warning message: In install.packages(...) : installation of package
‘edgeR’ had non-zero exit status
Please advise on what I should to fix this problem.
As a Macbook pro (Monterey) M1 user, I re-installed R package (R-4.2.0.pkg), and removed the old package (R-4.2.0-arm64.pkg). This allowed me to use BiocManager to install other packages.
I'm also on an Apple Silicon Mac. I had assorted previous R installs via homebrew and others. Removing all existing R installations (check via Terminal with 'which R') then reinstalling from a fresh download of the arm64 build did the trick.

How to fix Error installing RCurl on Mac OS X from source: 'curl/curl.h' file not found

Trying to reinstall RCurl from source so it can support sftp (having just installed libssh2 using homebrew):
install.packages("RCurl", type = "source")
I then get:
In file included from base64.c:1:
./Rcurl.h:4:10: fatal error: 'curl/curl.h' file not found
#include <curl/curl.h>
^~~~~~~~~~~~~
1 error generated.
make: *** [base64.o] Error 1
ERROR: compilation failed for package ‘RCurl’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/RCurl’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/RCurl’
Warning in install.packages :
installation of package ‘RCurl’ had non-zero exit status
I've tried Googling and looking on StackOverflow and there are plenty of threads on Debian, Linux, Ubuntu and Windows and none on Mac OS X hence this post.
Any ideas? Please help.

loading failed in installing R package fdaPDE from github

Good morning,
I am trying to install the R package fdaPDE from GitHub repository "NegriLuca/fdaPDE-manifold" via RStudio1.4, using the package devtools. My OS is Windows 10, I am using Rtools35 and R3.5.1. The package has to be compiled from source. I have typed the following:
install.packages('devtools')
library(devtools)
install_github("NegriLuca/fdaPDE-manifold")
and got the following:
[… I omit the long compilation part …]
** building package indices
** testing if installed package can be loaded
*** arch - i386
Error: package or namespace load failed for 'fdaPDE'inlibrary.dynam(lib, package, package.lib):
DLL 'fdaPDE' not found: maybe not installed for this architecture?
Errore: loading failed
Esecuzione interrotta
*** arch - x64
Error: package or namespace load failed for 'fdaPDE' in library.dynam(lib, package, package.lib):
DLL 'fdaPDE' not found: maybe not installed for this architecture?
Errore: loading failed
Esecuzione interrotta
ERROR: loading failed for 'i386', 'x64'
* removing 'C:/Users/Gianmaria/Documents/R/win-library/3.5/fdaPDE'
In R CMD INSTALL
Error in i.p(...) :
(converted from warning) installation of package ‘C:/Users/GIANMA~1/AppData/Local/Temp/RtmpwDxgqJ/file466865be7d8c/fdaPDE_0.1-5.tar.gz’ had non-zero exit status
What can I do to fix this?
I have finally managed to install the package. What I did was the following:
-REMOVE previous installations (I had supposed that to be done automatically but it was not, and I had an older version installed) by typing in Rstudio
remove.packages("fdaPDE")
-In Windows cmd, after having downloaded the code from Github, type
"Path/to/Rfolder/R" CMD BUILD <path to folder fdaPDE>
"Path/to/Rfolder/R" CMD INSTALL -l <path name of the R library tree> <path name of the package to be installed>
Hope that this may be useful for other people who faces similar errors.

Errors during installation of R dependencies after new R installation on Ubuntu 18.04

System: Ubuntu 18.04
Original error that showed up that prompted me to try to reinstall R and dependencies:
Error: package or namespace load failed for 'lubridate' in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/usr/local/lib/R/site-library/stringi/libs/stringi.so': libicui18n.so.57: cannot open shared object file: No such file or directory
Steps to reproduce:
Install R: apt install r-base
Try to install R dependencies: install.packages(c("dplyr", "lubridate", "qcc", "forecast"), repos='http://cran.us.r-project.org')
Error that displays during installation:
/usr/local/lib/R/site-library/BH/include/boost/smart_ptr/scoped_ptr.hpp:74:31: warning: 'template<class> class std::auto_ptr' is deprecated
Error that displays after installation:
The downloaded source packages are in
'/tmp/RtmpnulsEe/downloaded_packages'
Warning message:
In install.packages(c("dplyr", "lubridate", "qcc", "forecast", "stringi"), :
installation of package 'forecast' had non-zero exit status
After purging and reinstalling r-base and R dependencies, I'm seeing this...(already checked that libcurl4-openssl-dev was latest version):
Error: package or namespace load failed for 'forecast' in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/local/lib/R/site-library/curl/libs/curl.so':
/usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /usr/local/lib/R/site-library/curl/libs/curl.so)
Update: Apparently it's something in the forecast library, because I reproduced that error like this:
$ R
> library(forecast)
Error: package or namespace load failed for 'forecast' in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/local/lib/R/site-library/curl/libs/curl.so':
/usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /usr/local/lib/R/site-library/curl/libs/curl.so)
Your original problem is that stringi was built against a distro package version of libicu which changed. As this distribution package does not know you have lubridate in /usr/local it changes and breaks things.
There are a number of ways to fix this. The easiest (and narrowest) is to make sure you have libicu-dev installed. You could then reinstall (ie: rebuild stringi) after which lubridate will load.
For the rest you are just going somewhat wild throwing everything that is moveable up against the wall. You need to take a moment to realize that you can either install all these as binaries (ie from the Michael Rutter PPAs at launchpad), or from source. Your call. I have an older answer explaining the difference here (as well as in other follow-ups here) and we help on the r-sig-debian list too.
But in short: read this README at CRAN (esp first few paragraphs) and consider the PPAs.
After trying the following (purging and reinstalling R between each step):
apt purge r-base
Added/removed several different PPAs before realizing none of them supported Bionic Beaver. Result: Release not found.
Found Michael Rutter's PPA and attempted to use that. Result: same error message from above ('CURL_OPENSSL_3' not found).
Attempting several solutions to this SO article. Result: same error message from above ('CURL_OPENSSL_3' not found).
Read this article and performed the following in R:
> remove.packages("curl")
> install.packages("curl")
> install.packages(c("dplyr", "lubridate", "qcc", "forecast", "stringi", "curl"), repos='http://cran.us.r-project.org')
And everything worked as intended.

R packages: RCurl and curl packages install failure on Linux

I hope you can help with this issue I have come across whilst installing RCurl and curl packages for R.
Rd warning: /tmp/RtmpOBkvFC/R.INSTALLd07e6c06faf4/RCurl/man/url.exists.Rd:5: missing file link ‘file.exists’
** building package indices
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/majaidi/R/x86_64-redhat-linux-gnu-library/3.1/RCurl/libs/RCurl.so':
/lib64/libgssapi_krb5.so.2: symbol krb5int_buf_len, version krb5support_0_MIT not defined in file libkrb5support.so.0 with link time reference
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/majaidi/R/x86_64-redhat-linux-gnu-library/3.1/RCurl’
The downloaded source packages are in
‘/tmp/RtmpX6poG4/downloaded_packages’
Warning message:
In install.packages(pkgs = pkgs, lib = lib, repos = repos, ...) :
installation of package ‘RCurl’ had non-zero exit status`
That looks like that you have different versions of libcurl.
One approch could be the following one (for your console):
wget https://cran.r-project.org/src/contrib/curl_0.9.7.tar.gz
R CMD INSTALL curl_0.9.7.tar.gz --no-test-load
ldd /home/majaidi/R/x86_64-redhat-linux-gnu-library/3.1/curl/libs/curl.so
Then you can use ldd libcurl.so to find all dependencies and shared libraries to this.
Perhaps you can find some errors and/or you have to create a new LD_LIBRARY_PATH.
Good Luck!
J_F

Resources