Registered Member
|
I'm trying to figure out a strange compilation/linking problem that involves Eigen.
This is my code:
for now, you can ignore the specifics as this code is targeting a particular embedded RTOS. The general idea is that I'm just doing some computations with a matrix. When I compile this file with -O1 (Os O2 and O3 give the same result for that matter), the code compiles and links fine. However, when I use -O0 the file compiles correctly, but then fails to link with:
I'm using the following CXXFLAGS:
If I remove Eigen from main.cpp the code compiles and links fine regardless of the optimization level I use. This makes me suspect that Eigen has something to do with it. Moreover, if I comment the line marked with an arrow, the code compiles and links fine as well. Does anybody have any idea? Does Eigen generate a call to abort even when compiled with NDEBUG? Anything I can try? Thanks in advance. Cheers, |
Registered Member
|
That is a pretty interesting error.
First, doesn't your RTOS provide you a minimal stdlib implementation for system calls? That would be the obvious solution. The not so obvious seems to be why there are assertions in your DNDEBUG build. I assume that assertions are the problem, because there seems to be an abort() which triggers the signal and kill(getpid()). As it doesn't happen with the optimized build, perhaps its compile time assertions? Could for example be for your constant size matrices. Perhaps EIGEN_NO_STATIC_ASSERT could help you there?
'And all those exclamation marks, you notice? Five? A sure sign of someone who wears his underpants on his head.' ~Terry Pratchett
'It's funny. All you have to do is say something nobody understands and they'll do practically anything you want them to.' ~J.D. Salinger |
Registered Member
|
Hello Andre, thanks for your response.
Unfortunately -DEIGEN_NO_STATIC_ASSERT flag didn't work. Actually looking into the asm code there is any reference to assert/abort. I can implement a simple abort(), but it should not be required. I actually suspect of a bug in Eigen. More ideas? Cheers. |
Moderator
|
that's strange. what if you only compile a matrix-vector product?
|
Registered Member
|
Hello ggael,
thanks for the response. This is the code
But I get the same linker error output. Any idea or suggestion of what is happening? |
Registered Member
|
Well, the linker specifically says: "In function `abort':", so there sure is a reference to it in the code. Is still think it could be an assertion. ggael: Is there any other way to completely disable compile-time assertions?
'And all those exclamation marks, you notice? Five? A sure sign of someone who wears his underpants on his head.' ~Terry Pratchett
'It's funny. All you have to do is say something nobody understands and they'll do practically anything you want them to.' ~J.D. Salinger |
Registered Member
|
What version of Eigen do you use btw?
'And all those exclamation marks, you notice? Five? A sure sign of someone who wears his underpants on his head.' ~Terry Pratchett
'It's funny. All you have to do is say something nobody understands and they'll do practically anything you want them to.' ~J.D. Salinger |
Moderator
|
I'm still clueless, so 2 more things to try:
1) try to compile with -DEIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD=64 2) try with VV = A.lazyProduct(V); thanks. |
Registered Member
|
Sorry for the late response,
I tried with lazyProduct and -DEIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD=64 -DEIGEN_NO_STATIC_ASSERT, and I have the same linker error mmm It is strange, because checking out the asm, there is any call to abort ?¿? If you are interested in try it out, I can attach the project and the compiler cab be downloaded from https://launchpad.net/gcc-arm-embedded |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]