Dear Rcpp Developer List subscribers, I am experimenting with OpenMP on Rcpp. Here is a simple program I'm trying to run on my (4-core MacBookPro 8,3, Intel Cor i7, 2.3 GHz) computer (clang-omp compiler):
#include <RcppArmadillo.h> #include <math.h> #ifdef _OPENMP #include <omp.h> #endif #include<map> #include<vector> #include<random> //[[Rcpp::plugins(openmp)]] //[[Rcpp::depends(RcppArmadillo)]] using namespace Rcpp; using namespace arma; // [[Rcpp::export]] void nof(int nn_thrds) { omp_set_num_threads(nn_thrds); #pragma omp parallel for for(int i = 0; i < 100; i++) { #pragma omp critical { Rcout << i << std::endl; } } } /***R nof(2) */ PROBLEMS: 1. (Minor): Diagnostics message use of undeclared identifier omp_set_num_threads, 2. (Major): The program terminates the R session with R Session Aborted R encountered a fatal error The session was terminated Sometimes I receive the messages Error C stack is too close to the limit Error during wrapup: C stack usage is too close to the limit Type Error: 'null' is not an object (evaluating 'c[a]') I use RStudio 0.99.893 QUESTIONS: 1. What is going on? 2. Is there any legible description of such error messages on the Internet?--I mean, they seem way too cryptic to me... Thank you in advance. Anguel
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel