<font color='black' size='2' face='arial'><font size="2">Dear Rcpp development list members,<br>
<br>
I am trying to use OpenMP with Rcpp.  The code (placed in omp_experiment.cpp file) is pretty basic:<br>
<br>
#include <RcppArmadillo.h><br>
#include <omp.h><br>
<br>
//[[Rcpp::plugins(openmp)]]<br>
//[[Rcpp::depends(RcppArmadillo)]]<br>
using namespace Rcpp;<br>
<br>
// [[Rcpp::export]]<br>
int timesTwo(int x) {<br>
   return x * 2;<br>
}<br>
<br>
<br>
<br>
Once I try to compile the file I get the error output<br>
<br>
clang: warning: argument unused during compilation: '-fopenmp'<br>
omp_experiment.cpp:2:10: fatal error: 'omp.h' file not found<br>
#include <omp.h><br>
         ^<br>
1 error generated.<br>
make: *** [omp_experiment.o] Error 1<br>
clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include  -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/RcppArmadillo/include" -I"/Users/anguelgrigorov/Documents/Business/MISO/R/Functions/Trading/Experiments"   -fopenmp  -fPIC  -Wall -mtune=core2 -g -O2  -c omp_experiment.cpp -o omp_experiment.o<br>
Error in Rcpp::sourceCpp("Documents/Business/MISO/R/Functions/Trading/Experiments/omp_experiment.cpp") : <br>
  Error 1 occurred building shared library.<br>
<br>
<b>My QUESTION: How to configure OpenMP to work with Rcpp on my system?</b><br>
<br>
I am working with RStudio, version 0.98.945 on Mac OS X Mavericks.<br>
<br>
Every insight into this will be highly appreciated.<br>
<br>
Thank you very much in advance.<br>
<br>
Anguel<br>
<br>
<br>
P.S. I've done some reading on the Internet that advised me to check whether omp.h is even available on my laptop (MacBook Pro).  I have used OS X <br>
        locate "omp.h" command that proved that omp.h is indeed available in 4 locations:<br>
<br>
/usr/local/Cellar/gcc/5.3.0/lib/gcc/5/gcc/x86_64-apple-darwin13.2.0/5.3.0/include/omp.h<br>
/usr/local/Cellar/gcc6/6-20160124/lib/gcc/6/gcc/x86_64-apple-darwin13.2.0/6.0.0/include/omp.h<br>
/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/include/omp.h<br>
/usr/local/lib/gcc/x86_64-apple-darwin13.1.0/4.9.0/include/omp.h<br>
</font>
</font>