Installing OpenMx package in R on Ubuntu 18.04LTS

787 Views Asked by At

I get the following error when trying to install (install.packages("OpenMx")) OpenMx in R on Ubuntu 18.04. I am not familiar with compiling C code, so I ask that you "dumb it down" for me a bit.

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’

Update 1

It looks like the error may actual be a result of the RcppEigen package not being installed. When I try to install the package I get 10,000 lines of error messages. Here's the first:

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 }; };

Update 2

I got RcppEigen successfully installed, but OpenMx still will not compile. The only error is at the end of a very long (thousands of lines) stream of compilation warnings. The error: ERROR: compilation failed for package 'OpenMx'

1

There are 1 best solutions below

7
On

Something is wrong here, and you are not helping by showing only partial output.

For starters, the package clearly depends on other binary packages but you did not tell us if those are installed, or not. If you had earlier errors you did not show then you, simply put, have no chance of installing OpenMX.

So I would do the following: ensure that all packages from the link above and under Imports: and LinkingTo: are installed. Test that by loading them one by one R via, eg, library(Rcpp).

If and when all requirements are met, then attempt installing OpenMX, and update your questions will relevant error messages, if any. But in short the comment above about the libeigen3-dev package is completely misleading as RcppEigen does not use that package.

Lastly, the r-sig-debian list is friendly and patient and a place for Debian/Ubuntu questions.

Edit: Based on OP's edit, one shortcut maybe to sudo apt-get install r-cran-rcppeigen.