tanakamura/waifu2x-converter-cpp

Compile error on Linux : no CL/opencl.h

Closed this issue · 1 comments

Hi tanakamura,
I tried to compile your project on a CentOS 7 with a Tesla K40 (CUDA 7) but it failed:

[ 31%] Building CXX object CMakeFiles/w2xc.dir/src/modelHandler.cpp.o
In file included from /home/enigma/waifu2x/waifu2x-converter-cpp-master/src/Buffer.hpp:41:0,
from /home/enigma/waifu2x/waifu2x-converter-cpp-master/src/modelHandler.hpp:19,
from /home/enigma/waifu2x/waifu2x-converter-cpp-master/src/modelHandler.cpp:8:
/home/enigma/waifu2x/waifu2x-converter-cpp-master/src/CLlib.h:13:23: fatal error: CL/opencl.h: No such file or directory
#include <CL/opencl.h>
^
compilation terminated.

It seems that CMake did not assign the correct env vars. My CMake output is :
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/enigma/waifu2x/waifu2x-converter-cpp-master

I have compiled an OpenCV 3.1 and install but it seems that the CMake can not find it.

Solved by using cmake -i mode and adding OpenCL's path in CXX_MAKE_FLAGS and C_MAKE_FLAGS.