motiwari / BanditPAM

BanditPAM C++ implementation and Python package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error: ‘class arma::Mat<float>’ has no member named ‘n_alloc’

rolshoven opened this issue · comments

Hello everyone

I wanted to install BanditPAM on Windows first, but I was not able to succeed, so I tried it on Windows Subsystem for Linux. I do not have the LLVM problem anymore that I had on Windows but now I have the following error:

error: ‘class arma::Mat<float>’ has no member named ‘n_alloc’

I tried installing BanditPAM using pip install banditpam as well as cloning the repository and building the carma headers from source and installing BanditPAM locally. Does anyone know how to fix this? The error is in file headers/carma/include/carma_bits/numpytoarma.h on line 133. I guess it could be a problem with CARMA.

Thank you in advance!

Edit: I was able to solve it by changing the line 133 in the mentioned file as follows:

Before: arma::access::rw(dest.n_alloc) = nelem

After: arma::access::rw(dest.n_elem) = nelem

I am not 100% sure if this is correct but it seems to be the only attribute of matrix dest that makes sense (see the documentation). I will make a pull request in the CARMA repository. In the meanwhile, I hope this issue is useful for other people that encounter the same problem.

Thank you for the fix and PR to CARMA, @rolshoven ! I've added information to the Windows install guide.

Strangely, looking at the blames for the calls to n_alloc in CARMA (1, 2), it looks like those calls were added a long time ago, so I'm not quite sure why they're erroring now; I suspect this is something specific to Windows Subsystem for Linux. Do you mind providing your environment details, such as versions of WinSL, Windows, python, cmake, and compiler? I'll put it on my list to investigate further

Thank you for the fix and PR to CARMA, @rolshoven ! I've added information to the Windows install guide.

Strangely, looking at the blames for the calls to n_alloc in CARMA (1, 2), it looks like those calls were added a long time ago, so I'm not quite sure why they're erroring now; I suspect this is something specific to Windows Subsystem for Linux. Do you mind providing your environment details, such as versions of WinSL, Windows, python, cmake, and compiler? I'll put it on my list to investigate further

I closed the PR because it seems to be a version problem. I had installed libarmadillo-dev using apt install, unaware of the fact that it was not the newest version and it also did not comply with the version requirements stated in your readme. Sorry for the confusion! After downloading the latest stable version of Armadillo and compiling it from source, also the pip install banditpam worked.