Skip to content

data.table does not find openmp support

2 messages · Simon Urbanek, Naresh Gurbuxani

#
Naresh,

as for the original problem, just re-install the package binary from CRAN (see [1], i.e., just run install.packages("data.table",repos="https://mac.r-project.org")).

As for your secondary problem (which should be irrelevant by now since you can get the right binary from CRAN), you have mismatching Xcode and OpenMP versions. I suspect you are using Xocde/CLT > 16.2 which is incompatible with the clang 17 run-time (see the note on the OpenMP page). So if you really want to compile it from sources, the two options you have are a) install Xcode/CLT 16.2 (which uses clang 17) or b) use OpenMP from clang 19. For the latter, however, you may need some work since that run-time is incompatible with the libomp shipped with R so you may need to modify the flags (see the note in the flags section of the OpenMP page), but I'm not 100% sure if data.table supports that (or you can replace the R run-time with the clang 19 run-time if you don't use any packages that link to it). Again, it's much easier to install the updated CRAN binary.

Cheers,
Simon

[1] - https://stat.ethz.ch/pipermail/r-sig-mac/2026-January/015314.html
7 days later
#
I just installed data.table binary.  It detects openmp support.  This is all I need. 

My Mac only has command line tools.  My xcode-select version is 2410.  How does it map to Xcode/CLT?
xcode-select version 2410.
Apple clang version 17.0.0 (clang-1700.6.3.2)                                                
Target: x86_64-apple-darwin24.6.0                                                            
Thread model: posix                                                                          
InstalledDir: /Library/Developer/CommandLineTools/usr/bin                                   
!> system("gfortran --version")                                                               
GNU Fortran (GCC) 14.2.0                                                                     
Copyright (C) 2024 Free Software Foundation, Inc.   

Thanks,
Naresh