lundi 7 février 2022

How do I resolve error with clang when install R package?

I was trying to use devtool to install a R package,

devtools::install_github("haimbar/SEMMS")

But it says there are some problem with

clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:48:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/armadillo:23:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/armadillo_bits/compiler_check.hpp:72:4: error: "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo"
  #error "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo"
   ^
In file included from RcppExports.cpp:4:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:48:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/armadillo:87:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include/armadillo_bits/arma_forward.hpp:152:12: error: unknown type name 'constexpr'
    static constexpr bool is_row  = false;
           ^`

I think it is about the clang version but don't know how to fix it.

Aucun commentaire:

Enregistrer un commentaire