Using StaticRuntime with libtorch

How can I use StaticRuntime from C++ using libtorch?

following e.g. pytorch/impl.h at 4d08db0cb272093af6dbdd7038f92407f8741ddf · pytorch/pytorch · GitHub I just get a compile error: use of undeclared identifier 'StaticModule'

the nightly libtorch has no include/torch/csrc/jit/runtime/static directory, nor does searching the whole tree for “staticmodule” turn up any results. it doesn’t seem to be there at all. Do I need to build pytorch myself? With what options?

I didn’t find exactly why the static runtime headers are left out of the libtorch build, but I did find that I could copy them into the nightly release at include/torch/csrc/jit/runtime/static from the corresponding commit to master.