lme4 package installation in R posit workbench

I cannot install the lme4 package in either of the version of R in my r posit workbench. I get the following error that stops installing the package. Any suggestion is highly. I need the package

install.packages("lme4")
trying URL 'https://xxxxxxxxx.com/prod-cran/__linux__/centos7/latest/src/contrib/lme4_1.1-36.tar.gz'
Content type 'application/x-gzip' length 3291577 bytes (3.1 MB)
==================================================
downloaded 3.1 MB

'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://xxxxxxxxxxxx.com/prod-cran/__linux__/centos7/latest

  • installing source package ‘lme4’ ...
    ** package ‘lme4’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    using C++ compiler: ‘g++ (GCC) 7.3.1 20180712 (Red Hat 7.3.1-17)’
    g++ -std=gnu++17 -I"/insight/app/R2.3/v4.3.2/lib64/R/include" -DNDEBUG -I'/mnt/efs/home/xxxx/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I'/mnt/efs/home/xxxx/R/x86_64-pc-linux-gnu-library/4.3/RcppEigen/include' -I'/insight/app/R2.3/v4.3.2/lib64/R/library/Matrix/include' -I/usr/local/include -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic -g -O2 -c external.cpp -o external.o
    g++ -std=gnu++17 -I"/insight/app/R2.3/v4.3.2/lib64/R/include" -DNDEBUG -I'/mnt/efs/home/xxxx/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I'/mnt/efs/home/xxxx/R/x86_64-pc-linux-gnu-library/4.3/RcppEigen/include' -I'/insight/app/R2.3/v4.3.2/lib64/R/library/Matrix/include' -I/usr/local/include -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic -g -O2 -c glmFamily.cpp -o glmFamily.o
    g++ -std=gnu++17 -I"/insight/app/R2.3/v4.3.2/lib64/R/include" -DNDEBUG -I'/mnt/efs/home/xxxx/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I'/mnt/efs/home/xxxx/R/x86_64-pc-linux-gnu-library/4.3/RcppEigen/include' -I'/insight/app/R2.3/v4.3.2/lib64/R/library/Matrix/include' -I/usr/local/include -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic -g -O2 -c optimizer.cpp -o optimizer.o
    g++ -std=gnu++17 -I"/insight/app/R2.3/v4.3.2/lib64/R/include" -DNDEBUG -I'/mnt/efs/home/xxxx/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I'/mnt/efs/home/xxxx/R/x86_64-pc-linux-gnu-library/4.3/RcppEigen/include' -I'/insight/app/R2.3/v4.3.2/lib64/R/library/Matrix/include' -I/usr/local/include -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic -g -O2 -c predModule.cpp -o predModule.o
    g++ -std=gnu++17 -I"/insight/app/R2.3/v4.3.2/lib64/R/include" -DNDEBUG -I'/mnt/efs/home/xxxx/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I'/mnt/efs/home/xxxx/R/x86_64-pc-linux-gnu-library/4.3/RcppEigen/include' -I'/insight/app/R2.3/v4.3.2/lib64/R/library/Matrix/include' -I/usr/local/include -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic -g -O2 -c respModule.cpp -o respModule.o
    g++ -std=gnu++17 -shared -L/insight/app/R2.3/v4.3.2/lib64/R/lib -L/usr/local/lib64 -o lme4.so external.o glmFamily.o optimizer.o predModule.o respModule.o -L/insight/app/R2.3/v4.3.2/lib64/R/lib -lR
    installing to /mnt/efs/home/xxxx/R/x86_64-pc-linux-gnu-library/4.3/00LOCK-lme4/00new/lme4/libs
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    'getOption("repos")' replaces Bioconductor standard repositories, see
    'help("repositories", package = "BiocManager")' for details.
    Replacement repositories:
    CRAN: https://r..../prod-cran/linux/centos7/latest
    Error in dyn.load(file, DLLpath = DLLpath, ...) :
    unable to load shared object '/mnt/efs/home/xxxx/R/x86_64-pc-linux-gnu-library/4.3/nloptr/libs/nloptr.so':
    libRlapack.so: cannot open shared object file: No such file or directory
    Calls: ... asNamespace -> loadNamespace -> library.dynam -> dyn.load
    Execution halted
    ERROR: lazy loading failed for package ‘lme4’
  • removing ‘/mnt/efs/home/xxxx/R/x86_64-pc-linux-gnu-library/4.3/lme4’
    Warning in install.packages :
    installation of package ‘lme4’ had non-zero exit status

The downloaded source packages are in
‘/tmp/xxxxxxx/downloaded_packages’

The issue that you are encountering is NOT caused directly by lme4 - it is an issue in the installation of the nloptr package that for some reason cannot ind libRlapack.so. I am not sure what is causing this but I would suggest that the easiest path would be to install nloptr from source .

A complicating factor in your setup is the fact that you are using CentOS 7 which is a linux distribution that is EOL. This will make installation of nloptr a bit more challenging but you may find Installing package nloptr useful for this.

Once you have mastered installing a functional nloptr package, your lme4installation will be much more likely to succeed.

Thanks! Installing nloptr before lme4 solved my problem.”

Regards

1 Like

This topic was automatically closed 7 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.