【发布时间】:2016-01-07 13:19:23
【问题描述】:
我正在使用 Anaconda 在 MacOSX(Mavericks 10.9)上安装 Theano,就像这篇文章解释的那样:“How to make Theano operate on Mac Lion?”
theano.test()
此命令给出的错误与上面的帖子相同。它在 Ubuntu 14.1 和 System 76 上也会出现该错误。
我可以从 Theano 导入命令;但我仍然想了解为什么 theano.test() 失败。在运行之前已经安装了 CUDA 和 Boost 包...
(参考:参见章节:“测试您的安装”http://deeplearning.net/software/theano/install.html)
正如帖子所暗示的,我认为修复将来自安装 XCode 命令行、自制程序和 pycuda。前两个安装得很好。但是pycuda失败了:
点安装pycuda
....给出以下错误:
> src/cpp/cuda.cpp -o build/temp.macosx-10.5-x86_64-3.4/src/cpp/cuda.o
> In file included from src/cpp/cuda.cpp:1:
>
> src/cpp/cuda.hpp:14:10: fatal error: 'cuda.h' file not found
> #include <cuda.h>
> ^
> 1 error generated.
> error: command 'gcc' failed with exit status 1
>
> Command "//anaconda/bin/python3 -c "import setuptools,
>tokenize;__file__='/private/var/folders/5b/5g1stsns34x_7mgynxhhvf1h0000gn/T/pip-build-4raihcb4/pycuda/setup.py';exec(compile(getattr(tokenize,
> 'open', open)(__file__).read().replace('\r\n', '\n'), __file__,
> 'exec'))" install --record
> /var/folders/5b/5g1stsns34x_7mgynxhhvf1h0000gn/T/pip-kr_3ws22-record/install-record.txt
>> --single-version-externally-managed --compile" failed with error code 1 in
> /private/var/folders/5b/5g1stsns34x_7mgynxhhvf1h0000gn/T/pip-build-4raihcb4/pycuda
似乎第一个错误(gcc 失败)是编译器没有找到 gcc。 (再次注意:我安装了 MacOSX 命令行工具)
我跑
which gcc
这给出了 usr/bin/gcc
我也试过了:
python configure.py --cuda-root=/usr/local/cuda
--cuda-inc-dir=/Developer/NVIDIA/CUDA-5.5/include --cudart-lib-dir=/Developer/NVIDIA/CUDA-5.5/lib
那也没有用。
有没有其他人在安装 pycuda 时遇到过这种困难,可以在这里提出建议吗?谢谢。
【问题讨论】:
-
对于可能需要这个的人,这里是 pycuda 的分步安装:wiki.tiker.net/PyCuda/Installation/Mac 我认为 anacoda 可能会以不寻常的方式处理导入模块。所以,在我了解 anaconda 如何安装像 pycuda 这样的模块之前,我很犹豫是否使用这些说明进行安装,换句话说,我不确定是否值得使用我提供的链接中的步骤 1(对于 python 3.4)安装 pycuda。
标签: python xcode theano pycuda