With R 4.0.0, R (as well as packages on CRAN) will be built with the system toolchain (Apple Clang), which unfortunately mean OpenMP support is not provided natively by the compiler. Fortunately, it is still possible to use OpenMP with the system toolchain if you:
- Instruct clang to enable OpenMP with -Xpreprocessor -fopenmp,
- Explicitly provide include paths to libomp during compilation,
- Explicitly provide library paths to libomp during link.
Unfortunately, data.table fails to detect this case as it invokes the compiler with just -fopenmp here:
|
printf "#include <omp.h>\nint main () { return omp_get_num_threads(); }" | ${CC} ${CFLAGS} -fopenmp -xc - >/dev/null 2>&1 || R_NO_OPENMP=1; |
It would be helpful for users on macOS if support for OpenMP on macOS could be detected + used.
Sorry, I recognize this is kind of a pain but figured it was worth filing since OpenMP is somewhat vital to data.table's performance.
See also:
http://r-sig-mac.29524.n8.nabble.com/R-SIG-Mac-Apple-Clang-does-support-OpenMP-if-libomp-is-available-td458.html#a461
(+ some other recent discussion on R-SIG-Mac)
Reactions are currently unavailable
With R 4.0.0, R (as well as packages on CRAN) will be built with the system toolchain (Apple Clang), which unfortunately mean OpenMP support is not provided natively by the compiler. Fortunately, it is still possible to use OpenMP with the system toolchain if you:
Unfortunately, data.table fails to detect this case as it invokes the compiler with just -fopenmp here:
data.table/configure
Line 64 in b1b1832
It would be helpful for users on macOS if support for OpenMP on macOS could be detected + used.
Sorry, I recognize this is kind of a pain but figured it was worth filing since OpenMP is somewhat vital to data.table's performance.
See also:
http://r-sig-mac.29524.n8.nabble.com/R-SIG-Mac-Apple-Clang-does-support-OpenMP-if-libomp-is-available-td458.html#a461
(+ some other recent discussion on R-SIG-Mac)