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

no proper C includes #6

Open
notnot opened this issue May 7, 2017 · 2 comments
Open

no proper C includes #6

notnot opened this issue May 7, 2017 · 2 comments

Comments

@notnot
Copy link

notnot commented May 7, 2017

On a linux machine i see this:

jpad@guru:~$ go get github.com/samuel/go-opencl/cl

github.com/samuel/go-opencl/cl

prog/go/extern/src/github.com/samuel/go-opencl/cl/cl.go:19:17: fatal error: cl.h: No such file or directory
// #include "cl.h"
^
compilation terminated.

I guess that on an OS X machine there will also be similar troubles. I think something like this would be a solution:

/*
#cgo CFLAGS: -I CL
#cgo !darwin LDFLAGS: -lOpenCL
#cgo darwin LDFLAGS: -framework OpenCL
#ifdef APPLE
#include "OpenCL/opencl.h"
#else
#include "CL/opencl.h"
#endif
*/
import "C"

...

@ghost
Copy link

ghost commented Jun 30, 2017

Confirmed; the above replacement for // #include "cl.h" works for me. Thanks!

Should this be made into a PR? Happy to do so, but @notnot you may be the more appropriate person to do so.

@jgillich
Copy link

Since this project appears to be dead (@samuel?), I have forked to https://github.com/jgillich/go-opencl

DawDavis pushed a commit to DawDavis/go-opencl that referenced this issue Jul 8, 2022
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

3 participants
@jgillich @notnot and others