batchelor icon indicating copy to clipboard operation
batchelor copied to clipboard

Installation error for R 4.0.0. Redhat 7.4

Open as7a5 opened this issue 4 years ago • 1 comments

I get the following error. I appreciate your help:

  • installing source package ‘BiocNeighbors’ ... ** using staged installation ** libs g++ -std=gnu++11 -I"/gpfs/share/apps/R/4.0.0/lib64/R/include" -DNDEBUG -I'/gpfs/share/apps/R/4.0.0/lib64/R/library/Rcpp/include' -I'/gpfs/share/apps/R/4.0.0/lib64/R/library/RcppAnnoy/include' -I'/gpfs/share/apps/R/4.0.0/lib64/R/library/RcppHNSW/include' -I/usr/local/include -fpic -g -O2 -c RcppExports.cpp -o RcppExports.o g++ -std=gnu++11 -I"/gpfs/share/apps/R/4.0.0/lib64/R/include" -DNDEBUG -I'/gpfs/share/apps/R/4.0.0/lib64/R/library/Rcpp/include' -I'/gpfs/share/apps/R/4.0.0/lib64/R/library/RcppAnnoy/include' -I'/gpfs/share/apps/R/4.0.0/lib64/R/library/RcppHNSW/include' -I/usr/local/include -fpic -g -O2 -c annoy.cpp -o annoy.o In file included from annoy.cpp:1:0: annoy.h:33:63: error: wrong number of template arguments (4, should be 5) typedef AnnoyIndex<Index_t, Data_t, Distance, Kiss64Random> _index; ^ In file included from annoy.h:17:0, from annoy.cpp:1: /gpfs/share/apps/R/4.0.0/lib64/R/library/RcppAnnoy/include/annoylib.h:845:9: note: provided for ‘template<class S, class T, class Distance, class Random, class ThreadedBuildPolicy> class AnnoyIndex’ class AnnoyIndex : public AnnoyIndexInterface<S, T, ^~~~~~~~~~ annoy.cpp: In constructor ‘Annoy<Distance>::Annoy(int, const string&, double)’: annoy.cpp:7:9: error: request for member ‘load’ in ‘((Annoy<Distance>)this)->Annoy<Distance>::obj’, which is of non-class type ‘Annoy<Distance>::_index {aka int}’ obj.load(fname.c_str()); ^~~~ annoy.cpp: In member function ‘MatDim_t Annoy<Distance>::get_nobs() const’: annoy.cpp:16:16: error: request for member ‘get_n_items’ in ‘((const Annoy<Distance>)this)->Annoy<Distance>::obj’, which is of non-class type ‘const _index {aka const int}’ return obj.get_n_items(); ^~~~~~~~~~~ annoy.cpp: In member function ‘void Annoy<Distance>::find_nearest_neighbors(CellIndex_t, NumNeighbors_t, bool, bool)’: annoy.cpp:44:9: error: request for member ‘get_nns_by_item’ in ‘((Annoy<Distance>)this)->Annoy<Distance>::obj’, which is of non-class type ‘Annoy<Distance>::_index {aka int}’ obj.get_nns_by_item(c, K + 1, get_search_k(K + 1), &kept_idx, dptr); // +1, as it forgets to discard 'self'. ^~~~~~~~~~~~~~~ annoy.cpp: In member function ‘void Annoy<Distance>::find_nearest_neighbors(const double, NumNeighbors_t, bool, bool)’: annoy.cpp:86:9: error: request for member ‘get_nns_by_vector’ in ‘((Annoy<Distance>*)this)->Annoy<Distance>::obj’, which is of non-class type ‘Annoy<Distance>::_index {aka int}’ obj.get_nns_by_vector(holding.data(), K, get_search_k(K), &kept_idx, dptr); ^~~~~~~~~~~~~~~~~ make: *** [annoy.o] Error 1 ERROR: compilation failed for package ‘BiocNeighbors’
  • removing ‘/gpfs/share/apps/R/4.0.0/lib64/R/library/BiocNeighbors’ ERROR: dependency ‘BiocNeighbors’ is not available for package ‘scater’
  • removing ‘/gpfs/share/apps/R/4.0.0/lib64/R/library/scater’ ERROR: dependencies ‘BiocNeighbors’, ‘scater’ are not available for package ‘batchelor’
  • removing ‘/gpfs/share/apps/R/4.0.0/lib64/R/library/batchelor’

as7a5 avatar Dec 18 '20 16:12 as7a5

I'm guessing you're still on BioC 3.11. Looks like LTLA/BiocNeighbors#17; scroll down to the bottom for the solution.

If you're on BioC 3.12 or higher (check with library(BiocManager)), just update your packages.

LTLA avatar Dec 18 '20 16:12 LTLA