[vtk-developers] [ANNOUNCE] New module system landing

Andras Lasso lasso at queensu.ca
Sun Feb 3 07:09:10 EST 2019


I've used two large CMake-based projects in the past that tried to do something similar - guess which features to enable/disable based on a number of require/prohibit CMake flags. Both worked very poorly, because it always required lengthy experimentation with the flags to get the list of features that we  actually needed.

The main issue is that positive (require) and negative (prohibit) requirements are obviously often contradict and it is not clear which one is stronger, why exactly they conflict, and what are the options to resolve the conflict.  Weak require and weak prohibit further complicate things with questionable benefits.

I would recommend to reconsider the introduction of this unusual and complicated 5-state system and only have binary REQUIRE on/off flag for each module. The build system would only include required modules and their prerequisites (everything else would be disabled). If there was any conflict of required modules then the build system would print an error message explaining why the combination is not feasible and the the developer would decide how to modify the requirements.

Instead of VTK checking PROHIBITED modules, the external project that uses VTK can inspect the list of modules and throw a fatal CMake error if it finds that a prohibited module got enabled (it can display a much more informative message than VTK could, explaining why that module is not supported and what to do about it). ATTEMPT and AVOID can be similarly handled in the external project by logging a warning if the resulting module list is not optimal.

During configuration, a dependency graph can be printed (already available in CTK and used in most CTK-based projects for external project dependencies) to show how a component brings in other components. This helps the developer in deciding which modules to disable to get rid of prohibited or undesired modules.

Andras

________________________________
From: David Thompson via vtk-developers <vtk-developers at vtk.org>
Sent: Friday, February 1, 2019 6:13 PM
To: Ben Boeckel
Cc: VTK Developers; David Gobbi
Subject: Re: [vtk-developers] [ANNOUNCE] New module system landing

REQUIRE/ATTEMPT/AVOID/FORBID make the most sense to me.  I could also come up with quite a few alternate words for each option if you like... :-)

  YES = REQUIRE = FORCE = ENABLE = NEED = COMPEL = INCLUDE
  WANT = ATTEMPT = TRY = PREFER = YEARN_FOR
  DONT_WANT = AVOID = CANCEL = UNWANTED = SHUN
  NO = FORBID = DISABLE = REJECT = DISQUALIFY = PREVENT = EXCLUDE

It would be nice, as David Gobbi suggested, to warn when option-valued cache variables are set to a string that is not an accepted option.

        2 cents,
        David

> On Feb 1, 2019, at 15:08, Ben Boeckel via vtk-developers <vtk-developers at vtk.org> wrote:
>
> On Fri, Feb 01, 2019 at 12:26:18 -0700, David Gobbi wrote:
>> On Fri, Feb 1, 2019 at 11:58 AM Ben Boeckel <ben.boeckel at kitware.com> wrote:
>>> It was partially done to get
>>> away from the default verbiage of `option` which uses `ON/OFF` since it
>>> isn't really a CMake boolean.
>>
>> That's like saying that if we use "0" and "1" as binary digits, we have
>> to make up new names/symbols for 0 and 1 when using decimal...
>
> Should they instead be called `MUST_BUILD` and `CANNOT_BUILD` to avoid
> all ambiguity? One other difference is actually that the old `ON/OFF` is
> actually `YES/DONT_WANT` in the new module system since telling the old
> system `OFF` didn't prevent the building of the module whereas `NO`
> errors out if it would otherwise be built. So it's might be closer to
> "0" and "1" in binary meaning "0" and "3" in the decimal…
>
> --Ben
> _______________________________________________
> Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C23e88c28e7ee46a295b108d6889ae727%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636846596236015007&sdata=JGapPaKlZ7cEOV1e2SatYlrHviMPKPEwGEZs5vCLL88%3D&reserved=0
>
> Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C23e88c28e7ee46a295b108d6889ae727%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636846596236015007&sdata=m42wtyfgU7%2Fjp9Ne%2BnTSBTDVAZvqLBMUR2Kxue4l%2FVo%3D&reserved=0
>
> Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtk-developers&data=02%7C01%7Classo%40queensu.ca%7C23e88c28e7ee46a295b108d6889ae727%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636846596236015007&sdata=Ipjix3uMf8YTXyvxWbo1QCX7u5O1mQfLg%2BlMHmKQrrU%3D&reserved=0
>
> Follow this link to subscribe/unsubscribe:
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtk-developers&data=02%7C01%7Classo%40queensu.ca%7C23e88c28e7ee46a295b108d6889ae727%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636846596236015007&sdata=%2BD4ROfnINvZdHF8SI5B8dT4QJr%2BpmFTTF1I3MVu%2BH%2Bc%3D&reserved=0
>

_______________________________________________
Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C23e88c28e7ee46a295b108d6889ae727%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636846596236015007&sdata=JGapPaKlZ7cEOV1e2SatYlrHviMPKPEwGEZs5vCLL88%3D&reserved=0

Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C23e88c28e7ee46a295b108d6889ae727%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636846596236015007&sdata=m42wtyfgU7%2Fjp9Ne%2BnTSBTDVAZvqLBMUR2Kxue4l%2FVo%3D&reserved=0

Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtk-developers&data=02%7C01%7Classo%40queensu.ca%7C23e88c28e7ee46a295b108d6889ae727%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636846596236015007&sdata=Ipjix3uMf8YTXyvxWbo1QCX7u5O1mQfLg%2BlMHmKQrrU%3D&reserved=0

Follow this link to subscribe/unsubscribe:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtk-developers&data=02%7C01%7Classo%40queensu.ca%7C23e88c28e7ee46a295b108d6889ae727%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636846596236015007&sdata=%2BD4ROfnINvZdHF8SI5B8dT4QJr%2BpmFTTF1I3MVu%2BH%2Bc%3D&reserved=0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtk-developers/attachments/20190203/ac0b57af/attachment.html>


More information about the vtk-developers mailing list