-
Notifications
You must be signed in to change notification settings - Fork 43
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
[NOT WORKING] Add MacOS support #289
Conversation
Unresolved issues: * Fails in clCompileProgram * conversion warnings between long double and f128
HOST_OS = $(shell uname -s) | ||
|
||
ifeq ($(HOST_OS), Darwin) | ||
CXX = g++-14 # from homebrew, needed for 128-bit floats |
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.
The Apple clang doesn't support C++-20 enough to compile filesystem operations. It doesn't have any 128-bit float, as far as I can tell. The real GCC resolves those issues.
COMMON_FLAGS = -Wall -std=c++20 | ||
# -static-libstdc++ -static-libgcc | ||
# -fext-numeric-literals | ||
|
||
ifeq ($(HOST_OS), Darwin) | ||
OPENCL_LIBS = -framework OpenCL |
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.
That's a weird way to link to a library, but it's needed and GCC supports it. Copied form mfakto.
ldouble angle = - M_PIl * k / N; | ||
return {cosl(angle), sinl(angle)}; |
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 don't have a good solution here. The MacOS long double
is equivalent to double
, and functions like cosl
expect long double
i.e. double
.
@@ -14,7 +14,7 @@ | |||
#endif | |||
|
|||
static_assert(sizeof(double2) == 16, "size double2"); | |||
static_assert(sizeof(long double) > sizeof(double), "long double offers extended precision"); | |||
static_assert(sizeof(ldouble) > sizeof(double), "long double offers extended precision"); |
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.
Do we need the extended precision?
@@ -67,6 +67,10 @@ int clReleaseKernel(cl_kernel); | |||
cl_mem clCreateBuffer(cl_context, cl_mem_flags, size_t, void *, int *); | |||
int clReleaseMemObject(cl_mem); | |||
cl_command_queue clCreateCommandQueueWithProperties(cl_context, cl_device_id, const cl_queue_properties *, int *); | |||
#ifdef __APPLE__ | |||
cl_command_queue clCreateCommandQueueWithPropertiesAPPLE(cl_context, cl_device_id, const cl_queue_properties *, int *); |
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.
cl_queue_properties
has extra flags, but it shouldn't matter if we are not using them.
It looks like there are bigger problems with the OpenCL support on MacOS that I don't have time to solve, so I'm closing this PR. |
Unresolved issues: