4

I'm using OpenSUSE Leap 15.2 operating system together with pre-installed R v3.5.0. I did not have to install any package except rstudio.

Here are installation details:

> sessionInfo()

R version 3.5.0 (2018-04-23)
Platform: x86_64-suse-linux-gnu (64-bit)
Running under: openSUSE Leap 15.2

Matrix products: default
BLAS: /usr/lib64/R/lib/libRblas.so
LAPACK: /usr/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=fr_FR.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=fr_FR.UTF-8        LC_COLLATE=fr_FR.UTF-8    
 [5] LC_MONETARY=fr_FR.UTF-8    LC_MESSAGES=fr_FR.UTF-8   
 [7] LC_PAPER=fr_FR.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=fr_FR.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.5.0

I'm having difficulties installing two packages I need for my analysis: arm and lme4. I installed without any problem the ggplot2 package I also needed.

Either from the RStudio graphical interface or from R command line (within terminal), I get loads of errors I'm not able to interpret...

I have tried various repos in France, with the same issues. Note that the two packages installation is doing fine from a Windows 10 operating system.

The installation output end up with:

ERROR: compilation failed for package ‘RcppEigen’
* removing ‘/home/thomas/R/x86_64-suse-linux-gnu-library/3.5/RcppEigen’
Warning in install.packages :
  installation of package ‘RcppEigen’ had non-zero exit status
ERROR: dependency ‘latticeExtra’ is not available for package ‘Hmisc’
* removing ‘/home/thomas/R/x86_64-suse-linux-gnu-library/3.5/Hmisc’
Warning in install.packages :
  installation of package ‘Hmisc’ had non-zero exit status
ERROR: dependencies ‘minqa’, ‘nloptr’, ‘statmod’, ‘RcppEigen’ are not available for package ‘lme4’
* removing ‘/home/thomas/R/x86_64-suse-linux-gnu-library/3.5/lme4’
Warning in install.packages :
  installation of package ‘lme4’ had non-zero exit status
ERROR: dependencies ‘lme4’, ‘Hmisc’ are not available for package ‘arm’
* removing ‘/home/thomas/R/x86_64-suse-linux-gnu-library/3.5/arm’
Warning in install.packages :
  installation of package ‘arm’ had non-zero exit status

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

I do observe loads of error lines concerning Eigen stuff, like this:

../inst/include/Eigen/src/Core/CoreEvaluators.h:665:8:   required from ‘struct Eigen::internal::evaluator<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::Transpose<const Eigen::Block<const Eigen::Matrix<double, -1, -1>, 1, -1, false> >, const Eigen::Block<const Eigen::Transpose<const Eigen::Matrix<double, -1, -1> >, -1, 1, false> > >’
../inst/include/Eigen/src/Core/Redux.h:349:39:   required from ‘class Eigen::internal::redux_evaluator<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::Transpose<const Eigen::Block<const Eigen::Matrix<double, -1, -1>, 1, -1, false> >, const Eigen::Block<const Eigen::Transpose<const Eigen::Matrix<double, -1, -1> >, -1, 1, false> > >’
../inst/include/Eigen/src/Core/Redux.h:416:17:   required from ‘typename Eigen::internal::traits<T>::Scalar Eigen::DenseBase<Derived>::redux(const Func&) const [with BinaryOp = Eigen::internal::scalar_sum_op<double, double>; Derived = Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::Transpose<const Eigen::Block<const Eigen::Matrix<double, -1, -1>, 1, -1, false> >, const Eigen::Block<const Eigen::Transpose<const Eigen::Matrix<double, -1, -1> >, -1, 1, false> >; typename Eigen::internal::traits<T>::Scalar = double]’

I can't find how to export the full installation output in a file, so I can't give more details here...

Many thanks in advance for help and suggestions!

Thomas

-- EDIT --

To complete my issue:

  1. I installed a Ubuntu Focal Fossa (21) on a Virtual Machine (via VirtualBox) and the package gets installed without any problems...

  2. I tried to install the small dependent package minqa and I get the following output:

enter image description here

I can see other error messages such as make: gfortran: command not found, which might be of any help....

-- EDIT --

I managed to export the output of arm package installation attempt. Note this is done from R version 4.1.0 I also installed on my OpenSUSE system (see comments):

thomas@localhost:~> sudo R

R version 4.1.0 (2021-05-18) -- "Camp Pontanezen"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-suse-linux-gnu (64-bit)

R est un logiciel libre livré sans AUCUNE GARANTIE.
Vous pouvez le redistribuer sous certaines conditions.
Tapez 'license()' ou 'licence()' pour plus de détails.

R est un projet collaboratif avec de nombreux contributeurs.
Tapez 'contributors()' pour plus d'information et
'citation()' pour la façon de le citer dans les publications.

Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide
en ligne ou 'help.start()' pour obtenir l'aide au format HTML.
Tapez 'q()' pour quitter R.

> install.packages(pkgs="arm", repos="http://cran.univ-lyon1.fr/")

installation des dépendances ‘jpeg’, ‘latticeExtra’, ‘lme4’, ‘Hmisc’

essai de l'URL 'http://cran.univ-lyon1.fr/src/contrib/jpeg_0.1-8.1.tar.gz'
Content type 'application/x-gzip' length 18116 bytes (17 KB)
==================================================
downloaded 17 KB

essai de l'URL 'http://cran.univ-lyon1.fr/src/contrib/latticeExtra_0.6-29.tar.gz'
Content type 'application/x-gzip' length 1292315 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

essai de l'URL 'http://cran.univ-lyon1.fr/src/contrib/lme4_1.1-27.tar.gz'
Content type 'application/x-gzip' length 3302287 bytes (3.1 MB)
==================================================
downloaded 3.1 MB

essai de l'URL 'http://cran.univ-lyon1.fr/src/contrib/Hmisc_4.5-0.tar.gz'
Content type 'application/x-gzip' length 775444 bytes (757 KB)
==================================================
downloaded 757 KB

essai de l'URL 'http://cran.univ-lyon1.fr/src/contrib/arm_1.11-2.tar.gz'
Content type 'application/x-gzip' length 79464 bytes (77 KB)
==================================================
downloaded 77 KB

* installing *source* package ‘jpeg’ ...
** package ‘jpeg’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"/usr/lib64/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection  -c read.c -o read.o
In file included from read.c:1:0:
rjcommon.h:11:10: fatal error: jpeglib.h: Aucun fichier ou dossier de ce type
 #include <jpeglib.h>
          ^~~~~~~~~~~
compilation terminated.
make: *** [/usr/lib64/R/etc/Makeconf:168: read.o] Error 1
ERROR: compilation failed for package ‘jpeg’
* removing ‘/usr/lib64/R/library/jpeg’
* installing *source* package ‘lme4’ ...
** package ‘lme4’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++14 -I"/usr/lib64/R/include" -DNDEBUG  -I'/usr/lib64/R/library/Rcpp/include' -I'/usr/lib64/R/library/RcppEigen/include' -I/usr/local/include  -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic  -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection  -c external.cpp -o external.o
g++ -std=gnu++14 -I"/usr/lib64/R/include" -DNDEBUG  -I'/usr/lib64/R/library/Rcpp/include' -I'/usr/lib64/R/library/RcppEigen/include' -I/usr/local/include  -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic  -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection  -c glmFamily.cpp -o glmFamily.o
g++ -std=gnu++14 -I"/usr/lib64/R/include" -DNDEBUG  -I'/usr/lib64/R/library/Rcpp/include' -I'/usr/lib64/R/library/RcppEigen/include' -I/usr/local/include  -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic  -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection  -c optimizer.cpp -o optimizer.o
g++ -std=gnu++14 -I"/usr/lib64/R/include" -DNDEBUG  -I'/usr/lib64/R/library/Rcpp/include' -I'/usr/lib64/R/library/RcppEigen/include' -I/usr/local/include  -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic  -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection  -c predModule.cpp -o predModule.o
g++ -std=gnu++14 -I"/usr/lib64/R/include" -DNDEBUG  -I'/usr/lib64/R/library/Rcpp/include' -I'/usr/lib64/R/library/RcppEigen/include' -I/usr/local/include  -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic  -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection  -c respModule.cpp -o respModule.o
Erreur : le package ‘Rcpp’ a été installé avant R 4.0.0 : veuillez le réinstaller, s'il-vous-plait
Exécution arrêtée
g++ -std=gnu++14 -shared -L/usr/lib64/R/lib -L/usr/local/lib64 -o lme4.so external.o glmFamily.o optimizer.o predModule.o respModule.o -L/usr/lib64/R/lib -lR
Erreur : le package ‘Rcpp’ a été installé avant R 4.0.0 : veuillez le réinstaller, s'il-vous-plait
Exécution arrêtée
installing to /usr/lib64/R/library/00LOCK-lme4/00new/lme4/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error: le chargement du package ou de l'espace de noms a échoué pour ‘Matrix’ :
le package ‘Matrix’ a été installé avant R 4.0.0 : veuillez le réinstaller, s'il-vous-plait
Erreur : le package ‘Matrix’ ne peut être chargé
Exécution arrêtée
ERROR: lazy loading failed for package ‘lme4’
* removing ‘/usr/lib64/R/library/lme4’
ERROR: dependency ‘jpeg’ is not available for package ‘latticeExtra’
* removing ‘/usr/lib64/R/library/latticeExtra’
ERROR: dependency ‘latticeExtra’ is not available for package ‘Hmisc’
* removing ‘/usr/lib64/R/library/Hmisc’
ERROR: dependencies ‘lme4’, ‘Hmisc’ are not available for package ‘arm’
* removing ‘/usr/lib64/R/library/arm’

The downloaded source packages are in
    ‘/tmp/Rtmpz1IryW/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Messages d'avis :
1: Dans install.packages(pkgs = "arm", repos = "http://cran.univ-lyon1.fr/") :
  installation of package ‘jpeg’ had non-zero exit status
2: Dans install.packages(pkgs = "arm", repos = "http://cran.univ-lyon1.fr/") :
  installation of package ‘lme4’ had non-zero exit status
3: Dans install.packages(pkgs = "arm", repos = "http://cran.univ-lyon1.fr/") :
  installation of package ‘latticeExtra’ had non-zero exit status
4: Dans install.packages(pkgs = "arm", repos = "http://cran.univ-lyon1.fr/") :
  installation of package ‘Hmisc’ had non-zero exit status
5: Dans install.packages(pkgs = "arm", repos = "http://cran.univ-lyon1.fr/") :
  installation of package ‘arm’ had non-zero exit status
wiltomap
  • 3,933
  • 8
  • 37
  • 54
  • A few comments: (1) this isn't directly `lme4`-related, I think it's upstream (e.g. `RcppEigen`); (2) if you run `install.packages("RcppEigen")` in the console do you get more complete output and/or a pointer to an error log? (Does `find /tmp -mmin -5` find anything useful?) (3) This is a very old version of R; unfortunately don't immediately see a source of more recent RPMs built for OpenSUSE (there is a directory [here](https://cran.r-project.org/bin/linux/suse/) but the README file is empty, and old; cf the more complete options for other distros https://cran.r-project.org/bin/linux/ ) – Ben Bolker May 05 '21 at 19:58
  • Thanks for help @BenBolker! The install of `RcppEigen` package aborts too. Loads of error messages strongly looking like those I get for `arm` and `lme4` attempts... The command `find /tmp -mmin -5` run as root returns one line: `/tmp` (?). – wiltomap May 06 '21 at 09:39
  • Managed to install `R v4.0.0` via this [link](https://software.opensuse.org/download.html?project=devel%3Alanguages%3AR%3Areleased&package=R-base). Same errors... – wiltomap May 06 '21 at 15:18
  • I'm not quite sure how to advise you; I'd like to help you find the error logs, but it's hard for me to remember/experiment without being to (easily) make a package installation fail on my system. Do you have standard development tools (`make`, `gcc`, `g++`, etc.) installed? Maybe `sudo zypper install gcc-c++; sudo zypper in -t pattern devel_basis` ? https://forums.opensuse.org/showthread.php/469475-How-to-install-Make-on-my-OpenSuse-11-4 https://github.com/RevolutionAnalytics/RRO/issues/190 – Ben Bolker May 06 '21 at 18:32
  • Standard development tools are all installed. I tried the suggested `zypper in...` commands but these did not bring any solution. I've just edited my post to add some more details. Thanks again! – wiltomap May 24 '21 at 12:47
  • 1
    A few things so far: (1) you're being asked to reinstall `Rcpp`; have you done/tried that? (2) See @SamRogers's comment about missing `libjpeg`; (3) have you installed `gfortran` for your system? – Ben Bolker May 29 '21 at 21:37

3 Answers3

3

In my experience, these errors on Unix often stem from missing external libraries. For example, installing the R xml2 package requires libxml2-dev to be installed via the system package manager (i.e. outside R) otherwise installation will fail.

I can't read French, but it looks to me as though the dependency jpeg failed, due to a missing external jpeg library, and then everything cascaded from there. You could try installing some version of the libjpeg library. I know it comes pre-installed in Ubuntu which may be why that worked for you. I'm a little surprised it doesn't come installed already in OpenSUSE, but I have no experience with OpenSUSE.

Sam Rogers
  • 787
  • 1
  • 8
  • 19
2

From the lme4 package page:

The core computational algorithms are implemented using the 'Eigen' C++ library for numerical linear algebra and 'RcppEigen' "glue".

https://cran.r-project.org/web/packages/lme4/index.html

I would guess you have to install the Eigen c++ library, you can find the methods here. This is more probable because rcppeigen fails to install. I'd install Eigen, then install rcppeigen and glue and then try install the other packages that you get the errors for.

kana
  • 605
  • 7
  • 12
  • Good idea, but I don't think this is right. `RcppEigen` includes the relevant bits of Eigen. – Ben Bolker May 29 '21 at 21:35
  • 1
    True, but I wouldn't put it past the other libraries to search for Eigen on the system, then abort install if not found. I'm hoping that he's missing a CPP lib somewhere and installing Eigen would at least give us more hints – kana May 29 '21 at 21:52
  • It's not impossible but I doubt it. From what I can see so far there are several more likely blockers: system `libjpeg` for the `jpeg` R package (blocking `arm` installation) and `gfortran` for the `minqa` R packages (blocking `lme4` installation). (Remote sysadmin debugging is fun ...) – Ben Bolker May 29 '21 at 21:54
  • 1
    Double the bet on gfortran as that lib causes a lot of R package errors (meaning past headaches). User, give us more information! – kana May 29 '21 at 21:59
  • 1
    Thanks to all for comments! I ended up with uninstalling and reinstalling R from official repository for OpenSUSE 15.2 (which means R v3.5.0). I installed `eigen3-devel` package which was not (couldn't find a `eigen3` as suggested by @otsu). I then relaunched R and tried to reinstall `arm`. I get the following error: `../libtool: line 1102: ERROR:: command not found`. It seems that much more R packages are installed, but still fails with `arm` and `lme4` I do need... – wiltomap May 30 '21 at 13:51
  • I'd do a combo at this point, try install opensuse libtool, then libjpeg, gfortran, and then wherever there's an error: could not install due to dependency in rstudio install those, maybe then we'll get a little more info – kana May 30 '21 at 23:41
2

Lots of good advice in the answers/comments, but even after following all the suggestions I ran into several more issues.

Here are the steps I used to successfully install lme4 and arm for R v3.5.0 on an OpenSuse Leap 15.2 VM (https://www.osboxes.org/opensuse/):

  • Download and install R (v3.5.0) and required compiling-related software
sudo zypper install R-core
sudo zypper install R-base
sudo zypper install gcc
sudo zypper install gcc-c++
sudo zypper install gfortran
sudo zypper install ed
sudo zypper install libtool
sudo zypper install nlopt-devel
install.packages("~Downloads/latticeExtra_0.6-26.tar.gz", repos = NULL)
install.packages("nloptr")
install.packages("Hmisc")
install.packages("lme4")
install.packages("arm")
  • To install other required packages, find the archived version compatible with Rv3.5.0 from https://cran.r-project.org/src/contrib/Archive/ and install locally (e.g. install.packages("~Downloads/latticeExtra_0.6-26.tar.gz", repos = NULL))
jared_mamrot
  • 22,354
  • 4
  • 21
  • 46
  • 1
    Perfect solution... Thanks so much! I just had to install `ed` and `nlopt-devel` packages, the other ones being already there. I couldn't find a `gfortran` package, so I kept the already installed `libgfortran4`. Then, installations of R packages ran successfully. Just got warnings for `Hmisc` but this did not disable install. I eventually could load the packages in R with `library()` function! Thanks again and thanks to all folks who did take some time on this issue and brought comments to me. – wiltomap Jun 03 '21 at 13:10
  • You're welcome - this was not an easy problem to solve - thanks for including all the necessary details in your question. – jared_mamrot Jun 03 '21 at 22:15