Skip to content

Conversation

@JGCarroll
Copy link
Contributor

On the Snap build of ROOT, the parameters were assumed to be int, double

Errors from build log, running Ubuntu 20.04 GCC9 C++17

/root/parts/root/src/roofit/xroofit/src/xRooNode.cxx:5778:105: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘double’)
 5778 |                                    : (h->GetBinContent(1) + std::max(abs(h->GetBinContent(1) * 0.1), 50.)));

This doesn't appear to occur in normal builds, but the guard code seems trivial enough to include and this may prevent compilation errors in other scenarios.

Checklist:

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

@phsft-bot
Copy link

Can one of the admins verify this patch?

Copy link
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

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

Hi @MrCarroll, thank you very much for your PR!

I think it would be better to address the underlying problem of why it thinks the first argument is an int. My suspicion is that the problem is the usage of abs and not std::abs, because abs has no overload for doubles. By passing a double to abs without std::, it gets rounded to an int depending on your environment. This is a bug that just casting back to double afterwards doesn't fix: you have to use the right std::abs function to begin with.

Can you please check if this makes sense, by trying my suggestion in your snap environment, and if it works update your PR?

Thanks again!

@guitargeek guitargeek changed the title rooFit: Prevent type inference confusion during compilation [RF] Prevent type inference confusion during compilation Jan 7, 2023
On the Snap build of ROOT, the parameters were assumed to be int, double
@guitargeek
Copy link
Contributor

@phsft-bot build

@phsft-bot
Copy link

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac12/noimt, mac11/cxx14, windows10/cxx14
How to customize builds

Copy link
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the fix!

@phsft-bot
Copy link

Build failed on ROOT-ubuntu18.04/nortcxxmod.
Running on sft-ubuntu-1804-2.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-01-07T20:09:26.258Z] /mnt/build/workspace/root-pullrequests-build/build/include/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:09:26.258Z] /mnt/build/workspace/root-pullrequests-build/build/include/ROOT/RCsvDS.hxx:112:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:09:26.258Z] /mnt/build/workspace/root-pullrequests-build/build/include/ROOT/RSqliteDS.hxx:117:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:09:26.259Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-07T20:09:26.259Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RCsvDS.hxx:114:114: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-07T20:09:26.259Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-07T20:09:26.522Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-07T20:09:26.522Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-07T20:09:26.522Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-07T20:09:26.522Z] /mnt/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]

And 60 more

Failing tests:

@phsft-bot
Copy link

Build failed on mac12/noimt.
Running on macphsft18.dyndns.cern.ch:/Users/sftnight/build/jenkins/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-01-07T20:12:16.627Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/build/include/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:12:16.627Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/build/include/ROOT/RCsvDS.hxx:112:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:12:16.627Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/build/include/ROOT/RSqliteDS.hxx:117:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:12:17.419Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:12:17.675Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:12:17.675Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:12:17.675Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:12:17.676Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:12:17.676Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:12:17.944Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]

And 53 more

Failing tests:

@phsft-bot
Copy link

Build failed on ROOT-performance-centos8-multicore/cxx17.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-01-07T20:17:09.721Z] /data/sftnight/workspace/root-pullrequests-build/build/include/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:17:11.531Z] /data/sftnight/workspace/root-pullrequests-build/build/include/ROOT/RCsvDS.hxx:112:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:17:11.531Z] /data/sftnight/workspace/root-pullrequests-build/build/include/ROOT/RSqliteDS.hxx:117:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:17:11.531Z] /data/sftnight/workspace/root-pullrequests-build/build/include/ROOT/RNTupleDS.hxx:96:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:17:11.531Z] /data/sftnight/workspace/root-pullrequests-build/build/include/ROOT/RNTupleDS.hxx:98:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:17:24.751Z] /data/sftnight/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:215:7: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-07T20:17:27.062Z] /data/sftnight/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RCsvDS.hxx:114:114: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-07T20:17:27.062Z] /data/sftnight/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RSqliteDS.hxx:118:81: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-07T20:17:27.062Z] /data/sftnight/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RNTupleDS.hxx:97:86: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-07T20:17:27.062Z] /data/sftnight/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RNTupleDS.hxx:99:47: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]

And 130 more

Failing tests:

@phsft-bot
Copy link

Build failed on mac11/cxx14.
Running on macphsft23.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-01-07T20:36:00.899Z] /Users/sftnight/build/workspace/root-pullrequests-build/build/include/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:36:00.900Z] /Users/sftnight/build/workspace/root-pullrequests-build/build/include/ROOT/RCsvDS.hxx:112:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:36:00.900Z] /Users/sftnight/build/workspace/root-pullrequests-build/build/include/ROOT/RSqliteDS.hxx:117:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:36:09.683Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:36:09.683Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:36:09.683Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RCsvDS.hxx:112:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:36:10.913Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:36:11.491Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:36:13.854Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-07T20:36:15.064Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RDataSource.hxx:213:11: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]

And 54 more

Failing tests:

@guitargeek guitargeek changed the title [RF] Prevent type inference confusion during compilation [RF] Prevent accidental casting from double to int in xroofit Jan 8, 2023
@guitargeek guitargeek merged commit d008860 into root-project:master Jan 8, 2023
@phsft-bot
Copy link

Build failed on ROOT-ubuntu2004/python3.
Running on root-ubuntu-2004-3.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-01-09T21:20:00.065Z] /home/sftnight/build/workspace/root-pullrequests-build/build/include/ROOT/RCsvDS.hxx:112:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-09T21:20:00.065Z] /home/sftnight/build/workspace/root-pullrequests-build/build/include/ROOT/RSqliteDS.hxx:117:1: warning: unknown attribute 'REMOVE_THIS_NOW' ignored [-Wunknown-attributes]
  • [2023-01-09T21:20:00.065Z] /home/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RCsvDS.hxx:114:114: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-09T21:20:00.065Z] /home/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RCsvDS.hxx:114:114: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-09T21:20:00.065Z] /home/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RSqliteDS.hxx:118:81: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-09T21:20:00.065Z] /home/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RSqliteDS.hxx:118:81: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-09T21:20:00.065Z] /home/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RCsvDS.hxx:114:114: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-09T21:20:00.065Z] /home/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RSqliteDS.hxx:118:81: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]
  • [2023-01-09T21:20:00.065Z] /home/sftnight/build/workspace/root-pullrequests-build/root/tree/dataframe/inc/ROOT/RCsvDS.hxx:114:114: warning: ‘REMOVE_THIS_NOW’ attribute directive ignored [-Wattributes]

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.

3 participants