yes CL/cl.h exists.
I were able to get a few steps further and successfully compile it with pip by setting the
C++ library path (LIBRARY_PATH) and and the C++ include path (CPLUS_INCLUDE_PATH).
Unfortunately i get an error now when importing pyopencl in python.
>> import pyopencl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "~/gpupy/local/lib/python2.7/site-packages/pyopencl/__init__.py", line
import pyopencl._cl as _cl
ImportError: libOpenCL.so.1: cannot open shared object file: No such file or directory
Even though I am able to run
gcc test.cpp -lOpenCL -o test
without any problem.
I don't understand though how the linking of those extensions actually work. In the
path I don't have libOpenCL.so.1 but I have libnvidia-opencl.so.1 .
I guess this libnvidia-opencl.so.1 is responsible for -lOpenCL to work but _cl.so tries to
find libOpenCL.so.1 based on the library name.
I don't know if I am on the right track. I guess I have to investigate the pyopencl
files to understand how it compiles. Or do you have an idea?
Am 01.03.2016 um 21:02 schrieb Andreas Kloeckner
Jesse Hinrichsen <jesse(a)j-apps.com <mailto:firstname.lastname@example.org>> writes:
> for a couple of days I am trying to install pyopencl (2014.1) on an Ubuntu machine
(18.104.22.168, x86_64) as user (no root privileges).
> When running
> $ pip install —global-option=build_ext —global-option=„-I/opt/sw/cuda/include
> the compiler throws
> x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -fwrapv -Wall -O3 -DNDEBUG -fPIC
-DBOOST_PYTHON_SOURCE=1 -DPYGPU_PACKAGE=pyopencl -DPYOPENCL_USE_DEVICE_FISSION=1
-Dboost=pyopenclboost -DBOOST_ALL_NO_LIB=1 -Ibpl-subset/bpl_subset -I/opt/sw/cuda/include
-L/opt/sw/cuda/lib64 -I/usr/include/python2.7 -c src/wrapper/wrap_cl.cpp -o
> In file included from src/wrapper/wrap_cl.cpp:1:0:
> src/wrapper/wrap_cl.hpp:28:19: fatal error: CL/cl.h: No such file or directory
> #include <CL/cl.h>
Do you have a CL/cl.h file anywhere on your system?
Specifically, does /opt/sw/cuda/include/CL/cl.h exist?