# TMVA Conditional Compilation

**URL:** <https://root-forum.cern.ch/t/tmva-conditional-compilation/26752>\
**Category:** TMVA\
**Created:** [October 31, 2017, 1:12pm UTC](https://root-forum.cern.ch/t/tmva-conditional-compilation/26752 "2017-10-31T13:12:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cvarni](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/f14d63/32.png) [@cvarni](https://root-forum.cern.ch/u/cvarni)\
**Post date:** [October 31, 2017, 1:12pm UTC](https://root-forum.cern.ch/t/tmva-conditional-compilation/26752/1 "2017-10-31T13:12:00Z")

</div>

Dear Experts,  
I’m in the need of producing a code that uses TMVA and is able to be run on ROOT v5 and v6.  
Since the TMVA API has changed I was thinking about a conditional compilation of the code so that I do not have to apply twice the same changes in the codes.

Something like

```auto
#if RootVersion > XX,YY,ZZ
Compile this stuff here with the data loader
#else 
Compile this other stuff
#endif

```

So my questions are the following:

- How can I retrieve the root version in order to do this ?
- When has the API changed ?

Cheers,  
Carlo

---

<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 31, 2017, 1:20pm UTC](https://root-forum.cern.ch/t/tmva-conditional-compilation/26752/2 "2017-10-31T13:20:30Z")

</div>

```auto
#if ROOT_VERSION_CODE > ROOT_VERSION(XX,YY,ZZ)

```

---

<div class="post-metadata">

**Author:** ![cvarni](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/f14d63/32.png) [@cvarni](https://root-forum.cern.ch/u/cvarni)\
**Post date:** [October 31, 2017, 1:27pm UTC](https://root-forum.cern.ch/t/tmva-conditional-compilation/26752/3 "2017-10-31T13:27:47Z")

</div>

Thanks,  
do you also know the XX,YY,ZZ values when the API has changed?

---

<div class="post-metadata">

**Author:** ![behrenhoff](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/behrenhoff/32/12285_2.png) [@behrenhoff](https://root-forum.cern.ch/u/behrenhoff)\
**Post date:** [October 31, 2017, 1:48pm UTC](https://root-forum.cern.ch/t/tmva-conditional-compilation/26752/4 "2017-10-31T13:48:04Z")

</div>

If I remember correctly, the change was in 6.08 (= first version with new API).
