<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.gmail-m8767956681741296320p1, li.gmail-m8767956681741296320p1, div.gmail-m8767956681741296320p1
        {mso-style-name:gmail-m_8767956681741296320p1;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.gmail-m8767956681741296320s1
        {mso-style-name:gmail-m_8767956681741296320s1;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>It was a good suggestion. I went back to installing R 4.0 as you suggested. In Rstudio, which I think<o:p></o:p></p><p class=MsoNormal>uses whatever R happens to be currently installed, I get into<o:p></o:p></p><p class=MsoNormal>a similar rcpp issue whenever I say “y” to compiling packages from source. There seems<o:p></o:p></p><p class=MsoNormal>to be consistent disconnect of R finding certain files when compilation with<o:p></o:p></p><p class=MsoNormal>clang is required.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>…………<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include  -I/usr/local/include   -fPIC  -Wall -g -O2  -c capture.c -o capture.o<o:p></o:p></p><p class=MsoNormal>In file included from capture.c:1:<o:p></o:p></p><p class=MsoNormal>In file included from /Library/Frameworks/R.framework/Resources/include/Rinternals.h:44:<o:p></o:p></p><p class=MsoNormal>In file included from /Library/Frameworks/R.framework/Resources/include/R_ext/Arith.h:41:<o:p></o:p></p><p class=MsoNormal>In file included from /usr/local/include/math.h:8:<o:p></o:p></p><p class=MsoNormal>In file included from /usr/local/include/features.h:10:<o:p></o:p></p><p class=MsoNormal>/usr/local/include/forwards.h:10:10: fatal error: 'config.h' file not found<o:p></o:p></p><p class=MsoNormal>#include "config.h"<o:p></o:p></p><p class=MsoNormal>         ^~~~~~~~~~<o:p></o:p></p><p class=MsoNormal>1 error generated.<o:p></o:p></p><p class=MsoNormal>make: *** [capture.o] Error 1<o:p></o:p></p><p class=MsoNormal>ERROR: compilation failed for package ‘rlang’<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>………………….<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:12.0pt;color:black'>From: </span></b><span style='font-size:12.0pt;color:black'>Carl Ganz <carlganz@gmail.com><br><b>Date: </b>Sunday, May 3, 2020 at 12:04 PM<br><b>To: </b>Paul Fishwick <metaphorz@gmail.com><br><b>Cc: </b><rcpp-devel@lists.r-forge.r-project.org><br><b>Subject: </b>Re: [Rcpp-devel] Cannot run rcpp due to missing include file(s)<o:p></o:p></span></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>This is probably beyond my understanding at this point, but the solution I offered worked for me with R 4.0 and it looks like this example is R 3.6<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I vaguely remember some issues with interaction between older R version and newer Xcode 11.4.1 so moving to R 4 might help<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Sun, May 3, 2020 at 9:25 AM Paul Fishwick <<a href="mailto:metaphorz@gmail.com">metaphorz@gmail.com</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Carl<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>First, thank you for this quick tip! I had no ~/.R directory and Makevars didn’t exist when I searched<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>for it in Finder. So, I made the directdory ~/.R and then added a new file “Makevars” to that directory.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I edited this file to add your PKG_CPPFLAGS:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=gmail-m8767956681741296320p1><span class=gmail-m8767956681741296320s1>(base) <hostname>-5:.R paul$ more Makevars</span><o:p></o:p></p><p class=gmail-m8767956681741296320p1><span class=gmail-m8767956681741296320s1>PKG_CPPFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Now I get another sequence of compiler errors. I’ll include only the first several lines:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>……….<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>In file included from fileb6e52d3a23c3.cpp:1:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/Rcpp.h:27:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/RcppCommon.h:29:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/Rcpp/r/headers.h:67:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:100:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:317:9: error: no member named 'signbit' in the global namespace<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>using ::signbit;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>      ~~^<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:318:9: error: no member named 'fpclassify' in the global namespace<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>using ::fpclassify;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>      ~~^<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:319:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'?<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>using ::isfinite;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>      ~~^<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: 'finite' declared here<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>extern int finite(double)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>           ^<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:currentcolor currentcolor'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:12.0pt;color:black'>From: </span></b><span style='font-size:12.0pt;color:black'>Carl Ganz <<a href="mailto:carlganz@gmail.com" target="_blank">carlganz@gmail.com</a>><br><b>Date: </b>Sunday, May 3, 2020 at 11:02 AM<br><b>To: </b>Paul Fishwick <<a href="mailto:metaphorz@gmail.com" target="_blank">metaphorz@gmail.com</a>><br><b>Cc: </b><<a href="mailto:rcpp-devel@lists.r-forge.r-project.org" target="_blank">rcpp-devel@lists.r-forge.r-project.org</a>><br><b>Subject: </b>Re: [Rcpp-devel] Cannot run rcpp due to missing include file(s)</span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I experienced similar issues on Mac and was able to fix by adding PKG_CPPFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include to my .R/Makevars<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>My understanding is that Mac no longer uses the /usr/local/include so you need to point it to the usr/include in the Developer SDK folder<o:p></o:p></p></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Sun, May 3, 2020 at 8:59 AM Paul Fishwick <<a href="mailto:metaphorz@gmail.com" target="_blank">metaphorz@gmail.com</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid windowtext 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt;border-color:currentcolor currentcolor currentcolor rgb(204,204,204)'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><br clear=all><o:p></o:p></p><div><div><div><div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>System: Mac OSX 11 (Catalina), Rstudio with R version 3.6.3 (but have also tried 4.0 and 3.3),<o:p></o:p></p></div></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Xcode version 11.4.1<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Went to:  <a href="http://adv-r.had.co.nz/Rcpp.html#rcpp-intro" target="_blank">http://adv-r.had.co.nz/Rcpp.html#rcpp-intro</a><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>and tried library(rcpp) which worked fine because I previously had installed the rcpp package.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>The following yields an error in finding config.h. I did a "find" on config.h and sure enough it is not<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>in the clang++ -I directory references. Here is what I have tried:<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Installing Xcode's command line tools (which were installed using xcode-select --install)<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Also, downloaded and installed the version of clang8 and gfortran6.1 from:<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><a href="https://cran.r-project.org/bin/macosx/tools/" target="_blank">https://cran.r-project.org/bin/macosx/tools/</a><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>The following error occurs when I try this rcpp example from Hadley but it also happens whenever<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I try to install an R package from source. The compile fails due to not finding some include file.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I would have thought that installing clang8 would have also included the proper include (.h) file directories<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>with their contents needed by R.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Is there something I am missing below? Thank you.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>> library(Rcpp)<br>> cppFunction('int add(int x, int y, int z) {<br>+   int sum = x + y + z;<br>+   return sum;<br>+ }')<br>In file included from fileb6e52d3a23c3.cpp:1:<br>In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/Rcpp.h:27:<br>In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/RcppCommon.h:29:<br>In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/Rcpp/r/headers.h:67:<br>In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:100:<br>In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:304:<br>In file included from /usr/local/include/math.h:8:<br>In file included from /usr/local/include/features.h:10:<br>/usr/local/include/forwards.h:10:10: fatal error: 'config.h' file not found<br>#include "config.h"<br>         ^~~~~~~~~~<br>1 error generated.<br>make: *** [fileb6e52d3a23c3.o] Error 1<br>clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I"/private/var/folders/bt/1gd00p5s6n19m_bgh9b04gxc0000gp/T/RtmpRRyaky/sourceCpp-x86_64-apple-darwin15.6.0-1.0.4" -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c fileb6e52d3a23c3.cpp -o fileb6e52d3a23c3.o<br>Error in sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir = cacheDir,  : <br>  Error 1 occurred building shared library.<br>> <o:p></o:p></p></div></div></div></div></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>_______________________________________________<br>Rcpp-devel mailing list<br><a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br><a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><o:p></o:p></p></blockquote></div></div></div></blockquote></div></div></body></html>