1
votes

I am running R in redhat 5.9 (gcc version 4.2) and get the following compiliation error messege :


g++ -I/home/gn31131/R_downloads/R_inst/lib64/R/include -DNDEBUG -I/home/gn31131/R_downloads/R_inst/include -I/home/gn31131/R_downloads/R_inst/library/Rcpp/include -I/home/gn31131/R_downloads/R_inst/library/RcppArmadillo/include -I. -DNDEBUG -I/usr/local/include -I"/home/gn31131/R_downloads/R_inst/lib64/R/library/Rcpp/include" -I../inst/include -fpic -g -O2 -c RcppArmadillo.cpp -o RcppArmadillo.o In file included from ../inst/include/armadillo:48, from ../inst/include/RcppArmadilloForward.h:37, from ../inst/include/RcppArmadillo.h:30, from RcppArmadillo.cpp:22: ../inst/include/armadillo_bits/compiler_setup.hpp:119:6: error: #error "* Need a newer compiler *" /home/gn31131/R_downloads/R_inst/lib64/R/library/Rcpp/include/Rcpp/Date.h: In member function âvoid Rcpp::Date::update_tm()â: /home/gn31131/R_downloads/R_inst/lib64/R/library/Rcpp/include/Rcpp/Date.h:108: warning: converting to âtime_tâ from âdoubleâ /home/gn31131/R_downloads/R_inst/lib64/R/library/Rcpp/include/Rcpp/Date.h: In function âRcpp::Date Rcpp::operator+(const Rcpp::Date&, int)â: /home/gn31131/R_downloads/R_inst/lib64/R/library/Rcpp/include/Rcpp/Date.h:139: warning: converting to âtime_tâ from âdoubleâ ia64make: * [RcppArmadillo.o] Error 1 ERROR: compilation failed for package âRcppArmadilloâ * removing â/home/gn31131/R_downloads/R_inst/lib64/R/library/RcppArmadilloâ


Any help will be appreciated

1

1 Answers

6
votes

If you are stuck with gcc/g++ 4.2, you will indeed either need to upgrade the compiler, or need to downgrade RcppArmadillo to an older version. Current versions test via

#if (ARMA_GCC_VERSION < 40200) && !defined(__INTEL_COMPILER)
  #error "*** Need a newer compiler ***"
#endif

and this bites on your system.

You can access all released versions via CRAN's Archive page for the package and you may just have to try something older.

Or upgrade your OS (version). Newer RHEL/CentOS have newer compilers, but I'd actually recommend Ubuntu's LTS versions.