How to install TVM C++ headers to system?

Hi. I want to use TVM in C++ directly. So I built TVM according to steps described in the Installation page. Than sudo make installto install everything to system. Then I tried to compile an example I found here and the compiler screams that I’m missing some TVM headers.

In file included from /usr/local/include/tvm/tvm.h:10,
                 from tvm.cpp:4:
/usr/local/include/tvm/expr.h:9:10: fatal error: ir/Expr.h: No such file or directory
 #include <ir/Expr.h>
          ^~~~~~~~~~~

The missing header seems to be a part of the TVM project and there seems to be more header scattering around in the directory. Why isn’t it installed when make install and how can I install them? Am I doing anything wrong?

How did you clone the tvm repository? I’ve seen something similar when the --recursive flag was omitted.

1 Like

I cloned the library by using git clone --recursive https://github.com/dmlc/tvm
TVM shouldn’t build if the --recursive flag isn’t there.

Ok, I misread the intent of your original error listing. I don’t have much experience try to use this part of the tvm API, so I’m not sure what to do here. But the missing files you are seeing are from HalideIR:

Thanks, my code compiles after copying all the headers manually.
make install is not available in HalideIR. Should I open an issue?

there is a install_dev option in cmake, which should be able to install all the development headers. By default, the install only install the runtime header, which suffice to use the runtime but not the development

Hey guys, I found the problem. It’s because inconsistent version of submodule. So just use
git submodule update --init

4 Likes