acts-project / acts-project/acts

clang21/22 compilation issue with CMAKE_CXX_STANDARD=23

未關閉
#5,187 12 則留言 0 個 reaction 已指派 1 人 已被 @paulgessinger 認領 在 GitHub 檢視
Stale
主要語言
C++
星號
131
分支
276
平均合併
3 天 13 小時
30 天內合併 PR
112

描述

Hi,

while doing compilation tests of AthenaExternals/Athena with clang21 and clang22 I ran into a compilation issue with ACTS and CMAKE_CXX_STANDARD=23 while this works fine with CMAKE_CXX_STANDARD=20 (or also with gcc15):
```
In file included from /build1/elmsheus/clang21_20260303/build/build/AthenaExternals/src/Acts/Core/include/Acts/Geometry/CylinderLayer.hpp:12:
In file included from /build1/elmsheus/clang21_20260303/build/build/AthenaExternals/src/Acts/Core/include/Acts/Geometry/ApproachDescriptor.hpp:13:
In file included from /build1/elmsheus/clang21_20260303/build/build/AthenaExternals/src/Acts/Core/include/Acts/Propagator/NavigationTarget.hpp:11:
In file included from /build1/elmsheus/clang21_20260303/build/build/AthenaExternals/src/Acts/Core/include/Acts/Geometry/BoundarySurfaceT.hpp:14:
In file included from /build1/elmsheus/clang21_20260303/build/build/AthenaExternals/src/Acts/Core/include/Acts/Surfaces/RegularSurface.hpp:12:
In file included from /build1/elmsheus/clang21_20260303/build/build/AthenaExternals/src/Acts/Core/include/Acts/Surfaces/Surface.hpp:18:
In file included from /build1/elmsheus/clang21_20260303/build/build/AthenaExternals/src/Acts/Core/include/Acts/Geometry/Polyhedron.hpp:12:
In file included from /build1/elmsheus/clang21_20260303/build/build/AthenaExternals/src/Acts/Core/include/Acts/Geometry/Extent.hpp:16:
In file included from /build1/elmsheus/clang21_20260303/build/build/AthenaExternals/src/Acts/Core/include/Acts/Utilities/Helpers.hpp:18:
In file included from /cvmfs/sft.cern.ch/lcg/contrib/gcc/14.2.0/x86_64-el9/lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../include/c++/14.2.0/memory:78:
/cvmfs/sft.cern.ch/lcg/contrib/gcc/14.2.0/x86_64-el9/lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../include/c++/14.2.0/bits/unique_ptr.h:91:16: error: invalid application of 'sizeof' to an incomplete type 'Acts::SurfaceArray'
91 | static_assert(sizeof(_Tp)>0,
| ^~~~~~~~~~~
/cvmfs/sft.cern.ch/lcg/contrib/gcc/14.2.0/x86_64-el9/lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../include/c++/14.2.0/bits/unique_ptr.h:398:4: note: in instantiation of member function 'std::default_delete::operator()' requested here
398 | get_deleter()(std::move(__ptr));
| ^
/build1/elmsheus/clang21_20260303/build/build/AthenaExternals/src/Acts/Core/include/Acts/Geometry/CylinderLayer.hpp:47:52: note: in instantiation of member function 'std::unique_ptr::~unique_ptr' requested here
47 | std::unique_ptr surfaceArray = nullptr,
| ^
/build1/elmsheus/clang21_20260303/build/build/AthenaExternals/src/Acts/Core/include/Acts/Geometry/Layer.hpp:29:7: note: forward declaration of 'Acts::SurfaceArray'
29 | class SurfaceArray;
| ^
```

Here is how to reproduce it when compiling the full AthenaExternals (with some patch for Gaudi):
```
$ ssh myfastmachine.cern.ch
$ setupATLAS
$ asetup none,clang21,opt,cmakesetup,cuda --cmakeversion=4.2.1 --cudaversion=13.1
$ export AtlasExternals_REF=origin/gaudi_gcc15_20260302
$ export AtlasExternals_URL=https://gitlab.cern.ch/elmsheus/atlasexternals.git
$ export TDAQ_PLATFORM=x86_64-el9-gcc14-opt
$ export LCG_PLATFORM=x86_64-el9-gcc14-opt
$ CFLAGS="-Wno-deprecated-builtins" CXXFLAGS="-Wno-deprecated-builtins" ./athena/Projects/Athena/build_externals.sh -c -t Release -x -DATLAS_ONNXRUNTIME_SOURCE="URL;https://atlas-software-dist-eos.web.cern.ch/externals/onnxruntime/onnxruntime-linux-x64-gpu_cuda13-1.24.2.tgz" -x -DATLAS_GEANT4_USE_LTO=FALSE -x -DATLAS_VECGEOM_USE_LTO=FALSE -x -DCMAKE_CXX_STANDARD=23 -x -DCMAKE_CUDA_STANDARD=20 > external.log 2>&1 &
```

**Edit**: I think you will need in addition MR https://gitlab.cern.ch/gaudi/Gaudi/-/merge_requests/1900 for Gaudi, but I hope ACTS will fail early enough to demonstrate the problem ....

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。