root icon indicating copy to clipboard operation
root copied to clipboard

[cmake] explicit feature=OFF should have hierarchical priority over cached or explicit builtin_feature=ON v2

Open ferdymercury opened this issue 8 months ago • 4 comments

This Pull request:

Changes or fixes:

This is v2 of https://github.com/root-project/root/pull/18413

Fixes https://its.cern.ch/jira/browse/ROOT-10743

Related:

https://its.cern.ch/jira/browse/ROOT-9385

Checklist:

  • [ ] tested changes locally
  • [ ] updated the docs (if necessary)

ferdymercury avatar Apr 22 '25 18:04 ferdymercury

@pcanal I have tried to follow your suggestion.

My question now is, how do I prevent enabling fftw3=ON if I passed explicitly -Dfftw3=OFF ?

Right now the sequence

cmake -Dbuiltin_fftw3=ON ../root_src/
cmake -Dfftw3=OFF ../root_src/

still leaves fftw3 ON.

Do I need to do something like https://stackoverflow.com/a/54302498/7471760 or rather https://stackoverflow.com/a/61986176/7471760?

Sth like:

if (NOT fftw3 and NOT DEFINED CACHE{builtin_fftw3})
   set(fftw3 CACHE BOOL ON FORCE)
endif()

ferdymercury avatar Apr 22 '25 18:04 ferdymercury

Try without the FORCE ...

pcanal avatar Apr 22 '25 19:04 pcanal

Test Results

    18 files      18 suites   3d 23h 20m 26s ⏱️  2 731 tests  2 730 ✅ 0 💤 1 ❌ 47 771 runs  47 770 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 4a847a9f.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Apr 22 '25 21:04 github-actions[bot]

Try without the FORCE ...

I tried and it does not solve the issue. Probably because the default option fftw3=OFF, so that has priority over the cache?

So without force -Dbuiltin_fftw3=ON does not turn fftw3=ON.

I tried also NOT DEFINED CACHE, to no avail.

It seems that this post is relevant: https://stackoverflow.com/questions/43542381/set-a-cmake-variable-if-it-is-not-changed-by-the-user

But then we are back to the debate... is this extra complexity worth or can we stick with v1 https://github.com/root-project/root/pull/18413?

ferdymercury avatar Apr 23 '25 09:04 ferdymercury