[R-SIG-Mac] Using sanitizers in MacOS builds

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Wed Dec 10 12:13:24 CET 2025


I am making some large changes to rgl, and something I've done is 
causing crashes which I'm having trouble tracking down.  These are 
likely things that one of the sanitizers could detect, so I'd like to do 
a build using one.

The WRE manual gives partial instructions about how to enable them.  It 
first says to put these lines in ~/.R/Makevars:

   CC = gcc -std=gnu99 -fsanitize=address -fno-omit-frame-pointer
   CXX = g++ -fsanitize=address -fno-omit-frame-pointer
   FC = gfortran -fsanitize=address

These don't work for me on my Mac, generating lots of compile errors 
that I don't see with the default settings.

Later WRE gives other instructions for clang 18.  What's not clear to me 
is what I should do for the default compiler tools (including clang 16) 
from mac.r-project.org.  Can anyone suggest what I should do for this 
situation:

  - using the default build of R from CRAN
  - using the libs and tools from mac.r-project.org
  - trying to build rgl with the sanitizer options

Duncan Murdoch



More information about the R-SIG-Mac mailing list