New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault with armadillo v5 and up #431
Comments
First things first, I disabled the CMake warning for ARMA_64BIT_WORD in ea0d81f. Can you give me more information on what you've done? My own investigation uncovered a bug in Armadillo 5.000.0, where the symbol
I reported the problem upstream, and there will probably be a fix in the next day or so (5.000.1 probably?) I'd expect you to be encountering the same problem too, but the fact that you aren't leads me to suspect that you are compiling against Armadillo 5.000.0 but linking against an older version of libarmadillo.so (which does not have |
I also meet segmentation fault when executing
I just updated Edit: This is not related to
|
Ok, here's some more information about what I've done. I install arma 5.000.0 with
I used your update to CMakeLists.txt as referenced above, then installed mlpack with
which didn't warn about 64 bit words not being used I then compile my application with
and link with
however I still get a conflict due to word length
This happens regardless of whether I have #define ARMA_64BIT_WORD in armadillo_bits/config.hpp commented or uncommented I should note the identical process worked fine with armadillo.4.650 Inspecting the libraries
My above ld error I think was caused by compiling mlpack against a different boost from the one that was then loaded (which I've now fixed) |
If I use the mlpack binary ~/software/bin/logistic_regression however, it seems to work just fine (inspecting with ldd, the libraries are the same as my app, except mine also links libblas.so.3gf, libgfortran.so.3, liblapack.so.3gf, and libquadmath.so.0) A further bit of info, my include directive in the .cpp file is
|
Ah, I've been able to fix it! I needed to uncomment the line in armadillo_bits/config.hpp before compiling mlpack. Not sure if this is an issue specific to me, or a problem with the cmake configuration of mlpack? |
I'm assuming that you mean that for the fix, you had to uncomment Either way, something is not completely adding up for me here. Can you give me more information on your application and how I can reproduce what is going on? |
Also, Li, would you like to open a new issue for the problem you're encountering? Thanks. |
Yes, that's how I fixed it. Uncommenting that line in arma's config.hpp before running cmake/make/make install for mlpack
where x is a 200x3 arma::mat and y is a 200x1 arma::vec Otherwise I think I've put all the information I can above. I think it's an installation issue rather than the application. Perhaps the state of Installing as above, followed by such a call should reproduce the error. If it doesn't, or it is difficult to follow the exact same steps, I'm happy to close this as solved/fixed! |
The only way I can reproduce this is by failing to set So is it possible that there is a libmlpack.so hanging around somewhere still that the runtime linker is picking up on? (Your output of ldd suggests that this is not the case, since ld seems to be finding the correct libmlpack.so.) The only other possibility I have not dug further into is that you've used Intel's compiler for Armadillo but gcc for mlpack. If you use Intel's compiler for mlpack, does this change anything? |
Hmm, strange. I'm pretty sure I got rid of mlpack completely, and ldd would seem to agree. I can't figure out why we're having a difference, but perhaps it is the compiler Perhaps my installation of armadillo was incorrect too. Anyway, thanks for your help! |
As detailed here:
http://arma.sourceforge.net/docs.html#uword
Armadillo uses 64 bit word length by default when using a c++11 capable compiler. When used with mlpack this leads to errors such as
I've tried uncommenting the relevant line in include/armadillo_bits/config.hpp, and using -DARMA_64BIT_WORD when running cmake with mlpack. However when I link this version of mlpack my application immediately segfaults:
Could you provide advice on how to compile and link mlpack correctly when using the newer versions of Armadillo?
Thanks!
The text was updated successfully, but these errors were encountered: