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

Error installing uwot into R-4.3.3 of centos-7.9 #125

Open
dfgao opened this issue May 23, 2024 · 1 comment
Open

Error installing uwot into R-4.3.3 of centos-7.9 #125

dfgao opened this issue May 23, 2024 · 1 comment

Comments

@dfgao
Copy link

dfgao commented May 23, 2024

Error while installing uwot:

install.packages("~/uwot_0.2.1.tar.gz", repos = NULL, type = "source")

then
`using staged installation
** libs
using C++ compiler: ‘g++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)’
g++ -std=gnu++11 -I"/opt/R/4.3.3/lib/R/include" -DNDEBUG -I../inst/include/ -I'/data/00.software/R/4.3.3/library/dqrng/include' -I'/data/00.software/R/4.3.3/library/Rcpp/include' -I'/data/00.software/R/4.3.3/library/RcppAnnoy/include' -I'/data/00.software/R/4.3.3/library/RcppProgress/include' -I/usr/local/include -DRCPP_NO_RTTI -fpic -g -O2 -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/opt/R/4.3.3/lib/R/include" -DNDEBUG -I../inst/include/ -I'/data/00.software/R/4.3.3/library/dqrng/include' -I'/data/00.software/R/4.3.3/library/Rcpp/include' -I'/data/00.software/R/4.3.3/library/RcppAnnoy/include' -I'/data/00.software/R/4.3.3/library/RcppProgress/include' -I/usr/local/include -DRCPP_NO_RTTI -fpic -g -O2 -c connected_components.cpp -o connected_components.o
g++ -std=gnu++11 -I"/opt/R/4.3.3/lib/R/include" -DNDEBUG -I../inst/include/ -I'/data/00.software/R/4.3.3/library/dqrng/include' -I'/data/00.software/R/4.3.3/library/Rcpp/include' -I'/data/00.software/R/4.3.3/library/RcppAnnoy/include' -I'/data/00.software/R/4.3.3/library/RcppProgress/include' -I/usr/local/include -DRCPP_NO_RTTI -fpic -g -O2 -c nn_parallel.cpp -o nn_parallel.o
g++ -std=gnu++11 -I"/opt/R/4.3.3/lib/R/include" -DNDEBUG -I../inst/include/ -I'/data/00.software/R/4.3.3/library/dqrng/include' -I'/data/00.software/R/4.3.3/library/Rcpp/include' -I'/data/00.software/R/4.3.3/library/RcppAnnoy/include' -I'/data/00.software/R/4.3.3/library/RcppProgress/include' -I/usr/local/include -DRCPP_NO_RTTI -fpic -g -O2 -c perplexity.cpp -o perplexity.o
g++ -std=gnu++11 -I"/opt/R/4.3.3/lib/R/include" -DNDEBUG -I../inst/include/ -I'/data/00.software/R/4.3.3/library/dqrng/include' -I'/data/00.software/R/4.3.3/library/Rcpp/include' -I'/data/00.software/R/4.3.3/library/RcppAnnoy/include' -I'/data/00.software/R/4.3.3/library/RcppProgress/include' -I/usr/local/include -DRCPP_NO_RTTI -fpic -g -O2 -c r_uwot.cpp -o r_uwot.o
r_uwot.cpp: In member function ‘std::unique_ptruwot::Optimizer UmapFactory::create_optimizer(Rcpp::List)’:
r_uwot.cpp:137:19: error: ‘make_unique’ is not a member of ‘std’
return std::make_uniqueuwot::Adam(alpha, beta1, beta2, eps,
^~~~~~~~~~~
r_uwot.cpp:137:19: note: ‘std::make_unique’ is defined in header ‘’; did you forget to ‘#include ’?
r_uwot.cpp:31:1:
+#include

r_uwot.cpp:137:19:
return std::make_uniqueuwot::Adam(alpha, beta1, beta2, eps,
^~~~~~~~~~~
r_uwot.cpp:137:41: error: expected primary-expression before ‘>’ token
return std::make_uniqueuwot::Adam(alpha, beta1, beta2, eps,
^
r_uwot.cpp:145:19: error: ‘make_unique’ is not a member of ‘std’
return std::make_uniqueuwot::Sgd(alpha);
^~~~~~~~~~~
r_uwot.cpp:145:19: note: ‘std::make_unique’ is defined in header ‘’; did you forget to ‘#include ’?
r_uwot.cpp:145:40: error: expected primary-expression before ‘>’ token
return std::make_uniqueuwot::Sgd(alpha);
^
make: *** [/opt/R/4.3.3/lib/R/etc/Makeconf:198:r_uwot.o] error 1
ERROR: compilation failed for package ‘uwot’

  • removing ‘/data/00.software/R/4.3.3/library/uwot’``

installing older version:
install.packages("~/uwot_0.1.15.tar.gz", repos = NULL, type = "source")

then

`** using staged installation
** libs
using C++ compiler: ‘g++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)’
g++ -std=gnu++11 -I"/opt/R/4.3.3/lib/R/include" -DNDEBUG -I../inst/include/ -I'/data/00.software/R/4.3.3/library/Rcpp/include' -I'/data/00.software/R/4.3.3/library/RcppProgress/include' -I'/data/00.software/R/4.3.3/library/RcppAnnoy/include' -I'/data/00.software/R/4.3.3/library/dqrng/include' -I/usr/local/include -DRCPP_NO_RTTI -fpic -g -O2 -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/opt/R/4.3.3/lib/R/include" -DNDEBUG -I../inst/include/ -I'/data/00.software/R/4.3.3/library/Rcpp/include' -I'/data/00.software/R/4.3.3/library/RcppProgress/include' -I'/data/00.software/R/4.3.3/library/RcppAnnoy/include' -I'/data/00.software/R/4.3.3/library/dqrng/include' -I/usr/local/include -DRCPP_NO_RTTI -fpic -g -O2 -c connected_components.cpp -o connected_components.o
g++ -std=gnu++11 -I"/opt/R/4.3.3/lib/R/include" -DNDEBUG -I../inst/include/ -I'/data/00.software/R/4.3.3/library/Rcpp/include' -I'/data/00.software/R/4.3.3/library/RcppProgress/include' -I'/data/00.software/R/4.3.3/library/RcppAnnoy/include' -I'/data/00.software/R/4.3.3/library/dqrng/include' -I/usr/local/include -DRCPP_NO_RTTI -fpic -g -O2 -c nn_parallel.cpp -o nn_parallel.o
In file included from nn_parallel.cpp:6:
nn_parallel.h:92:3: error: ‘AnnoyIndex’ does not name a type; did you mean ‘Annoy’?
AnnoyIndex<typename UwotAnnoyDistance::S, typename UwotAnnoyDistance::T,
^~~~~~~~~~
Annoy
nn_parallel.h: In constructor ‘NNWorker::NNWorker(const string&, const std::vector&, std::size_t, std::size_t, std::size_t)’:
nn_parallel.h:101:65: error: class ‘NNWorker’ does not have any field named ‘index’
idx(nrow * n_neighbors, -1), dists(nrow * n_neighbors), index(ncol) {
^~~~~
nn_parallel.h:102:11: error: overloaded function with no contextual type information
index.load(index_name.c_str());
^~~~
nn_parallel.h: In destructor ‘NNWorker::~NNWorker()’:
nn_parallel.h:105:23: error: overloaded function with no contextual type information
~NNWorker() { index.unload(); }
^~~~~~
nn_parallel.h: In member function ‘void NNWorker::operator()(std::size_t, std::size_t)’:
nn_parallel.h:117:13: error: overloaded function with no contextual type information
index.get_nns_by_vector(fv.data(), n_neighbors, search_k, &result,
^~~~~~~~~~~~~~~~~
make: *** [/opt/R/4.3.3/lib/R/etc/Makeconf:198:nn_parallel.o] error 1
ERROR: compilation failed for package ‘uwot’

  • removing ‘/data/00.software/R/4.3.3/library/uwot’`

I tried to use gcc8.3.1, gcc9.3.1 and gcc10.2.1 to install every version after uwot-v0.1.10, but they all failed.

how can i solve this problem 😭

@jlmelville
Copy link
Owner

The compiler needs to be using at least C++14, but the std=gnu++11 says you are getting only C++11. Try adding CXX_STD=CXX14 to your ~/.R/Makevars file.

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