[Rcpp-devel] OpenMP/Rcpp Error: C stack usage is too close to the limit

aakremena at aol.com aakremena at aol.com
Sat Mar 19 19:11:34 CET 2016

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>

using namespace Rcpp;
using namespace arma;

// [[Rcpp::export]]
void nof(int nn_thrds)
  #pragma omp parallel for
  for(int i = 0; i < 100; i++) {
    #pragma omp critical
      Rcout << i << std::endl;


    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

    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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20160319/ce58dd01/attachment.html>

More information about the Rcpp-devel mailing list