How to browse the (generated) source code (in CLion e.g.)?

Hi! :slight_smile:

I’m trying to get my head around the source base and one things that immediately gets in the way is the partition that exists between the initial C++ code and the generated part.

Take, for instance the /aten/src/ATen/Tensor.h

It looks like a promising entry point for someone like me who is getting started with understanding the code base, but then it immediately goes:

#include <ATen/core/TensorBody.h>

which can’t be resolved by CLion because it’s just isn’t there (and as I get it is being generated during the build ending up in “/build/aten/core/”)

So, the source browsing stucks and the question is - what can I do here?

Turns out - CLion can’t be told to manually add some additional directory to search for headers - it totally relies on analyzing the CMakeLists.txt and the one in the project root dir doesn’t contain anything that could help CLion with this confusion (that’s what it (CLion) said - there is a chance I’m just missing something)

Adding something to CMakeLists.txt just doesn’t look right for a beginner - not sure if it wouldn’t mess up the build and then it would definitely interfere with the upstream changes and so on, so it’s better not to go down this road.

I’m sure that some Linux hacking can resolve this problem, the first thing that comes to mind is some union filesystem like AUFS that can be used to map both src dirs and dirs in /build with generated code together, but before going into all that, I’d rather ask - is there some standard solution to this problem?

How do you guys deal with it, how do you browser the source code in an “uninterrupted” way? I really hope that not everybody seriously working on Pytorch are using Emacs with some custom lisp code that does that linking for them on the fly ;))