Using GCC 4.9

Posted on
No user picture. jeremymiles Joined: 12/28/2016
I'm trying to install OpenMx, but it will not compile. For reasons that are complex and that I don't fully understand, I cannot use GCC beyond version 4.9, and having investigated on this forum, I suspect that this is the reason for the failure.

I tried to download an earlier version of OpenMx to see if that solved the problem, but the earliest version on CRAN is 2.2.2, from May 2015 (last year, for now!), and this still had the problem. Is there a a way to download an earlier version which might compile with 4.9? (Or is there some other way to persuade OpenMx to compile with GCC 4.9?)

Thanks,

Jeremy

More details: the errors relate mainly to the eigen package, and say things like:
(Note that I've simplified the paths a little).

C++ compilation of rule 'OpenMx' failed (Exit 1) [forge_remote_host=ioea14].
In file included from OpenMx/OpenMx/src/omxMatrix.cpp:30:
In file included from eigen3/Eigen/MatrixFunctions:59:
Eigen/src/MatrixFunctions/MatrixLogarithm.h:334:52: error: no member named 'Options' in 'Eigen::Map, 0, Eigen::Stride<0, 0> >'
static const int Options = DerivedNestedClean::Options;

Or

In file included from OpenMx/src/omxMatrix.cpp:30:
In file included fromeigen3/Eigen/MatrixFunctions:57:
eigen3/Eigen/src/MatrixFunctions/MatrixFunction.h:415:21: error: member reference base type 'ComplexMatrix' (aka 'int') is not a structure or union
result = Cresult.real();

Replied on Fri, 12/30/2016 - 08:12
Picture of user. jpritikin Joined: 05/23/2012

We have moved to gcc 5.4. Many CRAN packages require C++11 which is not well supported by gcc until recently. Why can't you use a newer version of gcc?
Replied on Fri, 12/30/2016 - 18:05
Picture of user. AdminRobK Joined: 01/24/2014

I don't think the version of gcc is your problem. As an OpenMx developer, I routinely build the package from source using gcc 4.9.2 on my Linux/GNU system. And besides, according to the GNU Project, gcc has been fully C++11-compliant since v4.8.1.

I think maybe your compiler is confused about where to find the eigen library's headers. It should be looking in your R package library, specifically in the directory for package 'RcppEigen', but it doesn't look as though that's what's happening.

Replied on Tue, 01/03/2017 - 14:18
No user picture. jeremymiles Joined: 12/28/2016

Thanks to @jpritikin and @AdminRobK.

@jpritikin: The C compiler system we have is somewhat beyond me. We use a clang compiler which will become compatible with gcc 5.4 towards the end of the year (they say).

@AdminRobK: That is useful information - both eigen and RcppEigen here are non-standard, and code in eigen is not duplicated in RcppEigen. I'll poke around and see if I can make it find the correct headers.

Thanks again,

jeremy

Replied on Tue, 01/03/2017 - 15:04
Picture of user. jpritikin Joined: 05/23/2012

I'm not sure if it is helpful to mention, but we don't test with clang (llvm). gcc is not as hard to compile from source as you might expect. I've done it recently.