【问题标题】:How to install libgpuarray and clBLAS in python on mac os x (10.9)?如何在 mac os x (10.9) 上的 python 中安装 libgpuarray 和 clBLAS?
【发布时间】:2014-09-23 11:24:24
【问题描述】:

我正在尝试在 OSX 10.9 上为 python 安装 libgpuarray (http://deeplearning.net/software/libgpuarray/installation.html)。我安装了 CMake 3.0 并正在使用 UI。我从 git 下载了 libgpuarray 和 clBLAS 源代码,并分别在 Users/user/libgpuarray .. /clBLAS 下解压。

使用 CMake UI 我在生成构建时收到以下警告:

没有为以下目标指定 MACOSX_RPATH:

gpuarray(分别为clBLAS)

执行“python setup.py build”会导致以下错误:

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

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

'#warning "使用已弃用的 NumPy API,通过 " \
禁用它 ^
pygpu/gpuarray.c:354:10:致命错误:找不到“gpuarray/types.h”文件
'#include "gpuarray/types.h"

试图弄清楚如何设置正确的路径,但老实说我迷路了。

任何帮助都非常感谢!

安装了最新的 XCode(包括 DeveloperTools)。 Python 版本是来自 python.org 的 2.7 并在以下路径下(Terminal$ type -a python)

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

【问题讨论】:

    标签: python macos path cmake


    【解决方案1】:

    我通过以下命令安装了它:

    mkdir build && cd build

    cmake ..

    制作 && 制作安装

    cd .. && python setup.py install

    【讨论】:

      【解决方案2】:

      我想你忘了跑

      make
      make install
      

      在 cmake 之后。

      【讨论】:

        【解决方案3】:

        我通过运行解决了这个问题:

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

        代替:

        python setup.py build
        

        这就解决了。您可能可以将这些添加到您的 PATH 作为替代方案。

        此外,对于将来在谷歌上搜索此内容的任何人,您可能必须将 Build/src/CMakeFiles/gpuarray.dir 中的 link.txt 修改为:

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

        在 Build/ 目录中运行 make 后,您将创建它。

        【讨论】:

        • 我有同样的错误,我跑了:'python setup.py build_ext -I /usr/local/include -L /usr/local/lib' 仍然有同样的错误。我检查了 link.txt 并且 _F/Library/Frameworks 已经存在,但我有 -arch x86_64。似乎无法弄清楚。
        猜你喜欢
        • 2014-02-12
        • 2014-10-10
        • 1970-01-01
        • 2014-04-29
        • 2013-11-02
        • 2013-11-11
        • 2013-11-17
        • 1970-01-01
        相关资源
        最近更新 更多