{"action":"created","issue":{"url":"https://api.github.com/repos/andersbll/cudarray/issues/21","labels_url":"https://api.github.com/repos/andersbll/cudarray/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/andersbll/cudarray/issues/21/comments","events_url":"https://api.github.com/repos/andersbll/cudarray/issues/21/events","html_url":"https://github.com/andersbll/cudarray/issues/21","id":104999041,"number":21,"title":"Install problem with Cython","user":{"login":"subercui","id":11674033,"avatar_url":"https://avatars.githubusercontent.com/u/11674033?v=3","gravatar_id":"","url":"https://api.github.com/users/subercui","html_url":"https://github.com/subercui","followers_url":"https://api.github.com/users/subercui/followers","following_url":"https://api.github.com/users/subercui/following{/other_user}","gists_url":"https://api.github.com/users/subercui/gists{/gist_id}","starred_url":"https://api.github.com/users/subercui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subercui/subscriptions","organizations_url":"https://api.github.com/users/subercui/orgs","repos_url":"https://api.github.com/users/subercui/repos","events_url":"https://api.github.com/users/subercui/events{/privacy}","received_events_url":"https://api.github.com/users/subercui/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-09-05T03:20:14Z","updated_at":"2015-09-05T17:26:45Z","closed_at":null,"body":"I tried Cython 0.21, 0.22, 0.23 and got the same error when python setup install\r\n'''\r\n......\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:45:32: Cannot convert Python object to 'float *'\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n                       float_ptr(poolout))\r\n\r\n    def bprop(self, ArrayData imgs, ArrayData poolout, ArrayData poolout_d,\r\n              ArrayData imgs_d):\r\n        self.ptr.bprop(\r\n            <const float *> imgs.dev_ptr,\r\n           ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:50:12: Python objects cannot be cast to pointers of primitive types\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n\r\n    def bprop(self, ArrayData imgs, ArrayData poolout, ArrayData poolout_d,\r\n              ArrayData imgs_d):\r\n        self.ptr.bprop(\r\n            <const float *> imgs.dev_ptr,\r\n            <const float *> poolout.dev_ptr,\r\n           ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:51:12: Python objects cannot be cast to pointers of primitive types\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n    def bprop(self, ArrayData imgs, ArrayData poolout, ArrayData poolout_d,\r\n              ArrayData imgs_d):\r\n        self.ptr.bprop(\r\n            <const float *> imgs.dev_ptr,\r\n            <const float *> poolout.dev_ptr,\r\n            <const float *> poolout_d.dev_ptr, <float *> imgs_d.dev_ptr\r\n           ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:52:12: Python objects cannot be cast to pointers of primitive types\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n    def bprop(self, ArrayData imgs, ArrayData poolout, ArrayData poolout_d,\r\n              ArrayData imgs_d):\r\n        self.ptr.bprop(\r\n            <const float *> imgs.dev_ptr,\r\n            <const float *> poolout.dev_ptr,\r\n            <const float *> poolout_d.dev_ptr, <float *> imgs_d.dev_ptr\r\n                                              ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:52:47: Python objects cannot be cast to pointers of primitive types\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n              ArrayData convout):\r\n        cdef int img_h = img_shape[0]\r\n        cdef int img_w = img_shape[1]\r\n        cdef int filter_h = filter_shape[0]\r\n        cdef int filter_w = filter_shape[1]\r\n        self.ptr.fprop(float_ptr(imgs), float_ptr(filters), n_imgs, n_channels,\r\n                               ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:81:32: Cannot convert Python object to 'float const *'\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n              ArrayData convout):\r\n        cdef int img_h = img_shape[0]\r\n        cdef int img_w = img_shape[1]\r\n        cdef int filter_h = filter_shape[0]\r\n        cdef int filter_w = filter_shape[1]\r\n        self.ptr.fprop(float_ptr(imgs), float_ptr(filters), n_imgs, n_channels,\r\n                                                ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:81:49: Cannot convert Python object to 'float const *'\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n        cdef int img_h = img_shape[0]\r\n        cdef int img_w = img_shape[1]\r\n        cdef int filter_h = filter_shape[0]\r\n        cdef int filter_w = filter_shape[1]\r\n        self.ptr.fprop(float_ptr(imgs), float_ptr(filters), n_imgs, n_channels,\r\n            n_filters, img_h, img_w, filter_h, filter_w, float_ptr(convout))\r\n                                                                 ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:82:66: Cannot convert Python object to 'float *'\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n        self.ptr.fprop(float_ptr(imgs), float_ptr(filters), n_imgs, n_channels,\r\n            n_filters, img_h, img_w, filter_h, filter_w, float_ptr(convout))\r\n\r\n    def bprop(self, ArrayData imgs, ArrayData filters, ArrayData convout_d,\r\n              ArrayData imgs_d, ArrayData filters_d):\r\n        cdef float *imgs_ptr = <float *>NULL if imgs is None \\\r\n                              ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:86:31: Cannot convert 'float *' to Python object\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n        self.ptr.fprop(float_ptr(imgs), float_ptr(filters), n_imgs, n_channels,\r\n            n_filters, img_h, img_w, filter_h, filter_w, float_ptr(convout))\r\n\r\n    def bprop(self, ArrayData imgs, ArrayData filters, ArrayData convout_d,\r\n              ArrayData imgs_d, ArrayData filters_d):\r\n        cdef float *imgs_ptr = <float *>NULL if imgs is None \\\r\n                              ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:86:31: Cannot convert Python object to 'float *'\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n            n_filters, img_h, img_w, filter_h, filter_w, float_ptr(convout))\r\n\r\n    def bprop(self, ArrayData imgs, ArrayData filters, ArrayData convout_d,\r\n              ArrayData imgs_d, ArrayData filters_d):\r\n        cdef float *imgs_ptr = <float *>NULL if imgs is None \\\r\n                                             else float_ptr(imgs)\r\n                                                          ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:87:59: Cannot convert Python object to 'float *'\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n\r\n    def bprop(self, ArrayData imgs, ArrayData filters, ArrayData convout_d,\r\n              ArrayData imgs_d, ArrayData filters_d):\r\n        cdef float *imgs_ptr = <float *>NULL if imgs is None \\\r\n                                             else float_ptr(imgs)\r\n        cdef float *imgs_d_ptr = <float *>NULL if imgs_d is None \\\r\n                                ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:88:33: Cannot convert 'float *' to Python object\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n\r\n    def bprop(self, ArrayData imgs, ArrayData filters, ArrayData convout_d,\r\n              ArrayData imgs_d, ArrayData filters_d):\r\n        cdef float *imgs_ptr = <float *>NULL if imgs is None \\\r\n                                             else float_ptr(imgs)\r\n        cdef float *imgs_d_ptr = <float *>NULL if imgs_d is None \\\r\n                                ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:88:33: Cannot convert Python object to 'float *'\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n    def bprop(self, ArrayData imgs, ArrayData filters, ArrayData convout_d,\r\n              ArrayData imgs_d, ArrayData filters_d):\r\n        cdef float *imgs_ptr = <float *>NULL if imgs is None \\\r\n                                             else float_ptr(imgs)\r\n        cdef float *imgs_d_ptr = <float *>NULL if imgs_d is None \\\r\n                                               else float_ptr(imgs_d)\r\n                                                            ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:89:61: Cannot convert Python object to 'float *'\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n              ArrayData imgs_d, ArrayData filters_d):\r\n        cdef float *imgs_ptr = <float *>NULL if imgs is None \\\r\n                                             else float_ptr(imgs)\r\n        cdef float *imgs_d_ptr = <float *>NULL if imgs_d is None \\\r\n                                               else float_ptr(imgs_d)\r\n        cdef float *filters_d_ptr = <float *>NULL if filters_d is None \\\r\n                                   ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:90:36: Cannot convert 'float *' to Python object\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n              ArrayData imgs_d, ArrayData filters_d):\r\n        cdef float *imgs_ptr = <float *>NULL if imgs is None \\\r\n                                             else float_ptr(imgs)\r\n        cdef float *imgs_d_ptr = <float *>NULL if imgs_d is None \\\r\n                                               else float_ptr(imgs_d)\r\n        cdef float *filters_d_ptr = <float *>NULL if filters_d is None \\\r\n                                   ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:90:36: Cannot convert Python object to 'float *'\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n        cdef float *imgs_ptr = <float *>NULL if imgs is None \\\r\n                                             else float_ptr(imgs)\r\n        cdef float *imgs_d_ptr = <float *>NULL if imgs_d is None \\\r\n                                               else float_ptr(imgs_d)\r\n        cdef float *filters_d_ptr = <float *>NULL if filters_d is None \\\r\n                                                  else float_ptr(filters_d)\r\n                                                               ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:91:64: Cannot convert Python object to 'float *'\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n                                             else float_ptr(imgs)\r\n        cdef float *imgs_d_ptr = <float *>NULL if imgs_d is None \\\r\n                                               else float_ptr(imgs_d)\r\n        cdef float *filters_d_ptr = <float *>NULL if filters_d is None \\\r\n                                                  else float_ptr(filters_d)\r\n        self.ptr.bprop(imgs_ptr, float_ptr(filters),\r\n                                         ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:92:42: Cannot convert Python object to 'float const *'\r\n\r\nError compiling Cython file:\r\n------------------------------------------------------------\r\n...\r\n        cdef float *imgs_d_ptr = <float *>NULL if imgs_d is None \\\r\n                                               else float_ptr(imgs_d)\r\n        cdef float *filters_d_ptr = <float *>NULL if filters_d is None \\\r\n                                                  else float_ptr(filters_d)\r\n        self.ptr.bprop(imgs_ptr, float_ptr(filters),\r\n                       float_ptr(convout_d), imgs_d_ptr, filters_d_ptr)\r\n                               ^\r\n------------------------------------------------------------\r\n\r\ncudarray/wrap/cudnn.pyx:93:32: Cannot convert Python object to 'float const *'\r\nbuilding 'cudarray.wrap.cudnn' extension\r\nx86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/cuda-7.0/include -I./include -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c ./cudarray/wrap/cudnn.cpp -o build/temp.linux-x86_64-2.7/./cudarray/wrap/cudnn.o -DCUDNN_ENABLED -O3 -fPIC -Wall -Wfatal-errors\r\ncc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]\r\n./cudarray/wrap/cudnn.cpp:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.\r\n #error Do not use this file, it is the result of a failed Cython compilation.\r\n  ^\r\ncompilation terminated due to -Wfatal-errors.\r\nerror: command 'x86_64-linux-gnu-gcc' failed with exit status 1\r\n'''"},"comment":{"url":"https://api.github.com/repos/andersbll/cudarray/issues/comments/137979346","html_url":"https://github.com/andersbll/cudarray/issues/21#issuecomment-137979346","issue_url":"https://api.github.com/repos/andersbll/cudarray/issues/21","id":137979346,"user":{"login":"andersbll","id":177245,"avatar_url":"https://avatars.githubusercontent.com/u/177245?v=3","gravatar_id":"","url":"https://api.github.com/users/andersbll","html_url":"https://github.com/andersbll","followers_url":"https://api.github.com/users/andersbll/followers","following_url":"https://api.github.com/users/andersbll/following{/other_user}","gists_url":"https://api.github.com/users/andersbll/gists{/gist_id}","starred_url":"https://api.github.com/users/andersbll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersbll/subscriptions","organizations_url":"https://api.github.com/users/andersbll/orgs","repos_url":"https://api.github.com/users/andersbll/repos","events_url":"https://api.github.com/users/andersbll/events{/privacy}","received_events_url":"https://api.github.com/users/andersbll/received_events","type":"User","site_admin":false},"created_at":"2015-09-05T17:26:45Z","updated_at":"2015-09-05T17:26:45Z","body":"I can't quite figure out what goes wrong, but your Python setup must be faulty somehow. Try `pip install --user -U cython` or maybe `sudo pip install -U cython` to overwrite your system installation of Cython. Alternatively, I can recommend the Anaconda Python distribution."}}