RE: [eigen] Compiling errors in Nuttx environment

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi Christoph,

Thanks for the feedback.

> Could you check if
> #define EIGEN_MAX_STATIC_ALIGN_BYTES 16
> before including Eigen works around that problem? There are some pending 
> refactorings on the vectorization logic, which should solve this issue 
> in the near future.

Yep that solved the problem. But then this a temporary solution right. Are you planning to launch a fix in the near future.

> Regarding the isfinite problem: Can you check if protecting all calls 
> and definitions of isfinite by braces solves the issue, as well?

> I.e., replace
> return numext::isfinite(numext::real(x)) &&
> numext::isfinite(numext::imag(x));
> by
> return (numext::isfinite)(numext::real(x)) &&
> (numext::isfinite)(numext::imag(x));

> etc...

It partially solved the problem. Now I get:

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/Build/px4fmu-v2_test.build/nuttx-export/include/arch/math.h:161:4: error: expected unqualified-id before 'sizeof'
  ((sizeof(__x) == sizeof(float))  ? __fpclassifyf(__x) : \
    ^
/home/nuno/dev_px4/update_eigen/Firmware/Build/px4fmu-v2_test.build/nuttx-export/include/arch/math.h:181:21: note: in expansion of macro 'fpclassify'
   #define isnan(y) (fpclassify(y) == FP_NAN)
                     ^
/home/nuno/dev_px4/update_eigen/Firmware/src/lib/eigen/Eigen/src/Core/GlobalFunctions.h:17:3: note: in expansion of macro 'isnan'
   NAME(const Eigen::ArrayBase<Derived>& x) { \
   ^
/home/nuno/dev_px4/update_eigen/Firmware/src/lib/eigen/Eigen/src/Core/GlobalFunctions.h:64:3: note: in expansion of macro 'EIGEN_ARRAY_DECLARE_GLOBAL_UNARY'
   EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(isnan,scalar_isnan_op)
   ^
compilation terminated due to -Wfatal-errors.
make[2]: *** [test_eigen.cpp..o] Error 1

Any idea? Thanks!

Best,

---
Nuno Marques
Tenente Aluno de Transmissões (Eng)

+351 912 090 991
Azambuja | Portugal

As the creation appears, the path is driven in the conscious feeling of madness and happiness, which returns, in multiple ways, to what we achieve in greatness...

Follow me in:
   

This message and any files herewith attached may contain confidential or privileged information and is intended solely for the use of the entity to which it is addressed. If you receive this message in error, please notify the sender immediately and delete this message and any files attached without copying them in any way.


> Subject: Re: [eigen] Compiling errors in Nuttx environment
> To: eigen@xxxxxxxxxxxxxxxxxxx
> From: chtz@xxxxxxxxxxxxxxxxxxxxxxxx
> Date: Fri, 14 Aug 2015 16:33:57 +0200
>
> On 14.08.2015 at 16:18, Nuno Marques wrote:
> > Hi there,
> > Update: This was a macros problem, so adding #undef to one of headers on the project that calls Eigen Core solved the first problem. But I'm still getting http://pastebin.com/bnxwa5uk.
>
> Could you check if
> #define EIGEN_MAX_STATIC_ALIGN_BYTES 16
> before including Eigen works around that problem? There are some pending
> refactorings on the vectorization logic, which should solve this issue
> in the near future.
>
> Regarding the isfinite problem: Can you check if protecting all calls
> and definitions of isfinite by braces solves the issue, as well?
>
> I.e., replace
> return numext::isfinite(numext::real(x)) &&
> numext::isfinite(numext::imag(x));
> by
> return (numext::isfinite)(numext::real(x)) &&
> (numext::isfinite)(numext::imag(x));
>
> etc...
>
> Cheers,
> Christoph
>
> Btw: It's ok to include small code snippets/error messages into mails.
> If they are slightly longer, you can alternatively attach them. Only if
> they are unreasonably long, uploading them elsewhere and linking to them
> should be preferred.
>
>
>
> >
> > ---Nuno MarquesTenente Aluno de Transmissões (Eng)
> > +351 912 090 991Azambuja | Portugal
> > As the creation appears, the path is driven in the conscious feeling of madness and happiness, which returns, in multiple ways, to what we achieve in greatness...
> > Follow me in: This message and any files herewith attached may contain confidential or privileged information and is intended solely for the use of the entity to which it is addressed. If you receive this message in error, please notify the sender immediately and delete this message and any files attached without copying them in any way.
> >
> > From: n.marques21@xxxxxxxxxxx
> > To: eigen@xxxxxxxxxxxxxxxxxxx
> > Subject: [eigen] Compiling errors in Nuttx environment
> > Date: Fri, 14 Aug 2015 14:11:48 +0100
> >
> >
> >
> >
> > Hello all and thank you for accepting me in the mailing-list.
> > I have some issues that I would like to be resolved. I'm using the latest 3.2.90 version of Eigen in a Autopilot project called PX4, which uses a Nuttx RTOS in an ARM-based uC. Compiling one of the available builds, which uses an Eigen testing code, I get the following error: http://pastebin.com/7cb2rLsW.
> > Somehow it seems that there is some kind of incompatibility between the macros on NEWLIB and Eigen. I also suspect that numext:: may causing a conflict, because if I remove this before, for example, isfinite(), is able to get through. But then, another problem appears: http://pastebin.com/bnxwa5uk. For this one, I can't seem to find the solution.
> > The compilation toolchain and flag config is as the following: http://pastebin.com/nUJK2aQB.
> > Thanks in advance!
> > Best regards,
> > ---Nuno MarquesTenente Aluno de Transmissões (Eng)
> > +351 912 090 991Azambuja | Portugal
> > As the creation appears, the path is driven in the conscious feeling of madness and happiness, which returns, in multiple ways, to what we achieve in greatness...
> > Follow me in: This message and any files herewith attached may contain confidential or privileged information and is intended solely for the use of the entity to which it is addressed. If you receive this message in error, please notify the sender immediately and delete this message and any files attached without copying them in any way.
> >
>
>
> --
> ----------------------------------------------
> Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
> Cartesium 0.049
> Universität Bremen
> Enrique-Schmidt-Straße 5
> 28359 Bremen
>
> Tel: +49 (421) 218-64252
> ----------------------------------------------
>
>


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/