CMake doesn't find /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 to enable OpenCL BE
This happens in the Intel Devcloud PVC env (at least). It's in ld.so.conf and clinfo works.
Seems CMake searches only for *.so. In our case since we ship OpenCL headers, we could just use the so.1 without installing ocl-icd-opencl-dev or other dev package which brings in the .so.
An ugly workaround:
mkdir -p ~/local/lib
ln -s /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 ~/local/lib/libOpenCL.so
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/local/lib
cmake [...]
LD_LIBRARY_PATH is only used when loading a library (by ld); it's not used when GCC or other compiler searches for a library at build time. CMake has its own variable for this purpose.
Yeah, so I thought before taking a look at chipStar's CMake conf which uses it directly.
Thus, setting only LD_LIBRARY_PATH instead of both the cmake's build time and the runtime path suffices here.
I did that on purpose because I was getting tired of default OpenCL runtimes getting picked up. Normally I log in, load modules (which load LD_LIBRARY_PATH) and then compile and run.
The fix is as simple as enabling searches on default path.
Added a workaround to README.md. Should do for 1.0.
Is this a name issue? Cmake expectes libOpenCL.so and libOpenCL.so.1 doens't satisfy it?
I think so, yes.