-
Notifications
You must be signed in to change notification settings - Fork 141
Support macos #1120
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
Support macos #1120
Conversation
Alternatively instead of removing the avx and sse versions of ceil/floor, you might want to update the dispatch tables in libpgmath/lib/x86_64/math_tables/mth*.h to use the SSE and AVX entry points so that SSE/AVX transition penalties can be avoided when running on AVX systems (although newer Intel processors do not suffer from large transition penalties). |
@d-parks, I've taken a stab in the dark. Please have a look. |
24b2134
to
d699efa
Compare
@isuruf Can you share the build instructions on Mac? |
@kiranchandramohan, it's the same as https://github.com/flang-compiler/flang/wiki/Building-Flang, but with |
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.
mix of everything in one PR. I'm giving +1 to this, let's see what others think.
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.
LGTM.
I would suggest rebasing the branch to get rid of the merge commit, and to organize the changes into two commits, one for the MacOS-related changes, and one for the libpgmath changes. |
- Check for clock_settime before using it - use __fenv_feenableexcept() from flt_env.c instead of feenableexcept() since it doesn't exist on macOS - Use POSIX limits.h - no rt for macos - Enable macos support - don't declare bzero() as it's likely a macro - Remove bad strcpy declaration
Done |
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.
LGTM.
@@ -50,7 +50,11 @@ __ktrap(void) | |||
excepts |= FE_UNDERFLOW; | |||
if (bv & 0x100) | |||
excepts |= FE_INEXACT; | |||
#ifdef TARGET_OSX |
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.
Tried this on my mac. Neither of __fenv_feenableexcept()
or feenableexcept()
could be found...
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.
Looks like the function was moved from flangrti to libpgmath. https://github.com/flang-compiler/flang/blob/master/runtime/libpgmath/lib/common/fltfenv.c
I've tried to build classic flang on my mac for the first time. Some changes were needed:
Also, just in case I've applied this: 8340731 and bunch of my PRs: #135 #546 and #1220 |
Replaces #592