尝试install.packages("OpenMx")
在 Ubuntu 18.04 上的 R 中安装 () 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'