【发布时间】:2020-06-03 17:53:44
【问题描述】:
在these instructions 之后,我已经从here 下载并安装了英特尔的 OpenCL™ SDK(英特尔® System Studio)。 cl.h 文件在文件夹中
C:\Program Files (x86)\IntelSWTools\system_studio_2020\OpenCL\sdk\include\CL
但是在运行时
pip install pyopencl
我收到了很长的错误消息
Building wheel for pyopencl (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python38\python.exe' 'c:\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\fsfar\AppData\Local\Temp\tmpsufv5353'
cwd: C:\Users\fsfar\AppData\Local\Temp\pip-install-cthadcch\pyopencl
Complete output (95 lines):
---------------------------------------------------------------------------
Mako is not installed.
---------------------------------------------------------------------------
That is not a problem, as most of PyOpenCL will be just fine
without it. Some higher-level parts of pyopencl (such as
pyopencl.reduction) will not function without the templating engine
Mako [1] being installed. If you would like this functionality to
work, you might want to install Mako after you finish
installing PyOpenCL.
Simply type
python -m pip install mako
either now or after the installation completes to fix this.
[1] http://www.makotemplates.org/
---------------------------------------------------------------------------
Hit Ctrl-C now if you'd like to think about the situation.
---------------------------------------------------------------------------
Continuing in 1 seconds...
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\pyopencl
copying pyopencl\algorithm.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\array.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\bitonic_sort.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\bitonic_sort_templates.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\cache.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\capture_call.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\clmath.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\clrandom.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\cltypes.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\elementwise.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\invoker.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\ipython_ext.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\reduction.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\scan.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\tools.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\version.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\_buffers.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\_cluda.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\_mymako.py -> build\lib.win-amd64-3.8\pyopencl
copying pyopencl\__init__.py -> build\lib.win-amd64-3.8\pyopencl
creating build\lib.win-amd64-3.8\pyopencl\characterize
copying pyopencl\characterize\performance.py -> build\lib.win-amd64-3.8\pyopencl\characterize
copying pyopencl\characterize\__init__.py -> build\lib.win-amd64-3.8\pyopencl\characterize
creating build\lib.win-amd64-3.8\pyopencl\compyte
copying pyopencl\compyte\array.py -> build\lib.win-amd64-3.8\pyopencl\compyte
copying pyopencl\compyte\dtypes.py -> build\lib.win-amd64-3.8\pyopencl\compyte
copying pyopencl\compyte\__init__.py -> build\lib.win-amd64-3.8\pyopencl\compyte
creating build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
copying pyopencl\compyte\ndarray\gen_elemwise.py -> build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
copying pyopencl\compyte\ndarray\gen_reduction.py -> build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
copying pyopencl\compyte\ndarray\setup_opencl.py -> build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
copying pyopencl\compyte\ndarray\test_gpu_elemwise.py -> build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
copying pyopencl\compyte\ndarray\test_gpu_ndarray.py -> build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
copying pyopencl\compyte\ndarray\__init__.py -> build\lib.win-amd64-3.8\pyopencl\compyte\ndarray
running egg_info
writing pyopencl.egg-info\PKG-INFO
writing dependency_links to pyopencl.egg-info\dependency_links.txt
writing requirements to pyopencl.egg-info\requires.txt
writing top-level names to pyopencl.egg-info\top_level.txt
reading manifest file 'pyopencl.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.h'
warning: no files found matching 'doc\_static\*.css'
warning: no files found matching 'doc\_templates\*.html'
warning: no files found matching '*.py.in'
writing manifest file 'pyopencl.egg-info\SOURCES.txt'
creating build\lib.win-amd64-3.8\pyopencl\cl
copying pyopencl\cl\pyopencl-airy.cl -> build\lib.win-amd64-3.8\pyopencl\cl
copying pyopencl\cl\pyopencl-bessel-j-complex.cl -> build\lib.win-amd64-3.8\pyopencl\cl
copying pyopencl\cl\pyopencl-bessel-j.cl -> build\lib.win-amd64-3.8\pyopencl\cl
copying pyopencl\cl\pyopencl-bessel-y.cl -> build\lib.win-amd64-3.8\pyopencl\cl
copying pyopencl\cl\pyopencl-complex.h -> build\lib.win-amd64-3.8\pyopencl\cl
copying pyopencl\cl\pyopencl-eval-tbl.cl -> build\lib.win-amd64-3.8\pyopencl\cl
copying pyopencl\cl\pyopencl-hankel-complex.cl -> build\lib.win-amd64-3.8\pyopencl\cl
copying pyopencl\cl\pyopencl-ranluxcl.cl -> build\lib.win-amd64-3.8\pyopencl\cl
creating build\lib.win-amd64-3.8\pyopencl\cl\pyopencl-random123
copying pyopencl\cl\pyopencl-random123\array.h -> build\lib.win-amd64-3.8\pyopencl\cl\pyopencl-random123
copying pyopencl\cl\pyopencl-random123\openclfeatures.h -> build\lib.win-amd64-3.8\pyopencl\cl\pyopencl-random123
copying pyopencl\cl\pyopencl-random123\philox.cl -> build\lib.win-amd64-3.8\pyopencl\cl\pyopencl-random123
copying pyopencl\cl\pyopencl-random123\threefry.cl -> build\lib.win-amd64-3.8\pyopencl\cl\pyopencl-random123
running build_ext
building 'pyopencl._cl' extension
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYGPU_PACKAGE=pyopencl -DPYGPU_PYOPENCL=1 -Ipybind11/include -IC:\Users\fsfar\AppData\Local\Temp\pip-build-env-gqyddbnz\overlay\Lib\site-packages\pybind11\include -IC:\Users\fsfar\AppData\Local\Temp\pip-build-env-gqyddbnz\overlay\Lib\site-packages\pybind11\include -IC:\Users\fsfar\AppData\Local\Temp\pip-build-env-gqyddbnz\overlay\Lib\site-packages\numpy\core\include -Ic:\python38\include -Ic:\python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /EHsc /Tpsrc/wrap_constants.cpp /Fobuild\temp.win-amd64-3.8\Release\src/wrap_constants.obj -fvisibility=hidden /EHsc /DVERSION_INFO=\"2020.1\"
cl : Command line warning D9002 : ignoring unknown option '-fvisibility=hidden'
wrap_constants.cpp
c:\users\fsfar\appdata\local\temp\pip-install-cthadcch\pyopencl\src\wrap_cl.hpp(57): fatal error C1083: Cannot open include file: 'CL/cl.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for pyopencl
Failed to build pyopencl
ERROR: Could not build wheels for pyopencl which use PEP 517 and cannot be installed directly
P.S.1. 还发布了一个半相关问题 here。
P.S.2. 根据this 和this 的帖子,应该有一个siteconf.py 文件,我可以在其中指定CL_INC_DIR 和CL_LIB_DIR 等环境变量。但是,我在硬盘驱动器上找不到上述文件,我不确定是否可以在使用 pip 包管理器时更改环境变量。我试过了
set CL_INC_DIR = [r'C:\Program Files (x86)\IntelSWTools\system_studio_2020\OpenCL\sdk\include']
在cmd 无济于事。
P.S.3. 我尝试使用pipwin 安装:
pip install pipwin
pipwin install pyopencl
但是在 python 中运行import pyopencl 时,我收到了错误消息
c:\python38\lib\site-packages\pyopencl\__init__.py in <module>
37
38 try:
---> 39 import pyopencl._cl as _cl
40 except ImportError:
41 import os
ImportError: DLL load failed while importing _cl: The specified procedure could not be found.
P.S.4.我尝试按照说明here,但是命令
pip install -i https://pypi.anaconda.org/carlkl/simple mingwpy
返回
查看索引:https://pypi.anaconda.org/carlkl/simple 错误:找不到满足 mingwpy 要求的版本(来自版本:无) 错误:没有为 mingwpy 找到匹配的分布【问题讨论】:
标签: python pip opencl intel pyopencl