<font color='black' size='2' face='arial'>
<div> <font size="2">Sorry,<br>
<br>
I guess James' e-mail contains some directions, albeit not for RStudio specifically. I'll try them.<br>
<br>
Thanks.<br>
<br>
Anguel<br>
</font>
</div>
<div> <br>
</div>
<div> <br>
</div>
<div style="font-family:helvetica,arial;font-size:10pt;color:black">-----Original Message-----<br>
From: aakremena <aakremena@aol.com><br>
To: krthornt <krthornt@uci.edu>; rcpp-devel <rcpp-devel@r-forge.wu-wien.ac.at><br>
Sent: Mon, Mar 14, 2016 11:45 am<br>
Subject: Re: [Rcpp-devel] fatal error: 'omp.h' file not found<br>
<br>
<div id="AOLMsgPart_2_00eef198-3abd-4ba5-9737-6ad2472cefdd">
<div class="aolReplacedBody"><font face="arial" color="black" size="2">H<font size="2">i James and Kevin,<br>
<br>
Thank you very much for the advices (I'll try James' directions shortly).<br>
<br>
But I have already installed clang-omp via<br>
<br>
$ brew install clang-omp<br>
<br>
The compiler is available at /usr/local/Library/Formula/clang-omp.rb<br>
<br>
<br>
Can I ask you for some directions as to how to configure clang-omp with RStudio (if possible), i.e. how to make R recognize clang-omp?<br>
<br>
Thank you in advance.<br>
<br>
Anguel<br>
</font>
<div> <br>
</div>
<div> <br>
</div>
<div> <br>
</div>
<div style="font-family:helvetica,arial;font-size:10pt;color:black">-----Original Message-----<br>
From: Kevin Thornton <<a href="mailto:krthornt@uci.edu">krthornt@uci.edu</a>><br>
To: <a href="mailto:rcpp-devel@lists.r-forge.r-project.org">rcpp-devel@lists.r-forge.r-project.org</a> <<a href="mailto:rcpp-devel@r-forge.wu-wien.ac.at">rcpp-devel@r-forge.wu-wien.ac.at</a>><br>
Sent: Mon, Mar 14, 2016 11:33 am<br>
Subject: Re: [Rcpp-devel] fatal error: 'omp.h' file not found<br>
<br>
<div id="AOLMsgPart_1.2_41d0a9e5-f2e8-4883-8d23-6b07f72dc42f">
<div class="aolReplacedBody">
<div dir="ltr">One may also use clang-omp from Homebrew if you wish to still use clang on OS X, but have OpenMP.
<div><br>
</div>
<div>--Kevin<br>
<br>
<div class="gmail_quote">
<div dir="ltr">On Mon, Mar 14, 2016 at 9:31 AM Balamuta, James Joseph <<a target="_blank" href="mailto:balamut2@illinois.edu">balamut2@illinois.edu</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US">
<div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Greetings and Salutations,<u></u><u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">OS X does not currently support OpenMP under the default compiler (clang). Hence, you are receiving an error as it relates to the header file not being found. For more details,
see:<u></u><u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><a target="_blank" href="https://cran.r-project.org/doc/manuals/r-release/R-exts.html%23OpenMP-support">https://cran.r-project.org/doc/manuals/r-release/R-exts.html#OpenMP-support</a><u></u><u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Support for OpenMP with clang should be arriving sometime in June after WWDC as the intel funded clang-OpenMP feature has been merged into the main clang branch. (
<a target="_blank" href="http://openmp.llvm.org/">http://openmp.llvm.org/</a> , <a target="_blank" href="https://clang-omp.github.io/">
https://clang-omp.github.io/</a> )<br>
<br>
If this is just for personal use, you may wish to set the ~/.R/Makevar information for R via:<br>
<br>
<a target="_blank" href="https://cran.r-project.org/doc/manuals/r-release/R-admin.html#OS-X-packages">https://cran.r-project.org/doc/manuals/r-release/R-admin.html#OS-X-packages</a><u></u><u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><br>
VER=-4.8 <u></u><u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">CC=gcc$(VER)<u></u><u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">CXX=</span>
<span style="font-size:11.0pt;font-family:"Calibri",sans-serif">g++$(VER)<u></u><u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">CFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion<u></u><u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">CXXFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion<u></u><u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">FLIBS=-lgfortran<u></u><u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Sincerely,<u></u><u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">JJB<u></u><u></u></span></div>
<div class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></div>
<div class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <a target="_blank" href="mailto:rcpp-devel-bounces@lists.r-forge.r-project.org">rcpp-devel-bounces@lists.r-forge.r-project.org</a> [mailto:<a target="_blank" href="mailto:rcpp-devel-bounces@lists.r-forge.r-project.org">rcpp-devel-bounces@lists.r-forge.r-project.org</a>]
<b>On Behalf Of </b><a target="_blank" href="mailto:aakremena@aol.com">aakremena@aol.com</a><br>
<b>Sent:</b> Monday, March 14, 2016 10:01 AM<br>
<b>To:</b> <a target="_blank" href="mailto:rcpp-devel@lists.r-forge.r-project.org">rcpp-devel@lists.r-forge.r-project.org</a><br>
<b>Subject:</b> [Rcpp-devel] fatal error: 'omp.h' file not found<u></u><u></u></span></div>
</div>
</div>
<div lang="EN-US">
<div>
<div class="MsoNormal"><u></u> <u></u></div>
<div class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">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</span><u></u><u></u></div>
</div>
</div>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a target="_blank" href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a rel="noreferrer" target="_blank" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a></blockquote></div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a target="_blank" href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a target="_blank" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a></div>
</font></div>
</div>
</div>
</font>