Skip to content
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

problem in 'make' #50

Open
biopolyhedron opened this issue Feb 24, 2021 · 2 comments
Open

problem in 'make' #50

biopolyhedron opened this issue Feb 24, 2021 · 2 comments

Comments

@biopolyhedron
Copy link

biopolyhedron commented Feb 24, 2021

Dear gabraham,

I downloaded flashpca2 using git clone as mentioned in README.md , and installed Eigen 3.3.9 and Spectra as instructed without problem. Then I entered flashpca/ folder, changed the including folders of eigen, boost and spectra in Makefile and then 'make', then I got these error informations (too long, I just copy the first and last few lines):

~/Downloads/flashpca$ make
g++ -I/usr/local/include/Spectra -I/usr/local/include/boost -I/usr/local/include/eigen3 -march=native -std=c++0x -O3 -DNDEBUG -DVERSION=\"2.1\" -funroll-loops -ftree-vectorize -ffast-math -c randompca.cpp -o randompca.o
randompca.cpp: In member function ‘void RandomPCA::pca_fast(Eigen::MatrixXd&, unsigned int, unsigned int, unsigned int, double, long int, bool)’:
randompca.cpp:133:16: error: ‘LARGEST_ALGE’ is not a member of ‘Spectra’
  133 |       Spectra::LARGEST_ALGE, SVDWide> eigs(&op, ndim, ndim * 2 + 1);
      |                ^~~~~~~~~~~~
randompca.cpp:133:16: error: ‘LARGEST_ALGE’ is not a member of ‘Spectra’
randompca.cpp:133:37: error: wrong number of template arguments (3, should be at least 0)
  133 |       Spectra::LARGEST_ALGE, SVDWide> eigs(&op, ndim, ndim * 2 + 1);
      |                                     ^
In file included from randompca.h:23,
                 from randompca.cpp:11:
/usr/local/include/Spectra/SymEigsSolver.h:134:7: note: provided for ‘template<class OpType> class Spectra::SymEigsSolver’
  134 | class SymEigsSolver : public SymEigsBase<OpType, IdentityBOp>
      |       ^~~~~~~~~~~~~
randompca.cpp:133:67: error: expression list treated as compound expression in initializer [-fpermissive]
  133 |       Spectra::LARGEST_ALGE, SVDWide> eigs(&op, ndim, ndim * 2 + 1);
      |                                                                   ^
randompca.cpp:135:9: error: request for member ‘init’ in ‘eigs’, which is of non-class type ‘int’
  135 |    eigs.init();
      |         ^~~~
randompca.cpp:136:9: error: request for member ‘compute’ in ‘eigs’, which is of non-class type ‘int’
  136 |    eigs.compute(maxiter, tol);
      |         ^~~~~~~
randompca.cpp:144:12: error: request for member ‘info’ in ‘eigs’, which is of non-class type ‘int’
  144 |    if(eigs.info() == Spectra::SUCCESSFUL)
      |            ^~~~
randompca.cpp:144:31: error: ‘SUCCESSFUL’ is not a member of ‘Spectra’
  144 |    if(eigs.info() == Spectra::SUCCESSFUL)
      |                               ^~~~~~~~~~
randompca.cpp:146:16: error: request for member ‘eigenvectors’ in ‘eigs’, which is of non-class type ‘int’
  146 |       U = eigs.eigenvectors();
      |                ^~~~~~~~~~~~
randompca.cpp:148:16: error: request for member ‘eigenvalues’ in ‘eigs’, which is of non-class type ‘int’
  148 |       d = eigs.eigenvalues().array() / div;
      |                ^~~~~~~~~~~
randompca.cpp:164:43: error: request for member ‘info’ in ‘eigs’, which is of non-class type ‘int’
  164 |      + ", status: " + std::to_string(eigs.info()));
      |                                           ^~~~
randompca.cpp: In member function ‘void RandomPCA::pca_fast(Data&, unsigned int, unsigned int, unsigned int, double, long int, bool)’:
randompca.cpp:174:44: error: ‘LARGEST_ALGE’ is not a member of ‘Spectra’
  174 |    Spectra::SymEigsSolver<double, Spectra::LARGEST_ALGE,
      |                                            ^~~~~~~~~~~~
...
...
...
randompca.cpp:186:31: error: ‘SUCCESSFUL’ is not a member of ‘Spectra’
  186 |    if(eigs.info() == Spectra::SUCCESSFUL)
      |                               ^~~~~~~~~~
randompca.cpp:188:16: error: request for member ‘eigenvectors’ in ‘eigs’, which is of non-class type ‘int’
  188 |       U = eigs.eigenvectors();
      |                ^~~~~~~~~~~~
randompca.cpp:190:16: error: request for member ‘eigenvalues’ in ‘eigs’, which is of non-class type ‘int’
  190 |       d = eigs.eigenvalues().array() / div;
      |                ^~~~~~~~~~~
randompca.cpp:216:43: error: request for member ‘info’ in ‘eigs’, which is of non-class type ‘int’
  216 |      + ", status: " + std::to_string(eigs.info()));
      |                                           ^~~~
make: *** [Makefile:54: randompca.o] Error 1

What could I do for fixing it? Thank you!
polyhedron

@yixuan
Copy link
Contributor

yixuan commented Mar 19, 2021

There is a major update to Spectra recently, and the code in the master branch is not compatible with older versions. You can download the v0.9.0 version instead.

@biopolyhedron
Copy link
Author

There is a major update to Spectra recently, and the code in the master branch is not compatible with older versions. You can download the v0.9.0 version instead.

Thank you, the installation works now with Spectra v0.9.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants