Registered Member
|
I am getting bad_alloc with std::map<string, MatrixXd> under Cygwin (GCC4.3.4). The following code fragment works fine on MacOSX (GCC 4.2.1) and MSVC2010, but not Cygwin (GCC 4.3.4).
I also tried using the aligned_allocator in http://eigen.tuxfamily.org/dox/TopicStlContainers.html even though this is only for fixed types, but still get the problem. Any help appreciated. Thanks. |
Moderator
|
That's a very strange issue. For dynamic size matrices such as MatrixXd there should not be any alignment trouble. Nevertheless, you could try to use:
Matrix<double,Dynamic,Dynamic,DontAlign> as your matrix type. If that works for you, you could try to use that type only for the std::map object to see if the issue really comes from the use of std::map or not. |
Registered Member
|
Thanks. I tried this. It compiles OK, but I still get the bad_alloc exception. Does that mean it is some issue unrelated to alignment?
|
Moderator
|
hm bad_alloc means you are running out of memory. Perhaps a memory leak?
|
Registered Member
|
It took a while, but I found out that the following code will work/not work depending on compiler options:
If -msse2 is included in the compiler options then a bad_alloc will occur. Using Eigen 3.0.0 on Windows XP using Cygwin (g++ 4.3.4). I am building the cmake tests now to see if any failures occur. Should I submit this to the Dashboard (or do you only want latest source builds there)? I don't see Xcode (gcc 4.2.1) or cygwin builds on the dashboard. I may be able to regularly run & submit these tests if you are interested (depending on build & run times). Please let me know. Thanks. |
Registered Member
|
All tests pass with default ctest options.
Setting -DEIGEN_TEST_SSE2=ON results in 32 failures:
|
Registered Member
|
Added bug 277 (http://eigen.tuxfamily.org/bz/show_bug.cgi?id=277).
|
Registered users: Bing [Bot], Evergrowing, Google [Bot], q.ignora, watchstar