Project

General

Profile

Support #16112

Support #16096: Fix problems found when attempting to build with gcc 6.3.0

larcore/CoreUtils/RealComparisons.h fails to compile with gcc 6.3.0

Added by Lynn Garren over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Library
Target version:
-
Start date:
04/05/2017
Due date:
% Done:

100%

Estimated time:
Spent time:
Experiment:
LArSoft
Co-Assignees:
Duration:

Description

larcore/CoreUtils/RealComparisons.h fails with the following error:

[100%] Building CXX object larcore/test/CoreUtils/CMakeFiles/RealComparisons_test.dir/RealComparisons_test.cc.o
In file included from /home/garren/scratch/larsoft/dev/srcs/larcore/test/CoreUtils/RealComparisons_test.cc:15:0:
/home/garren/scratch/larsoft/dev/srcs/larcore/larcore/CoreUtils/RealComparisons.h: In instantiation of ‘constexpr bool lar::util::RealComparisons<RealType>::zero(lar::util::RealComparisons<RealType>::Value_t) const [with RealType = float; lar::util::RealComparisons<RealType>::Value_t = float]’:
/home/garren/scratch/larsoft/dev/srcs/larcore/test/CoreUtils/RealComparisons_test.cc:32:3:   required from here
/home/garren/scratch/larsoft/dev/srcs/larcore/larcore/CoreUtils/RealComparisons.h:70:26: error: call of overloaded ‘abs(lar::util::RealComparisons<float>::Value_t&)’ is ambiguous
         { return std::abs(value) <= threshold; }
                  ~~~~~~~~^~~~~~~
In file included from /products/boost/v1_63_0a/Linux64bit+3.10-2.17-e14-prof/include/boost/config/platform/linux.hpp:15:0,
                 from /products/boost/v1_63_0a/Linux64bit+3.10-2.17-e14-prof/include/boost/config.hpp:57,
                 from /products/boost/v1_63_0a/Linux64bit+3.10-2.17-e14-prof/include/boost/test/test_tools.hpp:17,
                 from /products/boost/v1_63_0a/Linux64bit+3.10-2.17-e14-prof/include/boost/test/unit_test.hpp:18,
                 from /products/cetlib/v2_03_00/slf7.x86_64.e14.prof/include/cetlib/quiet_unit_test.hpp:13,
                 from /home/garren/scratch/larsoft/dev/srcs/larcore/test/CoreUtils/RealComparisons_test.cc:11:
/products/gcc/v6_3_0/Linux64bit+3.10-2.17/include/c++/6.3.0/cstdlib:172:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
In file included from /products/gcc/v6_3_0/Linux64bit+3.10-2.17/include/c++/6.3.0/cstdlib:75:0,
                 from /products/boost/v1_63_0a/Linux64bit+3.10-2.17-e14-prof/include/boost/config/platform/linux.hpp:15,
                 from /products/boost/v1_63_0a/Linux64bit+3.10-2.17-e14-prof/include/boost/config.hpp:57,
                 from /products/boost/v1_63_0a/Linux64bit+3.10-2.17-e14-prof/include/boost/test/test_tools.hpp:17,
                 from /products/boost/v1_63_0a/Linux64bit+3.10-2.17-e14-prof/include/boost/test/unit_test.hpp:18,
                 from /products/cetlib/v2_03_00/slf7.x86_64.e14.prof/include/cetlib/quiet_unit_test.hpp:13,
                 from /home/garren/scratch/larsoft/dev/srcs/larcore/test/CoreUtils/RealComparisons_test.cc:11:
/usr/include/stdlib.h:770:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
In file included from /products/boost/v1_63_0a/Linux64bit+3.10-2.17-e14-prof/include/boost/config/platform/linux.hpp:15:0,
                 from /products/boost/v1_63_0a/Linux64bit+3.10-2.17-e14-prof/include/boost/config.hpp:57,
                 from /products/boost/v1_63_0a/Linux64bit+3.10-2.17-e14-prof/include/boost/test/test_tools.hpp:17,
                 from /products/boost/v1_63_0a/Linux64bit+3.10-2.17-e14-prof/include/boost/test/unit_test.hpp:18,
                 from /products/cetlib/v2_03_00/slf7.x86_64.e14.prof/include/cetlib/quiet_unit_test.hpp:13,
                 from /home/garren/scratch/larsoft/dev/srcs/larcore/test/CoreUtils/RealComparisons_test.cc:11:
/products/gcc/v6_3_0/Linux64bit+3.10-2.17/include/c++/6.3.0/cstdlib:180:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~

Associated revisions

Revision a0954652 (diff)
Added by Gianluca Petrillo over 2 years ago

Added missing headers. Solves issue #16112 .

Revision 81437da1 (diff)
Added by Gianluca Petrillo over 2 years ago

Added missing headers. Solves issue #16112 .

Revision e3dffbb2 (diff)
Added by Gianluca Petrillo over 2 years ago

Added missing headers. Solves issue #16112 .

Revision 00d8054e (diff)
Added by Gianluca Petrillo over 2 years ago

Added missing headers. Solves issue #16112 .

History

#1 Updated by Gianluca Petrillo over 2 years ago

  • Category set to Other
  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Solved in the feature branch, commit larcore:a095465289abb80b5e734c00c6d5c7b563e58618 .

#2 Updated by Gianluca Petrillo over 2 years ago

  • Category changed from Other to Library

#3 Updated by Lynn Garren over 2 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF