Registered Member
|
Any idea why this code crashes (debug mode):
while commenting the line
fixes it? I'm using eigen 3.1.0, latest SuiteSparse and vs2010. Thanks |
Moderator
|
please, could you paste a backtrace.
(Note that your matrix is singular, and it cannot be used for solving, so umfpack should report an error) |
Registered Member
|
I believe umfpack can usually solve a singular system without a problem. In this case that's not my point, and you can assign any matrix (besides zeros) that you want. There's something wrong here with the compilation or linkage when I add the matrix vector. It took me hours to find this bug, and the matrix vector was actually defined in a separate module.
Here is the error and the stack trace, For the old SuiteSparse version 3.4.0:
The new SuiteSparse version 4.0.1 which needs also:
gives:
I wonder, does this code run well on your computer? |
Moderator
|
very strange, there is clearly a linking issue. I cannot reproduce the error with gcc or clang, and cannot try it with MSVC (no windows around). What's "stdafx.h" btw? Something specific to MSVC? What if you remove it? What if you link to umfpack libs the standard way?
|
Registered Member
|
XXXXing A!
Pardon my French. The stdafx.h is just some MS nonsense called precompiled header, which I just removed. But linking the libraries manually did the trick! Hours spent and I would never have thought about it. How did you even come up with the idea? |
Registered Member
|
First I would like to thank @ggael for the inspired solution.
Second I am still pursuing the reason for the problem and how the solution resolved it. Currently for me adding the libraries as an input to the linker explicitly through the project options instead of through #pragma lib as a solution, is the same as someone would have told me to run visual studio from the link in the start menu instead of the link on the desktop, and it would have resolved the problem. An info that my be relevant: 1. The libraries were build with mingw gcc. 2. I wrote the code on the 13th of this month, almost in a full moon... |
Moderator
|
|
Registered Member
|
|
Registered Member
|
I'm afraid that salvation won't come from the VC++ forum. Just look at the link above, I think that the forum has been run by experiments of AI bots.
Anyway I have something even more annoying. I can't reproduce the bug. Suddenly everything is fine when I use the pragma lib, and I have no idea why or what changed. Maybe it's related to restarting windows (which would be even more annoying), although I think that in my desperation I did try this one. |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot]