Skip to content

Conversation

@bellenot
Copy link
Member

@bellenot bellenot commented Nov 7, 2025

This PR fixes #20312
Fixes the following warnings:

2328: Warning in <TStreamerInfo::Build>: _Complex_base<double,_C_double_complex>: base class _C_double_complex has no streamer or dictionary it will not be saved
2328: Warning in <TStreamerInfo::Build>: complex<double>: base class _Complex_base<double,_C_double_complex> has no streamer or dictionary it will not be saved

@bellenot bellenot requested review from linev and removed request for dpiparo and pcanal November 7, 2025 13:37
@bellenot bellenot self-assigned this Nov 7, 2025
@bellenot bellenot requested a review from pcanal November 7, 2025 13:37
@linev
Copy link
Member

linev commented Nov 7, 2025

If problem resolved one can remove special windows ref files.

@bellenot
Copy link
Member Author

bellenot commented Nov 7, 2025

If problem resolved one can remove special windows ref files.

Oh right, indeed, thanks!

Copy link
Member

@linev linev left a comment

Choose a reason for hiding this comment

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

For me changes are fine, but probably @pcanal want comment as well

@linev
Copy link
Member

linev commented Nov 7, 2025

Seems to be all tests from roottest/root/io/complex no longer failing on Windows.
One need to remove ${WILLFAIL_ON_WIN32} there

#pragma extra_include "root_std_complex.h";

#ifdef _WIN32
#pragma create TClass _C_float_complex+;
Copy link
Member

Choose a reason for hiding this comment

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

This does remove the warnings by generating the dictionary but I think this results in files that are not readable on Linux. I.e. one might not be able to load the std::complex from the Windows produce file into the Linux std::complex object.

For example, contrast he output of:

TClass::GetClass("std::complex<int>")->GetStreamerInfo()->ls();

on both platform.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll check

Copy link
Member Author

@bellenot bellenot Nov 7, 2025

Choose a reason for hiding this comment

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

So here is the output on Windows:

C:\root-dev\build\x64\relwithdebinfo>root -l
root [0] TClass::GetClass("std::complex<int>")->GetStreamerInfo()->ls();

StreamerInfo for class: complex<int>, checksum=0x1bd95fcc
  _Complex_base<int,_Complex_value<int> > BASE            offset=  0 type= 0
  int            _real           offset=  0 type= 3
  int            _imag           offset=  4 type= 3
   i= 0, _Complex_base<int,_Complex_value<int> > type=  0, offset=  0, len=1, method=0
   i= 1, _real           type= 23, offset=  0, len=2, method=0 [optimized]
root [1]

I'll try on Linux once the build is over (on a VM with 4 cores...)

Copy link
Member Author

Choose a reason for hiding this comment

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

On Linux:

[bellenot@alma9-bb relwithdebinfo]$ root -l
root [0] TClass::GetClass("std::complex<int>")->GetStreamerInfo()->ls();

StreamerInfo for class: complex<int>, checksum=0x55a2a7c3
  int            _real           offset=  0 type= 3
  int            _imag           offset=  4 type= 3
   i= 0, _real           type= 23, offset=  0, len=2, method=0 [optimized]
root [1]

So if I understand correctly, this PR solves std::complex on Windows, but makes it incompatible with other platforms.
Then what do you suggest?

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Test Results

    22 files      22 suites   3d 18h 42m 58s ⏱️
 3 739 tests  3 735 ✅   2 💤 2 ❌
80 304 runs  80 098 ✅ 202 💤 4 ❌

For more details on these failures, see this check.

Results for commit d7372e1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for std::complex on Windows

3 participants