-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Request] Test for compiler compatibility with -fopenmp
before using SHLIB_OPENMP_CFLAGS
#2161
Comments
This issue is currently blocking use of
|
Just a note that this still causes issues (e.g. this new one on R community), particularly after a new release when CRAN has not yet built a binary. Now that you are using a configure script (#3951) it might be worth adding this test to the configure script so compilation will work with the native macOS toolchain (albeit without parallelization). |
@jimhester Thanks for the note. I thought it already worked with compilers without openmp, and that's checked in CRAN_Release.cmd here: data.table/.dev/CRAN_Release.cmd Line 183 in b2d618c
I get a bit frustrated with claims from users that data.table is blocking anything. It's MacOS that's the problem ... why doesn't it include openmp by default? It all works smoothly on Linux and Windows. |
This detects support for OpenMP and only includes the compiler flags for it if OpenMP is supported. This solves the common case on macOS, because R on macOS ships with `-fopenmp` in SHLIB_OPENMP_CFLAGS, as the CRAN compiler toolchain _does_ support OpenMP, however the XCode toolchain distributed by Apple _does not_ support OpenMP, which causes data.table to fail to compile from source. Fixes Rdatatable#2161
This will allow installation of data.table on systems / compilers that do not support openmp, even if the site Makeconf file defines
SHLIB_OPENMP_CFLAGS
. This is the case on macOS as of R 3.4.0 with the default clang compiler.Something like the following should be sufficient, note that
ifeq
is a GNU make extension, so it will need to be noted in yourDESCRIPTION
The text was updated successfully, but these errors were encountered: