-
Notifications
You must be signed in to change notification settings - Fork 1k
fix installation using clang-17 #7318
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7318 +/- ##
=======================================
Coverage 99.09% 99.10%
=======================================
Files 83 84 +1
Lines 16092 16126 +34
=======================================
+ Hits 15947 15981 +34
Misses 145 145 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Based on R-SIG-Mac posts from earlier this year, I think that clang-17
needs the very latest OpenMP runtime from
<https://mac.r-project.org/openmp/>, because the one shipped with R is
not compatible with Xcode 16.3+. Then we need to set the compilation
flags so that data.table picks up the new /usr/local/lib/libomp.dylib
installed by us instead of the -lomp shipped with R.
I think it should work if (1) our CI sets the SHLIB_OPENMP_CFLAGS Make
macro in ~/.R/Makevars (like a Mac user would do after upgrading Xcode
and before recompiling everything from scratch) and (2) data.table
checks this macro in the ./configure script, but I haven't seen this
exact configuration in the wild. Will try to get it working.
|
the github action R-CMD-check / macos-15 is failing with the same error as reported in #6622
|
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | ||
|
||
strategy: | ||
fail-fast: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted this line because I would like to have the macos-14 build run to completion/sucess as a positive control https://github.com/Rdatatable/data.table/actions/runs/17743367148/job/50422540824 but I still see macos-14 build gets cancelled as soon as macos-15 build fails. is there a way to configure that here? Or is the configuration from master branch overriding somehow?
Installing a custom OpenMP runtime seems to help, but this is somewhat fragile:
|
great please add NEWS item |
What would you suggest for the text of the news item when the change is mostly not user-visible? "The package is now also tested with Apple clang 17"? |
sure that is fine. Should the news item say that the compilation works with homebrew clang-17? (which is apparently different from xcode clang) I have a response actions/runner-images#13012 (comment) from the github actions macos-15 image dev, who says: Clang is available as a part of Xcode and separately as an independent application instance installed from the Homebrew. Your #6622 referring to clang-17 which is not a part of our default config by the way. That means that one of your steps changes the default setup somehow. |
to finalize this pr, we should revert the deletions I made in the R CMD check CI config. |
Then we might want to add a The risk is breaking installation from source on systems with Apple clang 17 where
This is technically correct (there's probably no binary named |
I found a test that distinguishes between working and broken OpenMP runtime situations on macOS: it's |
wow excellent job thanks Ivan! |
On macOS, this detects OpenMP runtime incompatibilities, e.g. when compiling with newer Apple clang and linking with R-bundled -lomp. In this case, additionally consider a newer OpenMP runtime from <https://mac.r-project.org/openmp/>. Additionally, actually test with $(SHLIB_OPENMP_CFLAGS) and lift the -fopenmp test outside the system-specific branches.
Since the configure script specifically checks for clang 17 and /usr/local/lib/libomp.dylib, don't set the environment variables in the GitHub Actions configuration file. This way we'll know when it breaks.
This reverts commit 354b8d3.
This reverts commit eca2984.
This reverts commit 82ad4a0.
No obvious timing issues in HEAD=fix-macos-15-image Generated via commit 8a144cd Download link for the artifact containing the test results: ↓ atime-results.zip
|
Also, check with no extra parameters first, like we used to.
Could you also add a runner with |
before this pr there were no macos github actions checks, so adding 3 seems like an unusually large move. I would propose to add either 1 macos-15 or 2 macos (macos-15 for arm and macos-15-intel for x86_64). |
The clang on kate is too new for `data.table` R package. See Rdatatable/data.table#7318
Co-authored-by: Toby Dylan Hocking <[email protected]>
Co-authored-by: Toby Dylan Hocking <[email protected]>
It turns out that our caching scheme was in conflict with having macOS 15 running on both Intel and ARM. Coincidentally, this enables OpenMP support on FreeBSD. Previously, the Do we want to fail CI if Would it be feasible for someone to test this with a Homebrew installation of R? |
No, I think it would be better to install single core. Anyway we dont see large speedups when adding cores, for many common operations https://github.com/Anirban166/data.table.threads |
FYI, data.table builds on r-universe are broken because of this: http://cran.dev/data.table/buildlog |
NEWS.md
Outdated
|
||
19. New rolling functions, `frollmin` and `frollprod`, have been implemented, towards [#2778](https://github.com/Rdatatable/data.table/issues/2778). Thanks to @jangorecki for implementation. | ||
|
||
20. Enhanced tests for OpenMP support, detecting incompatibilities such as R-bundled runtime _vs._ newer Xcode and testing for a manually installed runtime from <https://mac.r-project.org/openmp>, [#6622](https://github.com/Rdatatable/data.table/issues/6622). Thanks to @dvg-p4 for initial report and testing, @twitched for the pointers, @tdhock and @aitap for the fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should go into NOTES section of news.md
@jeroen, is there a way to get a CRAN-compatible toolchain on the |
I'm not sure. Could you ask this on the |
Closes #6622
So far I have just setup CI to test the installation.
Maybe we just need to remove "-fopenmp" somewhere in configure? (this was the fix in vllm-project/vllm#16086)