无法在OpenSUSE Leap 15.2上安装arm和lme4软件包

4

我正在使用预装了 R v3.5.0OpenSUSE Leap 15.2 操作系统。除了安装 rstudio 之外,我不需要安装任何软件包。

以下是安装详细信息:

> 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

我在安装两个需要进行分析的软件包armlme4时遇到了困难。 我也顺利地安装了我所需的ggplot2软件包。

无论是从RStudio图形界面还是从R命令行(在终端内)中,我都会收到许多错误信息,我无法解释......

我尝试了法国的各种软件源,但问题仍然存在。 请注意,从Windows 10操作系统安装这两个软件包很顺利。

安装输出最终显示:

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’

我发现很多关于Eigen的错误行,比如这样:

../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]’

我找不到如何将完整的安装输出导出到文件中,因此无法在此处提供更多详细信息...

非常感谢您提前的帮助和建议!

Thomas

-- 编辑 --

为了完善我的问题:

  1. 我在虚拟机(通过VirtualBox)上安装了Ubuntu Focal Fossa(21),软件包安装没有任何问题...

  2. 我尝试安装小的依赖包 minqa,并得到以下输出:

enter image description here

我可以看到其他错误消息,例如 make: gfortran: command not found,这可能有所帮助....

-- 编辑 --

我成功导出了 arm 软件包安装尝试的输出。请注意,这是从我在OpenSUSE系统上安装的R版本4.1.0完成的(请参见评论):

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

几点评论:(1)这与lme4没有直接关系,我认为它是上游问题(例如RcppEigen);(2)如果在控制台中运行install.packages(“RcppEigen”),您是否会获得更完整的输出和/或指向错误日志的指针? (find /tmp -mmin -5是否找到有用的内容?)(3)这是一个非常旧的R版本;不幸的是,我立即没有看到为OpenSUSE构建的更新的RPM源(这里有一个目录[here](https://cran.r-project.org/bin/linux/suse/),但README文件为空且过时;请参见其他发行版的更完整选项https://cran.r-project.org/bin/linux/) - Ben Bolker
感谢@BenBolker的帮助!安装RcppEigen包也中止了。有很多错误信息,看起来非常像我尝试安装armlme4时得到的那些...以root身份运行命令find /tmp -mmin -5返回一行:/tmp(?)。 - wiltomap
我不太确定如何给你建议;我想帮助你找到错误日志,但是如果没有办法(轻松地)在我的系统上使软件包安装失败,那么很难记住/尝试。您是否已安装标准开发工具(makegccg++等)?也许可以使用 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
标准开发工具已全部安装。我尝试了建议的 zypper in... 命令,但这些并没有带来任何解决方案。我刚刚编辑了我的帖子以添加更多细节。再次感谢! - wiltomap
1
到目前为止有几个问题:(1)你被要求重新安装Rcpp,你尝试过了吗?(2)请查看@SamRogers有关缺少libjpeg的评论;(3)你是否已经为你的系统安装了gfortran - Ben Bolker
3个回答

3
根据我的经验,Unix 上的这些错误通常源于缺少外部库。例如,安装 R 中的 xml2 包需要通过系统包管理器(即 R 外部)安装 libxml2-dev,否则安装将失败。
我不会读法语,但看起来依赖项 jpeg 失败了,因为缺少外部 jpeg 库,然后一切都从那里开始级联。您可以尝试安装某个版本的 libjpeg 库。我知道它预装在 Ubuntu 上,这可能是为什么对您起作用的原因。我有点惊讶它在 OpenSUSE 上没有预先安装,但我没有使用过 OpenSUSE。

2
在答案/评论中有很多好的建议,但即使我遵循了所有建议,仍然遇到了几个问题。
以下是我用于在OpenSuse Leap 15.2 VM(https://www.osboxes.org/opensuse/)上成功安装R v3.5.0的lme4和arm的步骤:
  • 下载并安装R(v3.5.0)和所需的编译相关软件
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

注:此处涉及IT技术相关内容,建议在翻译时注意专业术语的准确性和易懂性。
install.packages("~Downloads/latticeExtra_0.6-26.tar.gz", repos = NULL)
install.packages("nloptr")
install.packages("Hmisc")
install.packages("lme4")
install.packages("arm")
  • 要安装其他必需的软件包,请在https://cran.r-project.org/src/contrib/Archive/上找到与Rv3.5.0兼容的存档版本,并本地安装(例如:install.packages("~Downloads/latticeExtra_0.6-26.tar.gz", repos = NULL))。

1
完美的解决方案...非常感谢!我只需要安装ednlopt-devel软件包,其他软件包已经存在。我找不到gfortran软件包,所以我保留了已经安装的libgfortran4。然后,R软件包的安装成功运行。只是对于Hmisc有警告,但这并没有禁用安装。最终我可以使用library()函数在R中加载软件包!再次感谢,也感谢所有花时间关注此问题并给我留言的人们。 - wiltomap
不用谢 - 这个问题并不容易解决 - 感谢您在问题中包含了所有必要的细节。 - jared_mamrot

2
从lme4软件包页面:
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

我猜您需要安装Eigen C++库,您可以在这里找到方法here。这更有可能是因为rcppeigen无法安装。我建议先安装Eigen,然后再安装rcppeigen和glue,然后尝试安装其他出现错误的包。

好主意,但我认为这不正确。RcppEigen 包含了 Eigen 的相关部分。 - Ben Bolker
1
没错,但我不排除其他库在系统上搜索Eigen,如果找不到就中止安装的可能性。我希望他缺少某个CPP库,安装Eigen至少会给我们更多的提示。 - kana
不是不可能,但我对此表示怀疑。从目前的情况来看,有几个更可能的阻碍因素:jpeg R软件包需要系统libjpeg(导致arm无法安装),以及minqa R软件包需要gfortran(导致lme4无法安装)。 (远程系统管理员的调试工作很有趣...) - Ben Bolker
1
将在gfortran上的赌注加倍,因为该库会导致许多R软件包错误(意味着过去的头痛)。用户,请给我们更多信息! - kana
1
感谢大家的评论!最终我卸载并重新从OpenSUSE 15.2的官方仓库安装了R(这意味着R v3.5.0)。我安装了eigen3-devel包,但找不到建议使用的eigen3。然后我重新启动了R并尝试重新安装arm。我收到以下错误:../libtool: line 1102: ERROR:: command not found。似乎安装了更多的R包,但仍然无法满足我所需的armlme4... - wiltomap
我会尝试一些组合,首先安装opensuse libtool,然后是libjpeg和gfortran,如果出现错误:由于rstudio的依赖关系无法安装,请安装这些依赖项,也许我们会得到更多信息。 - kana

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接