Compilation of large random forest models with g++

NightStrike nightstrike@gmail.com
Thu Jun 27 15:05:00 GMT 2019


On Thu, Jun 27, 2019 at 9:38 AM Mikail Yayla
<mikail.yayla@tu-dortmund.de> wrote:
>
> Hello,
>
> I would like to compile a random forest model with g++.
> The model has a depth of 20, with 25 trees (for the code, see
> https://github.com/myay/RF).
> The code of the model is generated such that the code of every tree is
> inserted subsequently, thus we have a file with around 500000 lines of code.
> The model however cannot be compiled with any of the optimizations enabled
> (-O3, O2, etc.), as the compilation does not terminate and the system may
> become unresponsive because the ram is filled by the compilation.
> Without the optimizations flag, the compilation succeeds normally.
> Does anyone know why the optimizations flag cannot be used in this case ?
>
> Best,
> Mikail

I do a random forest that's over a gigabyte of if statements.  It
takes about 4 hours to compile, but it does complete (-O3,
-march=native).  Adding more memory helps a lot.  I use C, though, not
C++.



More information about the Gcc-help mailing list