rvalavi / blockCV

The blockCV package creates spatially or environmentally separated training and testing folds for cross-validation to provide a robust error estimation in spatially structured environments. See
https://doi.org/10.1111/2041-210X.13107
GNU General Public License v3.0
107 stars 24 forks source link

Error compiling from source due to `nndm.cpp` #37

Closed pat-s closed 1 year ago

pat-s commented 1 year ago
> sessionInfo()
R version 4.2.3 (2023-03-15)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.3.1
nndm.cpp:9:22: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
  using MatrixType = std::vector<T>;
                     ^
nndm.cpp:57:64: error: a space is required between consecutive right angle brackets (use '> >')
  const std::vector<double> Gij_vec(Rcpp::as<std::vector<double>>(Gij));
                                                               ^~
                                                               > >
nndm.cpp:17:5: error: delegating constructors are permitted only in C++11
    Lightweight_matrix(matrix.nrow(), matrix.ncol()) {
    ^~~~~~~~~~~~~~~~~~
nndm.cpp:60:30: note: in instantiation of function template specialization 'Lightweight_matrix<double>::Lightweight_matrix<Rcpp::Matrix<14> >' requested here
  Lightweight_matrix<double> X_cpp(X);

1 warning and 2 errors generated.
make: *** [nndm.o] Error 1
ERROR: compilation failed for package ‘blockCV’
rvalavi commented 1 year ago

I have a Mac and it's working fine. But I'm now checking it with rhub as well.

rvalavi commented 1 year ago

It seems that this is due to C++11 requirement that can be resolved. @iflint1 is going to fix it.

rvalavi commented 1 year ago

@pat-s can you check again now?

pat-s commented 1 year ago

Works now, thanks!