Skip to content
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

ocl-interop build fails on mac #177

Open
Melleth opened this issue Nov 16, 2019 · 0 comments
Open

ocl-interop build fails on mac #177

Melleth opened this issue Nov 16, 2019 · 0 comments

Comments

@Melleth
Copy link

Melleth commented Nov 16, 2019

Dear rust/opencl folk,

I've encountered an error in the ocl-interop crate while building for mac. I know it is untested, and I'm not quite sure what I expected but please hear me out.
If you try to set up things as the README shows, building crashes (build.rs) with the message that the crate gl_generator can not be found. This is red flag 1 AFAIK because gl_generator shouldn't even be included in mac builds. In my local copy of the crate, I removed the extern crate and the use line in lib.rs. To properly fix this, I'm confident that some well placed pre compile flags would do the trick, but on my end I just ended up deleting most of the file involving gl_generator.

On my end this lets me move past build.rs, and consequently it crashes in lib.rs in the following bit (which is line 38-43 of ocl-interop/lib.rs):

#[cfg(target_os = "macos")]
unsafe {
let gl_context = cgl::CGLGetCurrentContext();
let share_group = cgl::CGLGetShareGroup(gl_context);
properties.cgl_sharegroup(share_group);
}

because properties is moved by the cgl_sharegroup() call, it cannot be returned at the end of the function. I'm unsure why it is moved, as when we dive in cgl_sharegroup() it seems to give ownership back by returning self.

So thats what I found out. Sorry if I made some error and this is an incoherent rambling mess. I'm willing to fix this, but I am unsure where to continue.

Thanks for reading and looking forward to any responses!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant