How to link libraries to OpenCL.lib when pip installing a python package, using developer command prompt?

1.1k Views Asked by At

I am on a Dell Inspiron laptop with an AMD graphics card and am aiming to install a python package named pyviennacl:

https://github.com/viennacl/pyviennacl-dev

I am using Developer Command Prompt for VS 2019.

When I run:

pip install pyviennacl

The following error message is returned:

LINK : fatal error LNK1181: cannot open input file 'OpenCL.lib'
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.20.27508\\bin\\HostX86\\x86\\link.exe' failed with exit status 1181

Now, I really have no idea how to proceed. I can see what the error is but cannot find any help.

I've tried to install various Intel/AMD OpenCL packages to remedy this issue, however, to be completely honest, I do not know what I'm doing.

1

There are 1 best solutions below

0
On

did you had a look to this post ?

Also, I resolved the same issue by defining the LIB environment variable to the directory containing the "OpenCL.lib" file (by default at C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\lib\x64 for NVIDIA graphic card. It can be different for AMD or Intel GPU).

In summary, PATH is where your binary will look for .dll files at runtime. To tell link.exe where to look for your .lib libraries you need to configure the LIB environment variable instead. (source here)