This forum has been archived. All content is frozen. Please use KDE Discuss instead.

fatal error: no member named 'isfinite' in namespace 'std'

Tags: isfinite, macros isfinite, macros isfinite, macros
(comma "," separated)
TSC21
Registered Member
Posts
3
Karma
0
Hi there,

I'm trying to integrate the newest Eigen lib version into the PX4 Autopilot project (https://github.com/PX4/Firmware). The current repo being used is in https://github.com/PX4/eigen/, being the 3.2.5 branch pretended to be used (https://github.com/PX4/eigen/tree/3.2.5).

But I'm facing the following problem. When compiling the specific code for a POSIX build, I get the following:
Code: Select all
In file included from /home/nuno/dev_px4/update_eigen/Firmware/src/systemcmds/tests/test_eigen.cpp:41:
In file included from /home/nuno/dev_px4/update_eigen/Firmware/src/lib/px4_eigen.h:49:
In file included from /home/nuno/dev_px4/update_eigen/Firmware/src/lib/eigen/Eigen/Core:302:
/home/nuno/dev_px4/update_eigen/Firmware/src/lib/eigen/Eigen/src/Core/MathFunctions.h:790:11: fatal error: no member named 'isfinite' in namespace 'std'; did you mean '::Eigen::numext::isfinite'?
    using std::isfinite;
          ^~~~~~~~~~~~~
          ::Eigen::numext::isfinite
/home/nuno/dev_px4/update_eigen/Firmware/src/lib/eigen/Eigen/src/Core/MathFunctions.h:787:7: note: '::Eigen::numext::isfinite' declared here
bool (isfinite)(const T& x)

I took a look at MathFunctions.h and it seems like that std::isfinite is only used when EIGEN_HAS_CXX11_MATH is set. So to check how to set it I wen to Macros.h, but checking if the necessary macros for setting this up are also set to up to is kinda difficult.

The makefile toolchain configurations for the project are in https://github.com/PX4/Firmware/blob/ma ... _native.mk.

Can anyone help me figure out the problem in here? Thanks in advance!

Note: here's an output of the built with more verbosity: http://pastebin.com/wfUWBZ4P
TSC21
Registered Member
Posts
3
Karma
0
The problem was solved by adding
Code: Select all
#include <cmath>
at the beginning of the eigen test code.

But now some other error appears and it's related to this:
Compiling a build for an ARM platform that issues a test code for eigen, I get the following error:
Code: Select all
In file included from /home/nuno/dev_px4/update_eigen/Firmware/Build/px4fmu-v2_test.build/nuttx-export/include/math.h:52:0,
                 from /home/nuno/dev_px4/update_eigen/Firmware/Build/px4fmu-v2_test.build/nuttx-export/include/cxx/cmath:46,
                 from /home/nuno/dev_px4/update_eigen/Firmware/src/systemcmds/tests/test_eigen.cpp:41:
/home/nuno/dev_px4/update_eigen/Firmware/src/lib/eigen/Eigen/src/Core/MathFunctions.h: In function 'bool Eigen::numext::isfinite(const std::complex<_Tp>&)':
/home/nuno/dev_px4/update_eigen/Firmware/Build/px4fmu-v2_test.build/nuttx-export/include/arch/math.h:166:11: error: expected unqualified-id before '(' token
           (__extension__ ({int __cy = fpclassify(__y); \
           ^
/home/nuno/dev_px4/update_eigen/Firmware/src/lib/eigen/Eigen/src/Core/MathFunctions.h:824:18: note: in expansion of macro 'isfinite'
   return numext::isfinite(numext::real(x)) && numext::isfinite(numext::imag(x));
                  ^
compilation terminated due to -Wfatal-errors.
make[2]: *** [test_eigen.cpp.o] Error 1

Is there anyway of solving this. Seems like the macros used by Eigen are not compatibles with the ones used on newlib for arm. For my understanding, there must be incompatibilities.
TSC21
Registered Member
Posts
3
Karma
0
First problem solved with: https://bitbucket.org/eigen/eigen/commi ... at=default

Second problem supposedly is solved with: https://bitbucket.org/eigen/eigen/pull-requests/132/ so I'll be waiting for the PR to fix it. Anyhow, the workaround was to add #define EIGEN_MAX_STATIC_ALIGN_BYTES 16 in the header which was calling the Eigen headers.

Thanks Christoph Hertzberg!

Best regards,
N.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
TSC21 wrote:The problem was solved by adding
Code: Select all
#include <cmath>
at the beginning of the eigen test code..


Very strange. cmath is included by the Eigen/Core header.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Any update on this one? The isfinite issue has been solved a while back, but I don't understand the link with EIGEN_MAX_STATIC_ALIGN_BYTES or the PR 132?


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora