# Sourcetrail LLVM indexing errors

**URL:** <https://root-forum.cern.ch/t/sourcetrail-llvm-indexing-errors/47282>\
**Category:** Cling\
**Tags:** build\
**Created:** [October 18, 2021, 6:47am UTC](https://root-forum.cern.ch/t/sourcetrail-llvm-indexing-errors/47282 "2021-10-18T06:47:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [October 18, 2021, 6:47am UTC](https://root-forum.cern.ch/t/sourcetrail-llvm-indexing-errors/47282/1 "2021-10-18T06:47:15Z")

</div>

This is Ubuntu 20.04 LTS / x86\_64 / gcc 9.3.0 here.

I have been trying to use the [“Sourcetrail” source code explorer](https://www.sourcetrail.com/).

At startup, it generates 7 “Type: FATAL” errors when indexing the ROOT’s source code (see below).  
It reports several missing “\*.inc” files for several source code “Files” (and “Translation Units”, which, in some cases, are different from the reported source code “Files”).

I guess the problem is that CMake generates a “compile\_commands.json” file in which it includes build commands for all these “Files” / “Translation Units”, but it then does not execute them at all (at least on Linux).

@Axel Would it be possible that you somehow prevent CMake from including these redundant “build commands” (at least on Linux)?  
Or maybe you could provide dummy “\*.inc” files (at least on Linux) so that the indexer feels happy.

```nohighlight
Message: "Options.inc" file not found
File: /...src.../v6-24-00-patches/interpreter/llvm/src/lib/ToolDrivers/llvm-lib/LibDriver.cpp
Line: 38
Translation Unit: /...src.../v6-24-00-patches/interpreter/llvm/src/lib/ToolDrivers/llvm-lib/LibDriver.cpp

Message: "LipoOpts.inc" file not found
File: /...src.../v6-24-00-patches/interpreter/llvm/src/tools/llvm-lipo/llvm-lipo.cpp
Line: 53
Translation Unit: /...src.../v6-24-00-patches/interpreter/llvm/src/tools/llvm-lipo/llvm-lipo.cpp

Message: "ObjcopyOpts.inc" file not found
File: /...src.../v6-24-00-patches/interpreter/llvm/src/tools/llvm-objcopy/CopyConfig.cpp
Line: 34
Translation Unit: /...src.../v6-24-00-patches/interpreter/llvm/src/tools/llvm-objcopy/CopyConfig.cpp

Message: "Options.inc" file not found
File: /...src.../v6-24-00-patches/interpreter/llvm/src/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
Line: 33
Translation Unit: /...src.../v6-24-00-patches/interpreter/llvm/src/lib/ToolDrivers/llvm-lib/LibDriver.cpp

Message: "Opts.inc" file not found
File: /...src.../v6-24-00-patches/interpreter/llvm/src/tools/llvm-cvtres/llvm-cvtres.cpp
Line: 44
Translation Unit: /...src.../v6-24-00-patches/interpreter/llvm/src/tools/llvm-cvtres/llvm-cvtres.cpp

Message: "Opts.inc" file not found
File: /...src.../v6-24-00-patches/interpreter/llvm/src/tools/llvm-mt/llvm-mt.cpp
Line: 41
Translation Unit: /...src.../v6-24-00-patches/interpreter/llvm/src/tools/llvm-cvtres/llvm-cvtres.cpp

Message: "Opts.inc" file not found
File: /...src.../v6-24-00-patches/interpreter/llvm/src/tools/llvm-rc/llvm-rc.cpp
Line: 48
Translation Unit: /...src.../v6-24-00-patches/interpreter/llvm/src/tools/llvm-cvtres/llvm-cvtres.cpp

```

BTW. In order to prevent indexer’s errors related to Fortran source code files (saying “`expected a clang compiler command`”), when creating a “`New Project`”, one needs to add a magic “`**.f`” entry (note the double “`**`”) in the “`Excluded Files & Directories`” box.

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [October 18, 2021, 7:07am UTC](https://root-forum.cern.ch/t/sourcetrail-llvm-indexing-errors/47282/2 "2021-10-18T07:07:53Z")

</div>

Hi @Wile_E_Coyote ,  
I am not sure how to fix these errors (although I’d be glad to know!) but I can say you can safely ignore them: I used sourcetrail a few times, could not fix the errors, but they are in `interpreter` and do not cause any problem in browsing the rest of ROOT.

Cheers,  
Enrico

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [October 18, 2021, 10:17pm UTC](https://root-forum.cern.ch/t/sourcetrail-llvm-indexing-errors/47282/3 "2021-10-18T22:17:24Z")

</div>

All those error are from LLVM, I wonder if they also appear if one try to load a standalone llvm into sourcetrail.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [November 1, 2021, 10:18pm UTC](https://root-forum.cern.ch/t/sourcetrail-llvm-indexing-errors/47282/4 "2021-11-01T22:18:05Z")

</div>

Closed on November 1, 2021, 10:18pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
