Unable to install a package on R
Asked Answered
B

4

3

I'm getting an issue when I try to install Bioconductor for R. I've searched everywhere for solutions however nothing is really working for me. Please, any advice?

The downloaded binary packages are in
    /var/folders/74/y92tqhzj0l98l6syjjl7vtcr0000gn/T//RtmpNYOkbZ/downloaded_packages
Old packages: 'nlme'
Update all/some/none? [a/s/n]: 
a
Warning: unable to access index for repository https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6:
  cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
Package which is only available in source form, and may need compilation of
  C/C++/Fortran: ‘nlme’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package ‘nlme’

trying URL 'https://cran.rstudio.com/src/contrib/nlme_3.1-144.tar.gz'
Content type 'application/x-gzip' length 778660 bytes (760 KB)
==================================================
downloaded 760 KB

* installing *source* package ‘nlme’ ...
** package ‘nlme’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran  -fPIC  -Wall -g -O2  -c chol.f -o chol.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 corStruct.c -o corStruct.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 gnls.c -o gnls.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 init.c -o init.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 matrix.c -o matrix.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 nlOptimizer.c -o nlOptimizer.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 nlme.c -o nlme.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 nlmefit.c -o nlmefit.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 pdMat.c -o pdMat.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 pythag.c -o pythag.o
gfortran  -fPIC  -Wall -g -O2  -c rs.f -o rs.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 nlme.so chol.o corStruct.o gnls.o init.o matrix.o nlOptimizer.o nlme.o nlmefit.o pdMat.o pythag.o rs.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: *** [nlme.so] Error 1
ERROR: compilation failed for package ‘nlme’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/nlme’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/nlme’

The downloaded source packages are in
    ‘/private/var/folders/74/y92tqhzj0l98l6syjjl7vtcr0000gn/T/RtmpNYOkbZ/downloaded_packages’
Warning message:
In install.packages(update[instlib == l, "Package"], l, repos = repos,  :
  installation of package ‘nlme’ had non-zero exit status

I've tried to reinstall R and it didn't work.

The code I am using to install bioconductor is:

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install(version = "3.10")
Boynton answered 7/2, 2020 at 15:23 Comment(7)
I had a similar problem today and think that had something to do with CRAN. I have changed the CRAN repository to something else than the default in RStudio and it worked. Further help can be found hereStereobate
I tried changing it to a few different repositories and it still didn't seem to work :/Boynton
Can you try to install nlme alone, does this also fail? Please, also use not the default CRAN repoStereobate
I just tried installing it alone from multiple different repos and still getting the same errorBoynton
if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("nlme")Stereobate
unfortunately, the error is the same.Boynton
Look [here[(github.com/Bioconductor/BiocManager/issues/48)Stereobate
B
2

I had the same problem. This happens since I updated to R4.0. I've seen that in Mac (and maybe Windows) can be related to missing Rtools. In Linux, I tried to install the package from other mirrors (this solved my problem in the past), but no success. Finally, I realized that the initial error is "make: gfortran: No such file or directory"

Therefore, I installed gcc & gcc-fortran and that solved it!

In Manjaro, Arch linux:

pacman -S gcc
pacman -S gcc-fortran

In Debian or Ubuntu should be:

sudo apt update
sudo apt install build-essential
sudo apt-get install manpages-dev
gcc --version

Check here for more information:

Bushwhacker answered 4/6, 2020 at 3:11 Comment(2)
Finally found the solution!Frazier
Whas the gcc the solution? If so, please mark solved :) if not, can you tell us how you did it? ;) thanks!Bushwhacker
S
0

Because now the new version of Bioconductor is BiocManager, try to use this one: install.packages("BiocManager")

Sparid answered 7/2, 2020 at 15:45 Comment(1)
I use it for almost 1 yearSparid
S
0

Apparently, it is trying to install package nlme as a dependency and fails doing that. Did you try installing that one manually before installing Bioconductor ? That could give us more info on the issue.

Stanton answered 7/2, 2020 at 15:46 Comment(5)
The same way you used to install Bioconductor, depending of the interface for R you use. As a command line, you can try install.packages("nlme")Externalization
So I've tried that as well and I'm still getting the same errorBoynton
Can you tried asking R installed.packages() ? Check if nlme is there. In particular if it is, try uninstalling, then reinstalling it. uninstall.packages("nlme") install.packages("nlme")Externalization
I just did that, unfortunately the error still persists.Boynton
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0' ld: library not found for -lgfortran clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [nlme.so] Error 1 ERROR: compilation failed for package ‘nlme’ * removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/nlme’ The downloaded source packages are in ‘/private/var/folders/74/y92tqhzj0l98l6syjjl7vtcr0000gn/T/RtmpCffPiv/downloaded_packages’ Warning message: In install.packages(...) :Boynton
E
0

Just as a heads up for someone who encounters similar issue. I was presented with a choice of installing a binary or compiling from scratch. As I chose compilation option, it was failing to install nlme. However, installation of binary was successful and there was a minor version difference between the source and the binary.

Eudemonics answered 4/2, 2021 at 17:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.