LLNL / serac

Serac is a high order nonlinear thermomechanical simulation code
BSD 3-Clause "New" or "Revised" License
178 stars 31 forks source link

Add Ninja option to configure script #1109

Closed chapman39 closed 3 months ago

chapman39 commented 3 months ago

Ninja is a build system alternative to Make. It's goal is to improve build speed. The latest Serac build takes about 1 minute 30 seconds on Quartz. It might be worth adding the option to build Ninja with CMAKE_GENERATOR=Ninja within the config-build.py script.

$time srun -N1 --exclusive --mpibind=off -Aeng -t10 make -j
...
real    1m36.585s
user    0m0.020s
sys     0m0.015s

Another benefit of Ninja is style. With Ninja, it's possible to run simply ninja style without needing to build all of Serac - saving a lot of time.

samuelpmishLLNL commented 3 months ago

I've been using ninja as a generator for serac the entire time I've worked on this project, what do you want to investigate?

white238 commented 3 months ago

I've been using ninja as a generator for serac the entire time I've worked on this project, what do you want to investigate?

I assume something like ./config-build.py --ninja or ./config-build.py -n to enable the Ninja generator.

chapman39 commented 3 months ago

I've been using ninja as a generator for serac the entire time I've worked on this project, what do you want to investigate?

Investigate might be the wrong word. I think it'd be a convenient thing to add to the config-build script. And something we do in lido is check style and build docs using ninja, so you avoid the build time and it speeds up the CI a bit. The style check job in lido takes well under a minute.

samuelpmishLLNL commented 3 months ago

fwiw, style is just a target, so you should be able to just run make style to apply clang-format (without actually building serac) the same way ninja style does.

chapman39 commented 3 months ago

Oh I see that - thanks.