简体   繁体   中英

How to install libgpuarray and clBLAS in python on mac os x (10.9)?

I'm trying to install libgpuarray ( http://deeplearning.net/software/libgpuarray/installation.html ) for python on OSX 10.9. I installed CMake 3.0 and are using the UI. I downloaded the libgpuarray and clBLAS source from git and unpacked under Users/user/libgpuarray .. /clBLAS respectively.

Using CMake UI I get the following warning when generating the build:

MACOSX_RPATH is not specified for the following targets:

gpuarray (clBLAS respectively)

Executing 'python setup.py build' results in the following error:

/Users/i043337/Library/Python/2.7/lib/python/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning:

  "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings] 

'#warning "Using deprecated NumPy API, disable it by " \\
^
pygpu/gpuarray.c:354:10: fatal error: 'gpuarray/types.h' file not found
'#include "gpuarray/types.h"

Tried to figure out how to set the correct path but I'm lost to be honest.

Any help is more than appreciated!

Latest XCode (incl. DeveloperTools) installed. Python version is 2.7 from python.org and under the following paths (Terminal$ type -a python)

python is /Library/Frameworks/Python.framework/Versions/2.7/bin/python
python is /usr/bin/python
python is /usr/local/bin/python

I solved this by running:

python setup.py build_ext -I /usr/local/include -L /usr/local/lib

instead of:

python setup.py build

and that solved it. You could probably add these to your PATH as an alternative.

Also, for anyone googling this in the future, you may have to modify the link.txt in Build/src/CMakeFiles/gpuarray.dir to:

1) omit -arch=i386
2) add -F/Library/Frameworks

after running make in the Build/ directory it has you create.

I think you forgot to run

make
make install

after cmake.

I installed it by following commands:

mkdir build && cd build

cmake ..

make && make install

cd .. && python setup.py install

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM