簡體   English   中英

在Ubuntu 18.04LTS上的R中安裝OpenMx軟件包

[英]Installing OpenMx package in R on Ubuntu 18.04LTS

在Ubuntu 18.04上的R中嘗試安裝( install.packages("OpenMx") )OpenMx時出現以下錯誤。 我對編譯C代碼不熟悉,因此請您為我“笨拙”一下。

Installing package into ‘/home/adam/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/OpenMx_2.12.1.tar.gz'
Content type 'application/x-gzip' length 3338967 bytes (3.2 MB)
==================================================
downloaded 3.2 MB

* installing *source* package ‘OpenMx’ ...
** package ‘OpenMx’ successfully unpacked and MD5 sums checked
NOTE: ./configure is not an autoconf generated script.
Change default C/C++ compiler and default compile flags by editing ~/.R/Makevars
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I"/home/adam/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -I"/home/adam/R/x86_64-pc-linux-gnu-library/3.5/RcppEigen/include" -I"/home/adam/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include" -I"/home/adam/R/x86_64-pc-linux-gnu-library/3.5/BH/include" -I"/home/adam/R/x86_64-pc-linux-gnu-library/3.5/rpf/include"   -fopenmp     -I. -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-i39faS/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Compute.cpp -o Compute.o
In file included from omxState.h:31:0,
                 from glue.h:23,
                 from Compute.cpp:24:
omxDefines.h:247:10: fatal error: Eigen/Core: No such file or directory
 #include <Eigen/Core>
          ^~~~~~~~~~~~
compilation terminated.
/usr/lib/R/etc/Makeconf:171: recipe for target 'Compute.o' failed
make: *** [Compute.o] Error 1
ERROR: compilation failed for package ‘OpenMx’
* removing ‘/home/adam/R/x86_64-pc-linux-gnu-library/3.5/OpenMx’
* restoring previous ‘/home/adam/R/x86_64-pc-linux-gnu-library/3.5/OpenMx’
Warning in install.packages :
  installation of package ‘OpenMx’ had non-zero exit status

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

更新1

看起來該錯誤實際上可能是由於未安裝RcppEigen軟件包導致的。 當我嘗試安裝軟件包時,我收到10,000行錯誤消息。 這是第一個:

g++  -I"/usr/share/R/include" -DNDEBUG  -I"/home/adam/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"   -I../inst/include -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-i39faS/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c RcppEigen.cpp -o RcppEigen.o
In file included from ../inst/include/Eigen/Core:392:0,
                 from ../inst/include/Eigen/Dense:1,
                 from ../inst/include/RcppEigenForward.h:30,
                 from ../inst/include/RcppEigen.h:25,
                 from RcppEigen.cpp:22:
../inst/include/Eigen/src/Core/arch/SSE/PacketMath.h:60:39: warning: ignoring attributes on template argument ‘__m128 {aka __vector(4) float}’ [-Wignored-attributes]
 template<> struct is_arithmetic<__m128>  { enum { value = true }; };

更新2

我已經成功安裝了RcppEigen ,但是OpenMx仍然無法編譯。 唯一的錯誤是在很長(數千行)的編譯警告流的結尾。 錯誤: ERROR: compilation failed for package 'OpenMx'

這里出了點問題,您僅顯示部分輸出就無濟於事。

對於初學者來說,該軟件包顯然取決於其他二進制軟件包,但您沒有告訴我們是否已安裝這些二進制軟件包 如果您有以前的錯誤,但沒有顯示出來,那么簡單地說,您就沒有安裝OpenMX的機會。

因此,我將執行以下操作:確保安裝了Imports:LinkingTo:上方和下方鏈接中的所有軟件包。 通過例如library(Rcpp)逐一加載它們來測試它們。

如果並且當滿足所有要求時,請嘗試安裝OpenMX,並更新您的問題和相關錯誤消息(如果有)。 簡而言之,以上關於libeigen3-dev軟件包的評論完全是誤導性的,因為RcppEigen不使用該軟件包。

最后, r-sig-debian列表友好而耐心,是Debian / Ubuntu問題的場所。

編輯:根據OP的編輯,一種捷徑可能是sudo apt-get install r-cran-rcppeigen

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM