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

Fix build on Ubuntu/GCC 4.8.4 and 4.9.0 #83

Closed
wants to merge 1 commit into from

Conversation

larsmans
Copy link
Contributor

@larsmans larsmans commented Aug 6, 2015

The error was that clobj<CLType> was passed where CLType was expected. I'm not sure why this was ever supposed to work; I tried putting a type-cast operator on clobj, but that didn't work.

Fixes #81.

The error was that clobj<CLType> was passed where CLType was expected.
I'm not sure why this was ever supposed to work; I tried putting a
type-cast operator on clobj, but that didn't work.
@yuyichao
Copy link
Contributor

yuyichao commented Aug 6, 2015

this is used instead of data() in order to trace which object is holding the data. If you have DEBUG_ON (either at compile time or at runtime) you should see that each call to the OpenCL API are printed with the corresponding PyOpenCL c++ wrapper address as well as the OpenCL object address. Using data() will make it only print the OpenCL pointer and at some point the ability to track c++ object pointer was important for debugging.

The general procedure is

  1. On creation of an CLArgPack (which holds all the arguments), arguments is converted to CLArg.
  2. The CLArg is templated on the type and in particular a specialization is defined in clobj.h to handle using clobj as argument.
  3. When calling the function, CLArg::convert is called to retrive the real argument to the function and for ClArg<clobj> this should return the corresponding OpenCL object pointer.
  4. As mentioned above, the convert is done at call time so that the type information is preserved for debug printing.

Can you check the output of the compiler to figure out what exactly it is complaining? (it should tell you why it cannot match each template)

@larsmans
Copy link
Contributor Author

larsmans commented Aug 6, 2015

Here's the compiler output for the first file:

https://gist.github.com/larsmans/64e4ebc5e2ed36d548e7

There's megabytes more of this, but it's all the same kind of error.

@Starkstroem
Copy link

I still got the same error as above with 14.04 and gcc 4.9.
Anyone able to install pyopencl successfully?

@inducer
Copy link
Owner

inducer commented Nov 23, 2015

@Starkstroem It builds without a problem for me on gcc 5.2. If you keep having issues, try 2015.1. It has the same interface on the Python side as the newer code, and has been around longer. Nonetheless, gcc 4.9 is not so old that we shouldn't at least try to get it to work.

@inducer
Copy link
Owner

inducer commented Nov 23, 2015

@yuyichao Any clues what's happening here?

@yuyichao
Copy link
Contributor

I couldn't reproduce this on GCC 4.8 or 4.9 so I'm not really sure what's happening.

As I said, this automatic casting was only useful for debugging (to track pointers) and it is certainly ok to avoid it if it's giving people to much issues.

@inducer
Copy link
Owner

inducer commented Nov 30, 2015

e12f38a is a version of this that retains debug info if it's being built on gcc >= 5.2 and otherwise is as compatible as possible. It builds OK for me on Ubuntu 14.04. Please let me know if this resolves the issue.

@inducer
Copy link
Owner

inducer commented Nov 30, 2015

Also, thanks @larsmans for the initial patch, and sorry for the long delay in looking at this.

@inducer inducer closed this Nov 30, 2015
@UniqueFool
Copy link

thanks for fixing this - however, would someone please so kind to update the pip tarball, so that this fix actually propagates (currently, "pip install pyopencl" will fail on all ubuntu/gcc systems mentioned above)

Referring to: https://pypi.python.org/pypi/pyopencl

Thanks

@inducer
Copy link
Owner

inducer commented Dec 1, 2015

I've just uploaded 2015.2.2 with these fixes built in.

@UniqueFool
Copy link

thanks for being so responsive - unfortunately, it seems, there are still some issues:

Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

For the pip log file, see: http://pastebin.com/mMzKrKS1

@inducer
Copy link
Owner

inducer commented Dec 1, 2015

Ugh, sorry. That one slipped through. Should be fixed in 4be4cf5. Can you try current git?

@UniqueFool
Copy link

I can confirm that building from git, everything is building correctly - thanks again for being so responsive, WTG !
Once you have updated the pip package, I will try again and report back here.

thanks

@inducer
Copy link
Owner

inducer commented Dec 2, 2015

2015.2.3 is on the package index.

@UniqueFool
Copy link

success, terrific maintenance job 👍

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

Successfully merging this pull request may close these issues.

None yet

5 participants