Registered Member
|
I am new to Eigen and trying to learn how to use the svd function.
My code is as follows:
The code compiles and when it runs it reports the matrix A. But then the program crashes, without giving any specific error message. Can someone help me with what I am doing wrong. MinGW c++ compiler Code::Blocks IDE |
Moderator
|
hm, probably a stack alignement issue with mingw. Which versions are you using (mingw and eigen)? The backtrace would also help a lot. Also make sure you did not compiled with -DNDEBUG (to keep runtime assertions).
You might also try with -DEIGEN_DONT_ALIGN_STATICALLY. If that helps, then that's for sure a stack alignment issue. In that case, -mstackrealign and -mpreferred-stack-boundary=4 might help. |
Registered Member
|
Using Code:Blocks version 13.12
MInGW version 1.8 here is the compiler line: mingw32-g++.exe -Wall -fexceptions -g -march=corei7-avx -Wundef -Wfloat-equal -Winline -Wmain -pedantic -std=c++11 -Wall -g -IC:\CodeBlocks\MinGW\include -IC:\GnuWin32\include -IC:\Eigen -c I tried adding -DEIGEN_DONT_ALIGN_STATICALLY but it made no difference. For what it is worth, I can get this to run properly if I change MatrixXf to Matrix3d (every place it appears) and start with a manually (not randomly) input 3d matrix.
But why this works and the original version does not is a mystery. It is suggesting that cannot use dynamically sized matrices, which is what I want to be able to do. I would like a function that can SVD a 4x7 matrix as easily as it will a 3x3 matrix. |
Registered Member
|
I've got this figured out.
I had my code set to compile with Intel Core i7 optimization. I turned off that compiler flag and now everything seems to be running just fine. While that seems to have solved my immediate SVD problem, does anyone know why that optimization conflicts with Eigen? Does anyone know of any other compiler optimizations that should be avoided when using Eigen?? |
Moderator
|
A backtrace would help, and also, which Eigen version are you using?
|
Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]