[R-SIG-Mac] Error compiling C++ code in R 4.0 on Mac OS X Catalina

Bob Rudis bob @end|ng |rom rud@|@
Tue Aug 11 01:48:46 CEST 2020


Something is causing Rcpp to be unable to detect the presence of {RcppArmadillo}, which can be seen in the lack of the include for it in the snippet you posted on SO (FWIW that site has multiple trackers and I'm not really a fan of being made a product to try to answer a question):

    clang++ 
      -mmacosx-version-min=10.13 \
      -std=gnu++11 \
      -I"/Library/Frameworks/R.framework/Resources/include" \
      -DNDEBUG \
      -I"/Library/Frameworks/R.framework/Packages/Rcpp/include" \
      -I"/Users/itpetersen/Desktop" \
      -I/usr/local/include \
      -fPIC -Wall -g -O2  -c helloworld.cpp -o helloworld.o


Can you re-run the sourceRcpp() call with `verbose = TRUE` and paste the output here?

Also, have you tried:

    remove.packages(c("Rcpp", "RcppArmadillo"))
    install.packages(c("Rcpp", "RcppArmadillo"))

and trying everything again in a `--vanilla` R session?

> On Aug 10, 2020, at 18:33, Isaac Petersen <isaac-t-petersen using uiowa.edu> wrote:
> 
> I'm trying to compile C++ code in R so I can install packages from source.
> I’m running R 4.0.2 on Mac OS X Catalina (10.15.6).  I receive an error
> when trying to compile C++ code in R.  I posted the full details of my
> problem on Stack Overflow here:
> https://stackoverflow.com/questions/63276265/error-compiling-c-code-in-r-4-0-on-mac-os-x-catalina?noredirect=1#comment112012438_63276265.
> The question was unfortunately marked as a duplicate because it is similar
> to another question, even though the answers to the "similar" question did
> not solve my problem.  One responder noted that
> "/usr/local/include/RcppArmadillo.h" was missing (even though I
> successfully installed the RcppArmadillo package).  Any help would be
> greatly appreciated.
> 
> Thanks very much in advance.
> -Isaac
> 
> ---
> Isaac T. Petersen, Ph.D.
> Assistant Professor
> Department of Psychological and Brain Sciences
> University of Iowa
> 175 Psychological and Brain Sciences Building
> Iowa City, IA 52242
> p: (319) 467-1014
> isaac-t-petersen using uiowa.edu
> https://psychology.uiowa.edu/developmental-psychopathology-lab
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac



More information about the R-SIG-Mac mailing list