-
Notifications
You must be signed in to change notification settings - Fork 61
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
OpenMP not detected on Mac (Help from Mac users kindly needed!) #63
Comments
Hi, that looks very platform specific. Unfortunately, I have no access to MAC so it'll be difficult to debug. I've googled around and it may be a flag problem. The flag _OPENMP isn't there on your install. Does the package fst have multi-threading enabled? Related issues: |
Thanks, fst doesn't find OpenMP either. Will let you know if I find a solution. |
Hi, did you manage to find a solution? |
Unfortunately not
…On Mon, Mar 1, 2021 at 8:30 AM Laurent Bergé ***@***.***> wrote:
Hi, did you manage to find a solution?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#63 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHCXYBDUQERLZ6YGE3DHQLTBOJILANCNFSM4UFMXKTQ>
.
|
OK, thanks. I'm changing the title (don't know if it'll help though :-)). |
I too am not on Mac. But I recall that a related issue came up on the data.table GH repo. TL;DR is that OpenMP isn't natively supported by the MacOS toolchain used by R 4.0.0+. People are aware of it (workarounds have been provided) and from reading the thread I think the latest version of R might solve it? See here and links therein: Rdatatable/data.table#4348 |
@grantmcdermott thanks for this link. Weirdly, data.table works just fine for me when I change the Makevars file, but fixest doesn't. |
I think the guys from But I don't know enough on these topics really. Further I don't think it's worth the extra legwork if next versions of R will fix it (which is really great news and makes sense given the prominence of OpenMP). |
I just got OpenMP working on my Macbook Pro for But yeah, if R is going to fix this anyway soon, doesn't seem worth the extra effort. |
And here's the ad hoc DT PR Rdatatable/data.table#3984 |
Think I got it working with the following Makevars file. For it to work you will first need to run (if you haven't already). Only tested with R installed with Homebrew, not the 4.1 binary.
Install homebrew here: https://brew.sh ~/.R/Makevars
|
@adamaltmejd Thanks. I think the problem is that it isn't able to do multi-thread operations, not that it doesn't run at all. Can you try the following?
|
Oops! Forgot to add that part to the post:
|
@adamaltmejd you rock! @Asquidy: could you check if it works for you? If so, I'll pin an issue describing the way to go for Mac users. |
It still doesn't work. FYI, I'm using Big Sur and R 4.0.3. |
Too bad :-(, at least we know it can work w/t extra changes in the package for some Mac users. |
Strange. Are you using R installed with Homebrew? And github fixest built from source? For example installed by running |
I've tried many of these things (and yes data.table works). Unfortunately,
installing fixest from github doesn't work. I can't justify the time it
takes to try to debug this even more.
…On Thu, Mar 25, 2021 at 1:00 PM Adam Altmejd ***@***.***> wrote:
Strange. Are you using R installed with Homebrew? And github fixest built
from source? For example installed by running
remotes::install_github("lrberge/fixest")? Did you get openMP to work
with data.table and fst? Latest Homebrew R version is 4.0.4 so try updating.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#63 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHCXYAMHPKTBH3RG3BX7ULTFNT2VANCNFSM4UFMXKTQ>
.
|
Yeah probably the use case where one wants to run code on own computer instead of server and really need multicore is quite rare. |
Mac user here. Since CRAN on Mac uses Apple Xcode command line tools after R 4.0, which does not support OpenMP, you might want to compile the package from your own computer, not downloading the binary from CRAN. This can be done by adding |
Thanks @matthewgson! Since the problem does not seem general but rather quite specific to the OP, I'm closing. Thanks all! |
I can btw confirm that the Makefile posted above also works with the 4.1 big sur binary for arm M1 macs at least for me. Just make sure to build fixest from source. |
@adamaltmejd's solution above has generally worked really well for me. Just adding some info since I ran
|
Can confirm that this now works! |
Couple of things: It's unfortunately a recurring problem with compiled R packages. Whenever brew updates llvm and you try to install new R packages some of the dependencies will point to old libraries which will lead to compilation errors. Usually really annoying to identify which packages need to be rebuilt so i tend to just rebuild my whole R library. Edit: the The code above uses I would be careful about exporting those compile flags outside of R, not sure how that will work with other brew-compiled software that usually uses the built-in compilation toolchain. |
Does the above recipe still work for people or has it gone out of date over the last 18 months? |
Still works for me, although I haven't tested on one of the newer Macs with the "M" silicon-based chips. |
Same on an M1 with Sonoma. |
Confirming that this works on the M3 Max (Sonoma 14.5). Thanks @adamaltmejd!
|
Hi, I'm trying to use fixest with multiple threads but it doesn't work. See the code below. Note that I do have OpenMP installed and it works on other R packages such as data.table. Any thoughts on why this may happen?
The text was updated successfully, but these errors were encountered: