diff --git a/Core/src/Visualization/ObjVisualization3D.cpp b/Core/src/Visualization/ObjVisualization3D.cpp index 777e883b3d3..6895ad56f03 100644 --- a/Core/src/Visualization/ObjVisualization3D.cpp +++ b/Core/src/Visualization/ObjVisualization3D.cpp @@ -63,7 +63,7 @@ void ObjVisualization3D::faces(const std::vector& vtxs, o.vertices.insert(o.vertices.end(), vtxs.begin(), vtxs.end()); for (const auto& face : faces) { if (face.size() == 2) { - o.lines.push_back({face[0] + vtxoffs, face[2] + vtxoffs}); + o.lines.push_back({face[0] + vtxoffs, face[1] + vtxoffs}); } else { FaceType rawFace; std::ranges::transform( diff --git a/Plugins/Json/src/DetrayJsonHelper.cpp b/Plugins/Json/src/DetrayJsonHelper.cpp index b04d3e62b11..d17e6cee1d5 100644 --- a/Plugins/Json/src/DetrayJsonHelper.cpp +++ b/Plugins/Json/src/DetrayJsonHelper.cpp @@ -6,6 +6,13 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. +// For whatever reason, this compilation unit does not compile +// with those assertions and GCC 13. For now just disable the +// flags in this case. +#if defined(_GLIBCXX_ASSERTIONS) && __GNUC__ == 13 +#undef _GLIBCXX_ASSERTIONS +#endif + #include "Acts/Plugins/Json/DetrayJsonHelper.hpp" namespace Acts::DetrayJsonHelper { diff --git a/Tests/UnitTests/Core/Utilities/AlgebraHelpersTests.cpp b/Tests/UnitTests/Core/Utilities/AlgebraHelpersTests.cpp index 87e47d3e3a9..a821682d795 100644 --- a/Tests/UnitTests/Core/Utilities/AlgebraHelpersTests.cpp +++ b/Tests/UnitTests/Core/Utilities/AlgebraHelpersTests.cpp @@ -82,18 +82,15 @@ BOOST_AUTO_TEST_CASE(SafeInverseFPESmallMatrix) { m(1, 1) = 1; auto mInv = Acts::safeInverse(m); + BOOST_REQUIRE(mInv.has_value()); auto mInvInv = Acts::safeInverse(*mInv); - - BOOST_CHECK(mInv); BOOST_CHECK(!mInvInv); ACTS_VERBOSE("Test: SafeInverseFPESmallMatrix" << "\n" << "m:\n" << m << "\n" << "mInv:\n" - << *mInv << "\n" - << "mInvInv [garbage]:\n" - << *mInvInv); + << *mInv); } BOOST_AUTO_TEST_CASE(SafeInverseFPELargeMatrix) { @@ -107,9 +104,7 @@ BOOST_AUTO_TEST_CASE(SafeInverseFPELargeMatrix) { ACTS_VERBOSE("Test: SafeInverseFPELargeMatrix" << "\n" << "m:\n" - << m << "\n" - << "mInv [garbage]:\n" - << *mInv); + << m); } /// This test should not compile diff --git a/cmake/ActsCompilerOptions.cmake b/cmake/ActsCompilerOptions.cmake index 64467c64665..44c215ca8d5 100644 --- a/cmake/ActsCompilerOptions.cmake +++ b/cmake/ActsCompilerOptions.cmake @@ -13,6 +13,11 @@ set(cxx_flags "-Wall -Wextra -Wpedantic -Wshadow -Wzero-as-null-pointer-constant -Wold-style-cast" ) +# Add assertions to standard libraries +if(ACTS_FORCE_ASSERTIONS) + set(cxx_flags "${cxx_flags} -D_GLIBCXX_ASSERTIONS -D_LIBCPP_DEBUG") +endif() + # This adds some useful conversion checks like float-to-bool, float-to-int, etc. # However, at the moment this is only added to clang builds, since GCC's -Wfloat-conversion # is much more aggressive and also triggers on e.g., double-to-float