Skip to content

[cmake] move ExternalProject_Add to subdir for consistency, and define proper GSL,FFTW,TBB targets#21904

Open
ferdymercury wants to merge 7 commits intoroot-project:masterfrom
ferdymercury:builtinsub
Open

[cmake] move ExternalProject_Add to subdir for consistency, and define proper GSL,FFTW,TBB targets#21904
ferdymercury wants to merge 7 commits intoroot-project:masterfrom
ferdymercury:builtinsub

Conversation

@ferdymercury
Copy link
Copy Markdown
Collaborator

Try unbloating the huge SearchInstalledSoftware
and use always subdirs for ExternalProject_Add for symmetry with other builtins

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

Test Results

    15 files      15 suites   2d 2h 6m 13s ⏱️
 3 808 tests  3 807 ✅ 0 💤 1 ❌
51 104 runs  51 103 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 070cca6.

♻️ This comment has been updated with latest results.

@ferdymercury ferdymercury changed the title [cmake] move ExternalProject_Add to subdir for consistency [cmake] move ExternalProject_Add to subdir for consistency, and define proper GSL target Apr 13, 2026
@ferdymercury ferdymercury changed the title [cmake] move ExternalProject_Add to subdir for consistency, and define proper GSL target [cmake] move ExternalProject_Add to subdir for consistency, and define proper GSL,FFTW targets Apr 13, 2026
@ferdymercury ferdymercury changed the title [cmake] move ExternalProject_Add to subdir for consistency, and define proper GSL,FFTW targets [cmake] move ExternalProject_Add to subdir for consistency, and define proper GSL,FFTW,TBB targets Apr 14, 2026
@ferdymercury ferdymercury marked this pull request as ready for review April 14, 2026 10:08
@ferdymercury
Copy link
Copy Markdown
Collaborator Author

@bellenot could you let me know what is the contents (filenames) inside:

C:/libs/x64/fftw/3.3.5/lib on the Windows runners?

Or alternatively, what targets are defined once you run find_package with the new FindFFTW.cmake script in this branch ?

@bellenot
Copy link
Copy Markdown
Member

@ferdymercury here is the content of C:\libs\x64\fftw\3.3.5\lib:

 Directory of C:\libs\x64\fftw\3.3.5\lib

10/11/2025  13:17    <DIR>          .
10/11/2025  13:17    <DIR>          ..
04/03/2022  11:47           238,966 fftw3-3.lib
03/03/2022  09:13           241,990 libfftw3-3.lib
03/03/2022  09:13           247,600 libfftw3f-3.lib
03/03/2022  09:13           149,230 libfftw3l-3.lib
               4 File(s)        877,786 bytes
               2 Dir(s)  73,924,689,920 bytes free

And I'll try your branch...

@bellenot
Copy link
Copy Markdown
Member

@ferdymercury BTW, what is the problem with FFTW?

@bellenot
Copy link
Copy Markdown
Member

And here is what CMake finds:
image

@bellenot
Copy link
Copy Markdown
Member

bellenot commented Apr 14, 2026

Here are (some of) the errors on Windows:

[...]
    Exit code 0xc0000135
    Exit code 0xc0000135
    Exit code 0xc0000135
  C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'C:\ROOT-CI\build\CMakeFiles\d062ca236c6013e32d1af865d69dc514\G__RooFitJSONInterface.cxx.rule;C:\ROOT-CI\src\roofit\jsoninterface\CMakeLists.txt' exited with code 1. [C:\ROOT-CI\build\roofit\jsoninterface\G__RooFitJSONInterface.vcxproj]
    Generating G__ROOTGpadv7.cxx, ../../bin/libROOTGpadv7_rdict.pcm, ../../bin/libROOTGpadv7.rootmap
  C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'C:\ROOT-CI\build\CMakeFiles\9c31611484f5c242b181395c24233222\DataFrameSnapshotUtils.cxx.rule;C:\ROOT-CI\src\tree\dataframe\test\CMakeLists.txt' exited with code 1. [C:\ROOT-CI\build\tree\dataframe\test\DataFrameSnapshotUtils.vcxproj]
    Generating RXTupleDict.cxx, libntuple_compat_rdict.pcm, libntuple_compat.rootmap
  C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'C:\ROOT-CI\build\CMakeFiles\4216675670bde90fccb32452aa24052b\G__XMLParser.cxx.rule;C:\ROOT-CI\src\io\xmlparser\CMakeLists.txt' exited with code 1. [C:\ROOT-CI\build\io\xmlparser\G__XMLParser.vcxproj]
    Exit code 0xc0000135
    Exit code 0xc0000135
[...]

Hard to tell where they are coming from (i.e, which DLL is not found). I'll have to debug it locally

@ferdymercury
Copy link
Copy Markdown
Collaborator Author

ferdymercury commented Apr 14, 2026

what is the problem with FFTW?

The current FindFFTW.cmake did not define a proper target so I borrowed a more up-to-date one by @egpbos but it seems it had a bug for Win32. I just fixed it so that it now finds all variants of FFTW3 correctly on Windows.

@bellenot
Copy link
Copy Markdown
Member

@ferdymercury FYI the issue is coming from TBB. I'm looking into it

@ferdymercury ferdymercury added the clean build Ask CI to do non-incremental build on PR label Apr 15, 2026
@ferdymercury ferdymercury force-pushed the builtinsub branch 2 times, most recently from 19375c8 to 63ee525 Compare April 15, 2026 07:23
@ferdymercury ferdymercury removed the clean build Ask CI to do non-incremental build on PR label Apr 15, 2026
@ferdymercury ferdymercury force-pushed the builtinsub branch 2 times, most recently from c64b541 to 113a3d3 Compare April 15, 2026 07:49
Copy link
Copy Markdown
Member

@hageboeck hageboeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good opportunity to make the builtins conform to what find modules would output. This means that we need to set the following variables (from here):

Xxx_INCLUDE_DIRS
Xxx_LIBRARIES

We also need to remember that:

  • They must not be CACHE variables
  • And they need to be set in the PARENT_SCOPE now that they are in subdirectories

I see that for some deps, this is done, for others it's not, so we have a chance now to unify this.

@@ -0,0 +1,17 @@
set(FFTW_VERSION 3.3.10)
message(STATUS "Downloading and building FFTW version ${FFTW_VERSION}")
set(FFTW_LIBRARIES ${CMAKE_BINARY_DIR}/lib/libfftw3.a)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be set also in the PARENT_SCOPE when it's moved into a subdirectory.

BUILD_BYPRODUCTS ${FFTW_LIBRARIES}
TIMEOUT 600
)
set(FFTW_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include PARENT_SCOPE)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to set FFTW_INCLUDE_DIRS in the parent scope.

Co-authored-by: Bertrand Bellenot <bellenot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants