andersbll / cudarray

CUDA-based NumPy
MIT License
234 stars 61 forks source link

python setup.py install error #17

Open cxfneo opened 9 years ago

cxfneo commented 9 years ago

python setup.py install error in cudarray setup command: CUDA back-end wants to be able to remove cudarray.cudarray_wrap, but the distribution doesn't contain any packages or modules under cudarray.cudarray_wrap

How to solve, thank you very much

cxfneo commented 9 years ago

I update the setup.py. Now another problem is : “”running build_ext building 'cudarray.numpy_backend.nnet.conv_bc01' extension gcc -std=gnu99 -fno-strict-aliasing -g -O2 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include/python2.7 -c cudarray/numpy_backend/nnet/conv_bc01.c -o build/temp.linux-x86_64-2.7/cudarray/numpy_backend/nnet/conv_bc01.o gcc: cudarray/numpy_backend/nnet/conv_bc01.c: No such file or directory “” I am not familiar with cpython and I indeed could not find cudarray/numpy_backend/nnet/conv_bc01.c. Is the conv_bc01.c generated by compling the code at the first step "make"?

The version of cython is 0.22 Python version: 2.7

andersbll commented 9 years ago

conv_bc01.c gets generated by the call to cythonize().

Regarding your initial problem: You might need to call sudo python setup.py install because you are trying to install to system directories. Alternatively, you could perform a user install.

cxfneo commented 9 years ago

Thanks for your quick reply, I will try your method. If I want to code my own c++ cuda function for some special cases, how can I embed the c++ cuda function into python routine, Need I to learn cython first? could u give quick guide?

thank you

andersbll commented 9 years ago

You need to 1) implement your CUDA functionality, 2) wrap the functionality in Cython and 3) expose it to Python using cudarray.ndarray objects.

cxfneo commented 9 years ago

thank u

cxfneo commented 9 years ago

Hi andersbll sorry to bother you again, I try to install it today again, but another problem is " Traceback (most recent call last): File "setup.py", line 5, in import numpy File "/usr/local/lib/python2.7/site-packages/numpy/init.py", line 153, in from . import add_newdocs File "/usr/local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in from numpy.lib import add_newdoc File "/usr/local/lib/python2.7/site-packages/numpy/lib/init.py", line 18, in from .polynomial import File "/usr/local/lib/python2.7/site-packages/numpy/lib/polynomial.py", line 19, in from numpy.linalg import eigvals, lstsq, inv File "/usr/local/lib/python2.7/site-packages/numpy/linalg/init.py", line 50, in from .linalg import File "/usr/local/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 29, in from numpy.linalg import lapack_lite, _umath_linalg ImportError: libmkl_rt.so: cannot open shared object file: No such file or directory " PS: The numpy(1.8) used on my machine was complied with MKL and it worked. I also set the enviroment var path for MKL LIB.

andersbll commented 9 years ago

Sorry, can't help you with that.

cxfneo commented 9 years ago

OK, thank you all the same. By the way, does cudarray support selection as follows:" row_select_index=[0,2,3,10,0],gp_A is a garray with a shape(M,N) gp_A[row_select_index] ?