Skip to content

Commit

Permalink
fix: Do not use requires in class EDM definition (acts-project#3731)
Browse files Browse the repository at this point in the history
It looks like this is creating issues in Athena with
```console
In file included from libActsEventDict dictionary payload:146:
In file included from /cvmfs/atlas-nightlies.cern.ch/repo/sw/main--ACTS_Athena_x86_64-el9-gcc13-opt/2024-10-09T2101/Athena/25.0.20/InstallArea/x86_64-el9-gcc13-opt/include/ActsEvent/Seed.h:8:
/cvmfs/atlas-nightlies.cern.ch/repo/sw/main--ACTS_Athena_x86_64-el9-gcc13-opt/2024-10-09T2101/AthenaExternals/25.0.20/InstallArea/x86_64-el9-gcc13-opt/include/Acts/Acts/EventData/Seed.hpp:17:11: error: requires clause differs in template redeclaration
  requires(N >= 3ul)
          ^
Forward declarations from /cvmfs/atlas-nightlies.cern.ch/repo/sw/main--ACTS_Athena_x86_64-el9-gcc13-opt/2024-10-09T2101/Athena/25.0.20/InstallArea/x86_64-el9-gcc13-opt/lib/Athena.rootmap:773:18: note: previous template declaration is here
namespace Acts { template <typename external_spacepoint_t, size_t> class Seed; }
```

/cc @krasznaa 

@Ragansu and @Corentin-Allaire managed to make it work by:
> removed requires(N >= 3ul) in Seed.h and Seed.ipp and recompiled ACTS
> commented out parts in CxxUtils.h which delt with std::range when __cling__ is enabled. and recompiled Athena with a modified Package Filter.

Quoting:
> For information I think part of the issue might be that Cling doesn't like the requiere in the seed definition:
> The other issue seem to be that athena redefine the std::range::end function when Cling is used (in CxxUtils/range). Probably because it was not implemented before, but now this create a conflict with newer root version I guess ?  

See: https://atlas-art-data.web.cern.ch/atlas-art-data/grid-output/main/Athena/x86_64-el9-gcc13-opt/2024-10-08T2101/InDetPhysValMonitoring/test_run4_acts_vertex_PU200/tarball_logs/payload.stdout 

Co-authored-by: Pierfrancesco Butti <[email protected]>
  • Loading branch information
2 people authored and Rosie-Hasan committed Nov 13, 2024
1 parent 69a8cb4 commit f88430f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Core/include/Acts/EventData/Seed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
namespace Acts {

template <typename external_spacepoint_t, std::size_t N = 3ul>
requires(N >= 3ul)
class Seed {
static_assert(N >= 3ul);

public:
using value_type = external_spacepoint_t;
static constexpr std::size_t DIM = N;
Expand Down
6 changes: 0 additions & 6 deletions Core/include/Acts/EventData/Seed.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,34 @@
namespace Acts {

template <typename external_spacepoint_t, std::size_t N>
requires(N >= 3ul)
template <typename... args_t>
requires(sizeof...(args_t) == N) &&
(std::same_as<external_spacepoint_t, args_t> && ...)
Seed<external_spacepoint_t, N>::Seed(const args_t&... points)
: m_spacepoints({&points...}) {}

template <typename external_spacepoint_t, std::size_t N>
requires(N >= 3ul)
void Seed<external_spacepoint_t, N>::setVertexZ(float vertex) {
m_vertexZ = vertex;
}

template <typename external_spacepoint_t, std::size_t N>
requires(N >= 3ul)
void Seed<external_spacepoint_t, N>::setQuality(float seedQuality) {
m_seedQuality = seedQuality;
}

template <typename external_spacepoint_t, std::size_t N>
requires(N >= 3ul)
const std::array<const external_spacepoint_t*, N>&
Seed<external_spacepoint_t, N>::sp() const {
return m_spacepoints;
}

template <typename external_spacepoint_t, std::size_t N>
requires(N >= 3ul)
float Seed<external_spacepoint_t, N>::z() const {
return m_vertexZ;
}

template <typename external_spacepoint_t, std::size_t N>
requires(N >= 3ul)
float Seed<external_spacepoint_t, N>::seedQuality() const {
return m_seedQuality;
}
Expand Down

0 comments on commit f88430f

Please sign in to comment.