TriBITS icon indicating copy to clipboard operation
TriBITS copied to clipboard

Add TriBITS testing for Ninja

Open bartlettroscoe opened this issue 10 years ago • 7 comments
trafficstars

People are already using Ninja when building Trilinos. Also, once Ninja supports Fortran, then almost every project I know about will be using Ninja.

I just built TribitsExampleProject (TribitsExProj) with Ninja and it worked right out of the box (no changes at all, just had to disable Fortran).

This story will be to add full support for Ninja and testing in all of the TriBITS tools. This will include:

  • Add testing for Ninja in the TriBITS testing package: This only requires passing along the generator to the inner CMake builds.
  • Add support for ninja to checkin-test.py script: Currently, it is hard-coded to use make. That will not work if ninja is being used.

We might as well wait to do this story until CMake supports Ninja. Otherwise, there is not a big demand for using Ninja for all development work (at least any development that requires Fortran like CASL VERA, MPACT, CTF, SCALE, etc.).

bartlettroscoe avatar May 26 '15 23:05 bartlettroscoe

@bmpersc, note this new story ticket for adding Ninja support. Because if this, we can't use make test as suggested in #71.

bartlettroscoe avatar May 26 '15 23:05 bartlettroscoe

For reference, here's the corresponding bug for CMake.

nschloe avatar May 27 '15 07:05 nschloe

Kitware has know about this for a long time (for the time they first put in the Ninja generator). CASL has a contract with Kitware for them to add Fortran support to Ninja. It turns out that this is more complicated that I imagined it would be because they have to support generating Fortran files with modules at build time. What a mess. I wish Fortran would just die (or Fortran developers would just go back to using Fortran 77 without common-blocks).

bartlettroscoe avatar May 27 '15 15:05 bartlettroscoe

It turns out that this is more complicated that I imagined it would be because they have to support generating Fortran files with modules at build time.

If Fortran is off, is this hard to do? I would particularly like to have checkin-test.py support. I'm willing to do the work (e.g., add the command-line argument) if it's not hard.

mhoemmen avatar Sep 23 '16 22:09 mhoemmen

If Fortran is off, is this hard to do? I would particularly like to have checkin-test.py support. I'm willing to do the work (e.g., add the command-line argument) if it's not hard.

A few things:

  1. Currently, checkin-test.py would have to be trained to call 'ninja' instead of 'make'. Not a big deal but I want to have TriBITS generate dummy makefiles to call ninja to help with usability of ninja and ease transition for users/tools that don't know about ninja (see below).

  2. I understand the desire to use Ninja for driving development but does it make a big impact for pre-push testing with checkin-test.py? Running checkin-test.py is mostly an offline operation that you don't actively wait on too much.

For FY17, the plan is to make the Fortran-supported version of Ninja and CMake more mainstream (through Kitware contract) and to make Ninja easier to use by writing dummy makefiles (and getting CMake/Ninja to work with CUDA nvcc_wrapper which it does not currently, see trilinos/Trilinos#321). Once that is done, my hope is to make it so that we can turn on Ninja silently on most platforms and just have smiles on people's face when they see a faster build requiring nothing on their part. Then the checkin-test.py script will be using Ninja and not even know it.

bartlettroscoe avatar Oct 03 '16 21:10 bartlettroscoe

Once that is done, my hope is to make it so that we can turn on Ninja silently on most platforms and just have smiles on people's face when they see a faster build requiring nothing on their part.

Ah, I see. That would be delightful; please don't let me hinder you :-) I am in no rush to have this work.

I understand the desire to use Ninja for driving development but does it make a big impact for pre-push testing with checkin-test.py?

It's not a huge deal for me. I use the check-in test script to manage all my build configurations. I normally run either make or ninja by hand while I'm doing development. Ninja doesn't let me change into subdirectories and build there like make does, so my current manual-build process with ninja is limited anyway. It would be of more use to me as a pre-push testing option, so I'm happy to wait until that works.

mhoemmen avatar Oct 03 '16 21:10 mhoemmen

We should add a Travis CI Ninja build. But there are many Trilinos builds these days that use 'ninja' so we would detect a Ninja failure pretty quick. And switching to Ninja does not really impact 99.9% of TriBITS so I don't see this as a big risk. I can't remember a single change to TriBITS in the last 3 years that broke the usage of Ninja with TriBITS.

bartlettroscoe avatar Jan 19 '19 17:01 bartlettroscoe