# Pass options to rootcling

**URL:** <https://root-forum.cern.ch/t/pass-options-to-rootcling/52995>\
**Category:** ROOT\
**Tags:** rootcling\
**Created:** [January 5, 2023, 4:45pm UTC](https://root-forum.cern.ch/t/pass-options-to-rootcling/52995 "2023-01-05T16:45:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc1uk](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/marc1uk/32/19390_2.png) [@marc1uk](https://root-forum.cern.ch/u/marc1uk)\
**Post date:** [January 5, 2023, 4:45pm UTC](https://root-forum.cern.ch/t/pass-options-to-rootcling/52995/1 "2023-01-05T16:45:44Z")

</div>

* * *

_ROOT Version:_ 6.24/06  
_Platform:_ CentOS8-Stream  
_Compiler:_ g++ 8.5.0

* * *

Short and simple question, hopefully.  
I’m using rootcling within a Makefile to build a dictionary for some classes.  
I’d like to pass some header directories with `-isystem`, but such include paths aren’t picked up when passed to rootcling. Google suggests the `withsystem` option controls this, but I can’t find any way to pass it to rootcling. What’s the proper method to do this?

---

<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:** [January 5, 2023, 10:04pm UTC](https://root-forum.cern.ch/t/pass-options-to-rootcling/52995/2 "2023-01-05T22:04:58Z")

</div>

Try using `-Ipath`

---

<div class="post-metadata">

**Author:** ![marc1uk](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/marc1uk/32/19390_2.png) [@marc1uk](https://root-forum.cern.ch/u/marc1uk)\
**Post date:** [January 5, 2023, 10:06pm UTC](https://root-forum.cern.ch/t/pass-options-to-rootcling/52995/3 "2023-01-05T22:06:36Z")

</div>

`-Ipath` works, but for reasons in the rest of the Makefile i’d like these paths to use `-isystem`.  
I can make a copy that substitues `-isystem` with `-Ipath`, but that seemed like a workaround for something that should be possible…

---

<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:** [January 5, 2023, 10:36pm UTC](https://root-forum.cern.ch/t/pass-options-to-rootcling/52995/4 "2023-01-05T22:36:36Z")

</div>

@vvassilev Is there another option (available now or planned for later)?

---

<div class="post-metadata">

**Author:** ![vvassilev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/f0a364/32.png) [@vvassilev](https://root-forum.cern.ch/u/vvassilev)\
**Post date:** [January 6, 2023, 9:03am UTC](https://root-forum.cern.ch/t/pass-options-to-rootcling/52995/5 "2023-01-06T09:03:02Z")

</div>

Hi all,

`rootcling --help` tells me:  
`--compilerI=<string> - Specify a compiler default include path, to suppress unneeded `-isystem` arguments.`

Would that suffice?

Best, Vassil

---

<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:** [January 6, 2023, 11:06am UTC](https://root-forum.cern.ch/t/pass-options-to-rootcling/52995/6 "2023-01-06T11:06:40Z")

</div>

@vvassilev (and other Cling developers) see “most critical flags in practice” and “many other flags are interesting” in: [clangd → Design → Compile commands](https://clangd.llvm.org/design/compile-commands)  
Then see: [Clang command line argument reference](https://clang.llvm.org/docs/ClangCommandLineReference.html)

---

<div class="post-metadata">

**Author:** ![marc1uk](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/marc1uk/32/19390_2.png) [@marc1uk](https://root-forum.cern.ch/u/marc1uk)\
**Post date:** [January 6, 2023, 1:14pm UTC](https://root-forum.cern.ch/t/pass-options-to-rootcling/52995/7 "2023-01-06T13:14:08Z")

</div>

@vvassilev I don’t seem to have that option listed by `rootcling --help`, but I’m not sure this sounds suitable for what I need. I assume `<string>` is a path, in which case forming the necessary string of `--compilerI=/path/1 --compilerI=/path/2 --compilerI=/path/3` flags to give to rootcling seems essentially the same as just forming `-I/path/1 -I/path/2 -I/path/3` and using that. Each of these paths is an independent directory for a set of 3rd party components, so can’t be represented by a single “default include path”.

@Wile_E_Coyote i’m not sure what the relevance of the first link is. I’m not using clangd. The second suggests using `-isystem<directory>` should be supported, but rootcling doesn’t seem to allow it.

From [this](https://github.com/conda-forge/cppyy-cling-feedstock/pull/10#issuecomment-543278683) post, my understanding was that `rootcling` calls `cling`, and `cling` could potentially recognise `-isystem` paths (internally converting them to `-I` paths), if the `withSystem` flag was set. What I was looking for was a method to get `rootcling` to call `cling` with `withSystem=true`. Perhaps that’s not possible (or perhaps my question was unclear).

In any event, it’s easy enough to make a copy line with `-isystem` swapped for `-I`, so it’s probably not worth spending too much effort on.  
Thanks for all the replies though.

---

<div class="post-metadata">

**Author:** ![vvassilev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/f0a364/32.png) [@vvassilev](https://root-forum.cern.ch/u/vvassilev)\
**Post date:** [January 10, 2023, 7:37am UTC](https://root-forum.cern.ch/t/pass-options-to-rootcling/52995/8 "2023-01-10T07:37:13Z")

</div>

@marc1uk, `isystem` should be supported: [https://github.com/root-project/root/blob/f230da8c5abdd4af8971aa5a64719c40fb6cbd12/core/dictgen/src/rootcling\_impl.cxx#L4156](https://github.com/root-project/root/blob/f230da8c5abdd4af8971aa5a64719c40fb6cbd12/core/dictgen/src/rootcling_impl.cxx#L4156)

I suspect you will need to do something like `-isystem<space> path` as clang does not like the `=` in `isystem` iirc.

---

<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:** [January 10, 2023, 8:00am UTC](https://root-forum.cern.ch/t/pass-options-to-rootcling/52995/9 "2023-01-10T08:00:47Z")

</div>

@vvassilev It should really be possible to use “`-isystem/my/absolute/path`” and “`-isystemmy/relative/path`” (note also the “[`-isystem-after<directory>`"](https://clang.llvm.org/docs/ClangCommandLineReference.html)” option).

---

<div class="post-metadata">

**Author:** ![vvassilev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/f0a364/32.png) [@vvassilev](https://root-forum.cern.ch/u/vvassilev)\
**Post date:** [January 10, 2023, 9:03am UTC](https://root-forum.cern.ch/t/pass-options-to-rootcling/52995/10 "2023-01-10T09:03:49Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> @vvassilev It should really be possible to use “`-isystem/my/absolute/path`” and “`-isystemmy/relative/path`” (note also the “[`-isystem-after<directory>`"](https://clang.llvm.org/docs/ClangCommandLineReference.html)” option).

Indeed, that might work as we are forwarding the arguments to clang anyway.

---

<div class="post-metadata">

**Author:** ![marc1uk](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/marc1uk/32/19390_2.png) [@marc1uk](https://root-forum.cern.ch/u/marc1uk)\
**Post date:** [January 12, 2023, 1:32pm UTC](https://root-forum.cern.ch/t/pass-options-to-rootcling/52995/11 "2023-01-12T13:32:24Z")

</div>

Perhaps it should be, but unless I’m mistaken (which is possible) it seems it isn’t.

 ![Screenshot_2023-01-12_13-31-47](https://root-forum.cern.ch/uploads/default/original/3X/7/f/7f132bb7d1a68f79a4c6c74ae7ac75cd438e8840.png)

[dict.tgz](https://root-forum.cern.ch/uploads/short-url/sGu3rTGCzjkJdzYtFP4fcw6YInO.tgz) (749 Bytes)

---

<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:** [January 26, 2023, 1:32pm UTC](https://root-forum.cern.ch/t/pass-options-to-rootcling/52995/12 "2023-01-26T13:32:49Z")

</div>

Closed on January 26, 2023, 1:32pm UTC

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