[ERROR]/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:10: fatal error: OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h: No such file or directory

Env

  • pytorch1.0.1
  • cuda9.0
  • tvm0.4
    -llvm6.0
  • cross compile linaro7.4.1-x86_64-aarch64-linux-gnu

local machine
`
[ 81%] Building CXX object CMakeFiles/tvm.dir/src/runtime/graph/graph_runtime.cc.o
[ 81%] Linking CXX shared library libtvm.so
/usr/lib/llvm-6.0/lib/libLLVM-6.0.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
CMakeFiles/tvm.dir/build.make:4047: recipe for target ‘libtvm.so’ failed
make[2]: *** [libtvm.so] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/tvm.dir/all’ failed
make[1]: *** [CMakeFiles/tvm.dir/all] Error 2
Makefile:127: recipe for target ‘all’ failed
make: *** [all] Error 2
```

CMakeError.log
```
Determining if the CL_VERSION_2_2 exist failed with the following output:
Change Dir: /home1/marong/tvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_d8261/fast"
/usr/bin/make -f CMakeFiles/cmTC_d8261.dir/build.make CMakeFiles/cmTC_d8261.dir/build
make[1]: Entering directory '/home1/marong/tvm/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_d8261.dir/CheckSymbolExists.c.o
/home1/marong/arm-toolchain/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc   -O2 -Wall -fPIC     -o CMakeFiles/cmTC_d8261.dir/CheckSymbolExists.c.o   -c /home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:10: fatal error: OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h: No such file or directory
 #include <OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/cmTC_d8261.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_d8261.dir/CheckSymbolExists.c.o' failed
make[1]: *** [CMakeFiles/cmTC_d8261.dir/CheckSymbolExists.c.o] Error 1
make[1]: Leaving directory '/home1/marong/tvm/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_d8261/fast' failed
make: *** [cmTC_d8261/fast] Error 2

File /home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef CL_VERSION_2_2
  return ((int*)(&CL_VERSION_2_2))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the CL_VERSION_2_1 exist failed with the following output:
Change Dir: /home1/marong/tvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_0e0f1/fast"
/usr/bin/make -f CMakeFiles/cmTC_0e0f1.dir/build.make CMakeFiles/cmTC_0e0f1.dir/build
make[1]: Entering directory '/home1/marong/tvm/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_0e0f1.dir/CheckSymbolExists.c.o
/home1/marong/arm-toolchain/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc   -O2 -Wall -fPIC     -o CMakeFiles/cmTC_0e0f1.dir/CheckSymbolExists.c.o   -c /home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:10: fatal error: OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h: No such file or directory
 #include <OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/cmTC_0e0f1.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_0e0f1.dir/CheckSymbolExists.c.o' failed
make[1]: *** [CMakeFiles/cmTC_0e0f1.dir/CheckSymbolExists.c.o] Error 1
make[1]: Leaving directory '/home1/marong/tvm/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_0e0f1/fast' failed
make: *** [cmTC_0e0f1/fast] Error 2

File /home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef CL_VERSION_2_1
  return ((int*)(&CL_VERSION_2_1))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the CL_VERSION_2_0 exist failed with the following output:
Change Dir: /home1/marong/tvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_0f9f5/fast"
/usr/bin/make -f CMakeFiles/cmTC_0f9f5.dir/build.make CMakeFiles/cmTC_0f9f5.dir/build
make[1]: Entering directory '/home1/marong/tvm/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_0f9f5.dir/CheckSymbolExists.c.o
/home1/marong/arm-toolchain/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc   -O2 -Wall -fPIC     -o CMakeFiles/cmTC_0f9f5.dir/CheckSymbolExists.c.o   -c /home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:10: fatal error: OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h: No such file or directory
 #include <OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/cmTC_0f9f5.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_0f9f5.dir/CheckSymbolExists.c.o' failed
make[1]: *** [CMakeFiles/cmTC_0f9f5.dir/CheckSymbolExists.c.o] Error 1
make[1]: Leaving directory '/home1/marong/tvm/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_0f9f5/fast' failed
make: *** [cmTC_0f9f5/fast] Error 2

File /home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef CL_VERSION_2_0
  return ((int*)(&CL_VERSION_2_0))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the CL_VERSION_1_2 exist failed with the following output:
Change Dir: /home1/marong/tvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_ab36b/fast"
/usr/bin/make -f CMakeFiles/cmTC_ab36b.dir/build.make CMakeFiles/cmTC_ab36b.dir/build
make[1]: Entering directory '/home1/marong/tvm/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_ab36b.dir/CheckSymbolExists.c.o
/home1/marong/arm-toolchain/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc   -O2 -Wall -fPIC     -o CMakeFiles/cmTC_ab36b.dir/CheckSymbolExists.c.o   -c /home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:10: fatal error: OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h: No such file or directory
 #include <OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/cmTC_ab36b.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_ab36b.dir/CheckSymbolExists.c.o' failed
make[1]: *** [CMakeFiles/cmTC_ab36b.dir/CheckSymbolExists.c.o] Error 1
make[1]: Leaving directory '/home1/marong/tvm/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_ab36b/fast' failed
make: *** [cmTC_ab36b/fast] Error 2

File /home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef CL_VERSION_1_2
  return ((int*)(&CL_VERSION_1_2))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the CL_VERSION_1_1 exist failed with the following output:
Change Dir: /home1/marong/tvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_ed712/fast"
/usr/bin/make -f CMakeFiles/cmTC_ed712.dir/build.make CMakeFiles/cmTC_ed712.dir/build
make[1]: Entering directory '/home1/marong/tvm/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_ed712.dir/CheckSymbolExists.c.o
/home1/marong/arm-toolchain/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc   -O2 -Wall -fPIC     -o CMakeFiles/cmTC_ed712.dir/CheckSymbolExists.c.o   -c /home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:10: fatal error: OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h: No such file or directory
 #include <OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/cmTC_ed712.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_ed712.dir/CheckSymbolExists.c.o' failed
make[1]: *** [CMakeFiles/cmTC_ed712.dir/CheckSymbolExists.c.o] Error 1
make[1]: Leaving directory '/home1/marong/tvm/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_ed712/fast' failed
make: *** [cmTC_ed712/fast] Error 2

File /home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef CL_VERSION_1_1
  return ((int*)(&CL_VERSION_1_1))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the CL_VERSION_1_0 exist failed with the following output:
Change Dir: /home1/marong/tvm/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_88728/fast"
/usr/bin/make -f CMakeFiles/cmTC_88728.dir/build.make CMakeFiles/cmTC_88728.dir/build
make[1]: Entering directory '/home1/marong/tvm/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_88728.dir/CheckSymbolExists.c.o
/home1/marong/arm-toolchain/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc   -O2 -Wall -fPIC     -o CMakeFiles/cmTC_88728.dir/CheckSymbolExists.c.o   -c /home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:10: fatal error: OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h: No such file or directory
 #include <OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/cmTC_88728.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_88728.dir/CheckSymbolExists.c.o' failed
make[1]: *** [CMakeFiles/cmTC_88728.dir/CheckSymbolExists.c.o] Error 1
make[1]: Leaving directory '/home1/marong/tvm/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_88728/fast' failed
make: *** [cmTC_88728/fast] Error 2

File /home1/marong/tvm/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef CL_VERSION_1_0
  return ((int*)(&CL_VERSION_1_0))[argc];
#else
  (void)argc;
  return 0;
#endif
}
`

I have set OPENCL OFF in cmakelists and camke/config.cmake. CL/cl.h is in /usr/local/cuda-9.0/include/CL/cl.h ,why OpenCL_INCLUDE_DIR-NOTFOUND/CL/cl.h appeared? How can I fix it,thanks~

Were you able to find the fix? I’m getting the same error.