crogine icon indicating copy to clipboard operation
crogine copied to clipboard

Build failure with gcc 15.2.1

Open mnhauke opened this issue 2 months ago • 9 comments

master fails to build on openSUSE Tumbleweed (gcc 15.2.1)

[   87s] cd /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/build/crogine && /usr/bin/c++ -DAL_AUDIO -DCRO_BUILD -Dcrogine_EXPORTS -I/usr/include/SDL2 -I/usr/include/freetype2 -I/usr/include/opus -I/home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/include -I/usr/include/AL -Wall -Wno-comment -std=c++17 -O3 -DNDEBUG -std=gnu++17 -fPIC -MD -MT crogine/CMakeFiles/crogine.dir/src/ecs/systems/ModelRenderer.cpp.o -MF CMakeFiles/crogine.dir/src/ecs/systems/ModelRenderer.cpp.o.d -o CMakeFiles/crogine.dir/src/ecs/systems/ModelRenderer.cpp.o -c /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/src/ecs/systems/ModelRenderer.cpp
[   88s] In file included from /usr/include/c++/15/bits/stl_algobase.h:71,
[   88s]                  from /usr/include/c++/15/string:53,
[   88s]                  from /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/src/ecs/systems/../../graphics/shaders/Unlit.hpp:32,
[   88s]                  from /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/src/ecs/systems/ModelRenderer.cpp:30:
[   88s] /usr/include/c++/15/bits/predefined_ops.h: In instantiation of ‘bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = const std::pair<cro::Entity, cro::SortData>; _Iterator = __gnu_cxx::__normal_iterator<std::pair<cro::Entity, cro::SortData>*, std::vector<std::pair<cro::Entity, cro::SortData> > >; _Compare = cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>]’:
[   88s] /usr/include/c++/15/bits/stl_algo.h:1994:14:   required from ‘_ForwardIterator std::__upper_bound(_ForwardIterator, _ForwardIterator, const _Tp&, _Compare) [with _ForwardIterator = __gnu_cxx::__normal_iterator<pair<cro::Entity, cro::SortData>*, vector<pair<cro::Entity, cro::SortData> > >; _Tp = pair<cro::Entity, cro::SortData>; _Compare = __gnu_cxx::__ops::_Val_comp_iter<cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)> >]’
[   88s]  1994 |           if (__comp(__val, __middle))
[   88s]       |               ~~~~~~^~~~~~~~~~~~~~~~~
[   88s] /usr/include/c++/15/bits/stl_algo.h:2061:32:   required from ‘_FIter std::upper_bound(_FIter, _FIter, const _Tp&, _Compare) [with _FIter = __gnu_cxx::__normal_iterator<pair<cro::Entity, cro::SortData>*, vector<pair<cro::Entity, cro::SortData> > >; _Tp = pair<cro::Entity, cro::SortData>; _Compare = cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>]’
[   88s]  2061 |       return std::__upper_bound(__first, __last, __val,
[   88s]       |              ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
[   88s]  2062 |                                 __gnu_cxx::__ops::__val_comp_iter(__comp));
[   88s]       |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   88s] /usr/include/c++/15/pstl/parallel_backend_tbb.h:1030:40:   required from ‘__pstl::__tbb_backend::__task* __pstl::__tbb_backend::__merge_func<_RandomAccessIterator1, _RandomAccessIterator2, _Compare, _Cleanup, _LeafMerge>::split_merging(__pstl::__tbb_backend::__task*) [with _RandomAccessIterator1 = __gnu_cxx::__normal_iterator<std::pair<cro::Entity, cro::SortData>*, std::vector<std::pair<cro::Entity, cro::SortData> > >; _RandomAccessIterator2 = std::pair<cro::Entity, cro::SortData>*; _Compare = cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>; _Cleanup = __pstl::__utils::__serial_destroy; _LeafMerge = __pstl::__utils::__serial_move_merge]’
[   88s]  1030 |                 __xm = std::upper_bound(_M_x_beg + _M_xs, _M_x_beg + _M_xe, *(_M_x_beg + __ym), _M_comp) - _M_x_beg;
[   88s]       |                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   88s] /usr/include/c++/15/pstl/parallel_backend_tbb.h:939:20:   required from ‘__pstl::__tbb_backend::__task* __pstl::__tbb_backend::__merge_func<_RandomAccessIterator1, _RandomAccessIterator2, _Compare, _Cleanup, _LeafMerge>::merge_ranges(__pstl::__tbb_backend::__task*) [with _RandomAccessIterator1 = __gnu_cxx::__normal_iterator<std::pair<cro::Entity, cro::SortData>*, std::vector<std::pair<cro::Entity, cro::SortData> > >; _RandomAccessIterator2 = std::pair<cro::Entity, cro::SortData>*; _Compare = cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>; _Cleanup = __pstl::__utils::__serial_destroy; _LeafMerge = __pstl::__utils::__serial_move_merge]’
[   88s]   939 |             return split_merging(__self);
[   88s]       |                    ^~~~~~~~~~~~~
[   88s] /usr/include/c++/15/pstl/parallel_backend_tbb.h:1069:16:   required from ‘__pstl::__tbb_backend::__task* __pstl::__tbb_backend::__merge_func<_RandomAccessIterator1, _RandomAccessIterator2, _Compare, _Cleanup, _LeafMerge>::operator()(__pstl::__tbb_backend::__task*) [with _RandomAccessIterator1 = __gnu_cxx::__normal_iterator<std::pair<cro::Entity, cro::SortData>*, std::vector<std::pair<cro::Entity, cro::SortData> > >; _RandomAccessIterator2 = std::pair<cro::Entity, cro::SortData>*; _Compare = cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>; _Cleanup = __pstl::__utils::__serial_destroy; _LeafMerge = __pstl::__utils::__serial_move_merge]’
[   88s]  1069 |         return merge_ranges(__self);
[   88s]       |                ^~~~~~~~~~~~
[   88s] /usr/include/c++/15/pstl/parallel_backend_tbb.h:630:33:   required from ‘__pstl::__tbb_backend::__task* __pstl::__tbb_backend::__func_task<_Func>::execute(tbb::detail::d1::execution_data&) [with _Func = __pstl::__tbb_backend::__merge_func<__gnu_cxx::__normal_iterator<std::pair<cro::Entity, cro::SortData>*, std::vector<std::pair<cro::Entity, cro::SortData> > >, std::pair<cro::Entity, cro::SortData>*, cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>, __pstl::__utils::__serial_destroy, __pstl::__utils::__serial_move_merge>]’
[   88s]   630 |         __task* __next = _M_func(this);
[   88s]       |                          ~~~~~~~^~~~~~
[   88s] /usr/include/c++/15/pstl/parallel_backend_tbb.h:626:5:   required from here
[   88s]   626 |     execute(tbb::detail::d1::execution_data& __ed) override
[   88s]       |     ^~~~~~~
[   88s] /usr/include/c++/15/bits/predefined_ops.h:240:30: error: no match for call to ‘(cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>) (const std::pair<cro::Entity, cro::SortData>&, std::pair<cro::Entity, cro::SortData>&)’
[   88s]   240 |         { return bool(_M_comp(__val, *__it)); }
[   88s]       |                       ~~~~~~~^~~~~~~~~~~~~~
[   88s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/src/ecs/systems/ModelRenderer.cpp:236:14: note: there are 2 candidates
[   88s]   236 |             [](MaterialPair& a, MaterialPair& b)
[   88s]       |              ^
[   88s] /usr/include/c++/15/bits/predefined_ops.h:240:30: note: candidate 1: ‘bool (*)(cro::MaterialPair&, cro::MaterialPair&)’ {aka ‘bool (*)(std::pair<cro::Entity, cro::SortData>&, std::pair<cro::Entity, cro::SortData>&)’} (conversion)
[   88s]   240 |         { return bool(_M_comp(__val, *__it)); }
[   88s]       |                       ~~~~~~~^~~~~~~~~~~~~~
[   88s] /usr/include/c++/15/bits/predefined_ops.h:240:30: note: conversion of argument 2 would be ill-formed:
[   88s] /usr/include/c++/15/bits/predefined_ops.h:240:30: error: binding reference of type ‘cro::MaterialPair&’ {aka ‘std::pair<cro::Entity, cro::SortData>&’} to ‘const std::pair<cro::Entity, cro::SortData>’ discards qualifiers
[   88s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/src/ecs/systems/ModelRenderer.cpp:236:13: note: candidate 2: ‘cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>’ (near match)
[   88s]   236 |             [](MaterialPair& a, MaterialPair& b)
[   88s]       |             ^
[   88s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/src/ecs/systems/ModelRenderer.cpp:236:13: note: conversion of argument 1 would be ill-formed:
[   88s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/src/ecs/systems/ModelRenderer.cpp:236:13: error: binding reference of type ‘cro::MaterialPair&’ {aka ‘std::pair<cro::Entity, cro::SortData>&’} to ‘const std::pair<cro::Entity, cro::SortData>’ discards qualifiers
[   88s] /usr/include/c++/15/bits/predefined_ops.h: In instantiation of ‘bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = const std::pair<cro::Entity, cro::SortData>; _Iterator = std::pair<cro::Entity, cro::SortData>*; _Compare = cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>]’:
[   88s] /usr/include/c++/15/bits/stl_algo.h:1994:14:   required from ‘_ForwardIterator std::__upper_bound(_ForwardIterator, _ForwardIterator, const _Tp&, _Compare) [with _ForwardIterator = pair<cro::Entity, cro::SortData>*; _Tp = pair<cro::Entity, cro::SortData>; _Compare = __gnu_cxx::__ops::_Val_comp_iter<cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)> >]’
[   88s]  1994 |           if (__comp(__val, __middle))
[   88s]       |               ~~~~~~^~~~~~~~~~~~~~~~~
[   88s] /usr/include/c++/15/bits/stl_algo.h:2061:32:   required from ‘_FIter std::upper_bound(_FIter, _FIter, const _Tp&, _Compare) [with _FIter = pair<cro::Entity, cro::SortData>*; _Tp = pair<cro::Entity, cro::SortData>; _Compare = cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>]’
[   88s]  2061 |       return std::__upper_bound(__first, __last, __val,
[   88s]       |              ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
[   88s]  2062 |                                 __gnu_cxx::__ops::__val_comp_iter(__comp));
[   88s]       |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   88s] /usr/include/c++/15/pstl/parallel_backend_tbb.h:1032:40:   required from ‘__pstl::__tbb_backend::__task* __pstl::__tbb_backend::__merge_func<_RandomAccessIterator1, _RandomAccessIterator2, _Compare, _Cleanup, _LeafMerge>::split_merging(__pstl::__tbb_backend::__task*) [with _RandomAccessIterator1 = __gnu_cxx::__normal_iterator<std::pair<cro::Entity, cro::SortData>*, std::vector<std::pair<cro::Entity, cro::SortData> > >; _RandomAccessIterator2 = std::pair<cro::Entity, cro::SortData>*; _Compare = cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>; _Cleanup = __pstl::__utils::__serial_destroy; _LeafMerge = __pstl::__utils::__serial_move_merge]’
[   88s]  1032 |                 __xm = std::upper_bound(_M_z_beg + _M_xs, _M_z_beg + _M_xe, *(_M_z_beg + __ym), _M_comp) - _M_z_beg;
[   88s]       |                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   88s] /usr/include/c++/15/pstl/parallel_backend_tbb.h:939:20:   required from ‘__pstl::__tbb_backend::__task* __pstl::__tbb_backend::__merge_func<_RandomAccessIterator1, _RandomAccessIterator2, _Compare, _Cleanup, _LeafMerge>::merge_ranges(__pstl::__tbb_backend::__task*) [with _RandomAccessIterator1 = __gnu_cxx::__normal_iterator<std::pair<cro::Entity, cro::SortData>*, std::vector<std::pair<cro::Entity, cro::SortData> > >; _RandomAccessIterator2 = std::pair<cro::Entity, cro::SortData>*; _Compare = cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>; _Cleanup = __pstl::__utils::__serial_destroy; _LeafMerge = __pstl::__utils::__serial_move_merge]’
[   88s]   939 |             return split_merging(__self);
[   88s]       |                    ^~~~~~~~~~~~~
[   88s] /usr/include/c++/15/pstl/parallel_backend_tbb.h:1069:16:   required from ‘__pstl::__tbb_backend::__task* __pstl::__tbb_backend::__merge_func<_RandomAccessIterator1, _RandomAccessIterator2, _Compare, _Cleanup, _LeafMerge>::operator()(__pstl::__tbb_backend::__task*) [with _RandomAccessIterator1 = __gnu_cxx::__normal_iterator<std::pair<cro::Entity, cro::SortData>*, std::vector<std::pair<cro::Entity, cro::SortData> > >; _RandomAccessIterator2 = std::pair<cro::Entity, cro::SortData>*; _Compare = cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>; _Cleanup = __pstl::__utils::__serial_destroy; _LeafMerge = __pstl::__utils::__serial_move_merge]’
[   88s]  1069 |         return merge_ranges(__self);
[   88s]       |                ^~~~~~~~~~~~
[   88s] /usr/include/c++/15/pstl/parallel_backend_tbb.h:630:33:   required from ‘__pstl::__tbb_backend::__task* __pstl::__tbb_backend::__func_task<_Func>::execute(tbb::detail::d1::execution_data&) [with _Func = __pstl::__tbb_backend::__merge_func<__gnu_cxx::__normal_iterator<std::pair<cro::Entity, cro::SortData>*, std::vector<std::pair<cro::Entity, cro::SortData> > >, std::pair<cro::Entity, cro::SortData>*, cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>, __pstl::__utils::__serial_destroy, __pstl::__utils::__serial_move_merge>]’
[   88s]   630 |         __task* __next = _M_func(this);
[   88s]       |                          ~~~~~~~^~~~~~
[   88s] /usr/include/c++/15/pstl/parallel_backend_tbb.h:626:5:   required from here
[   88s]   626 |     execute(tbb::detail::d1::execution_data& __ed) override
[   88s]       |     ^~~~~~~
[   88s] /usr/include/c++/15/bits/predefined_ops.h:240:30: error: no match for call to ‘(cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>) (const std::pair<cro::Entity, cro::SortData>&, std::pair<cro::Entity, cro::SortData>&)’
[   88s]   240 |         { return bool(_M_comp(__val, *__it)); }
[   88s]       |                       ~~~~~~~^~~~~~~~~~~~~~
[   88s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/src/ecs/systems/ModelRenderer.cpp:236:14: note: there are 2 candidates
[   88s]   236 |             [](MaterialPair& a, MaterialPair& b)
[   88s]       |              ^
[   88s] /usr/include/c++/15/bits/predefined_ops.h:240:30: note: candidate 1: ‘bool (*)(cro::MaterialPair&, cro::MaterialPair&)’ {aka ‘bool (*)(std::pair<cro::Entity, cro::SortData>&, std::pair<cro::Entity, cro::SortData>&)’} (conversion)
[   88s]   240 |         { return bool(_M_comp(__val, *__it)); }
[   88s]       |                       ~~~~~~~^~~~~~~~~~~~~~
[   88s] /usr/include/c++/15/bits/predefined_ops.h:240:30: note: conversion of argument 2 would be ill-formed:
[   88s] /usr/include/c++/15/bits/predefined_ops.h:240:30: error: binding reference of type ‘cro::MaterialPair&’ {aka ‘std::pair<cro::Entity, cro::SortData>&’} to ‘const std::pair<cro::Entity, cro::SortData>’ discards qualifiers
[   88s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/src/ecs/systems/ModelRenderer.cpp:236:13: note: candidate 2: ‘cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>’ (near match)
[   88s]   236 |             [](MaterialPair& a, MaterialPair& b)
[   88s]       |             ^
[   88s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/src/ecs/systems/ModelRenderer.cpp:236:13: note: conversion of argument 1 would be ill-formed:
[   88s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/src/ecs/systems/ModelRenderer.cpp:236:13: error: binding reference of type ‘cro::MaterialPair&’ {aka ‘std::pair<cro::Entity, cro::SortData>&’} to ‘const std::pair<cro::Entity, cro::SortData>’ discards qualifiers
[   88s] /usr/include/c++/15/bits/predefined_ops.h: In instantiation of ‘bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = __gnu_cxx::__normal_iterator<std::pair<cro::Entity, cro::SortData>*, std::vector<std::pair<cro::Entity, cro::SortData> > >; _Value = const std::pair<cro::Entity, cro::SortData>; _Compare = cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)>]’:
[   88s] /usr/include/c++/15/bits/stl_algobase.h:1509:14:   required from ‘_ForwardIterator std::__lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&, _Compare) [with _ForwardIterator = __gnu_cxx::__normal_iterator<pair<cro::Entity, cro::SortData>*, vector<pair<cro::Entity, cro::SortData> > >; _Tp = pair<cro::Entity, cro::SortData>; _Compare = __gnu_cxx::__ops::_Iter_comp_val<cro::ModelRenderer::updateDrawList(cro::Entity)::<lambda(cro::MaterialPair&, cro::MaterialPair&)> >]’
[   88s]  1509 |           if (__comp(__middle, __val))
...

full buildlog: crogine-openSUSE-Tumbleweed-buildlog.txt

$ gcc --version
gcc (SUSE Linux) 15.2.1 20251006
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

mnhauke avatar Oct 18 '25 07:10 mnhauke

Hard to see, but I think it's to do with the parallel execution on the sort function. Make sure USE_PARALLEL_PROCESSING is defined (or try explicitly undefining it).

fallahn avatar Oct 18 '25 09:10 fallahn

Thanks. Undefining USE_PARALLEL_PROCESSING helped ...

diff --git a/crogine/src/ecs/systems/ModelRenderer.cpp b/crogine/src/ecs/systems/ModelRenderer.cpp
index efd79335c..370f53002 100644
--- a/crogine/src/ecs/systems/ModelRenderer.cpp
+++ b/crogine/src/ecs/systems/ModelRenderer.cpp
@@ -53,7 +53,7 @@ source distribution.
 #include <crogine/detail/glm/gtc/matrix_inverse.hpp>
 #include <crogine/detail/glm/gtx/norm.hpp>
 
-//#define PARALLEL_DISABLE
+#define PARALLEL_DISABLE
 #ifdef PARALLEL_DISABLE
 #undef USE_PARALLEL_PROCESSING
 #endif

Unfortunately the build now fails during the linking stage...

...
[100%] Linking CXX executable golf
/usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/golf.dir/src/sportsball/SBallPhysicsSystem.cpp.o: in function `SBallPhysicsSystem::process(float)':
SBallPhysicsSystem.cpp:(.text+0x7a7): undefined reference to `btRigidBody::setDamping(float, float)'
/usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld: SBallPhysicsSystem.cpp:(.text+0x7bd): undefined reference to `btRigidBody::setDamping(float, float)'
/usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/golf.dir/src/sportsball/SBallPhysicsSystem.cpp.o: in function `SBallPhysicsSystem::spawnBall(int, glm::vec<3, float, (glm::qualifier)0>)':
SBallPhysicsSystem.cpp:(.text+0x161c): undefined reference to `btRigidBody::setDamping(float, float)'
/usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/golf.dir/src/sportsball/SBallPhysicsSystem.cpp.o: in function `SBallPhysicsSystem::SBallPhysicsSystem(cro::MessageBus&)':
SBallPhysicsSystem.cpp:(.text+0x17e1): undefined reference to `btStaticPlaneShape::btStaticPlaneShape(btVector3 const&, float)'
/usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld: SBallPhysicsSystem.cpp:(.text+0x180a): undefined reference to `btStaticPlaneShape::btStaticPlaneShape(btVector3 const&, float)'
/usr/lib64/gcc/x86_64-suse-linux/15/../../../../x86_64-suse-linux/bin/ld: SBallPhysicsSystem.cpp:(.text+0x182e): undefined reference to `btStaticPlaneShape::btStaticPlaneShape(btVector3 const&, float)'
collect2: error: ld returned 1 exit status
make[2]: *** [samples/golf/CMakeFiles/golf.dir/build.make:3228: samples/golf/golf] Error 1
make[1]: *** [CMakeFiles/Makefile2:161: samples/golf/CMakeFiles/golf.dir/all] Error 2

This is related to the distro provided libbullet (v3.17, built with "-DUSE_DOUBLE_PRECISION=ON"). Unfortunately most modern Linux distributions are shipping versions of libbullet with support for double precision enabled. Do you have a workaround for this ?

mnhauke avatar Oct 18 '25 10:10 mnhauke

Interesting - AIUI gcc < 15 doesn't support parallel execution policies, I was under the impression it should be OK with 15 (in which case this line may need to be updated).

WRT libbullet presumably you can define BT_USE_DOUBLE_PRECISION which will then typedef btScalar as double turning btRigidBody::setDamping(float, float) into btRigidBody::setDamping(double, double)

fallahn avatar Oct 18 '25 10:10 fallahn

Interesting - AIUI gcc < 15 doesn't support parallel execution policies, I was under the impression it should be OK with 15 (in which case this line may need to be updated).

This works too.

WRT libbullet presumably you can define BT_USE_DOUBLE_PRECISION which will then typedef btScalar as double turning btRigidBody::setDamping(float, float) into btRigidBody::setDamping(double, double)

defining BT_USE_DOUBLE_PRECISION results in:

[   25s] cd /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/build/samples/golf && /usr/bin/c++  -I/usr/include/SDL2 -I/usr/include/bullet -I/home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git2
0251004/samples/golf/../../libsocial/include -I/home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src -I/home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/include -W
all -Wno-invalid-offsetof -Wno-comment -std=c++17 -DBT_USE_DOUBLE_PRECISION -O3 -DNDEBUG -std=gnu++17 -DOPENSSL_LOAD_CONF -MD -MT samples/golf/CMakeFiles/golf.dir/src/golf/BilliardsSystem.cpp.o -MF CMakeFiles/golf.dir/src/golf/Billiards
System.cpp.o.d -o CMakeFiles/golf.dir/src/golf/BilliardsSystem.cpp.o -c /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsSystem.cpp
[   25s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsSystem.cpp: In member function ‘virtual void BilliardBall::getWorldTransform(btTransform&) const’:
[   25s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsSystem.cpp:62:30: error: cannot convert ‘float*’ to ‘const btScalar*’ {aka ‘const double*’}
[   25s]    62 |     dest.setFromOpenGLMatrix(&tx.getWorldTransform()[0][0]);
[   25s] In file included from /usr/include/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h:78,
[   25s]                  from /usr/include/bullet/btBulletCollisionCommon.h:22,
[   25s]                  from /usr/include/bullet/btBulletDynamicsCommon.h:20,
[   25s]                  from /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsSystem.hpp:39,
[   25s]                  from /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsSystem.cpp:30:
[   25s] /usr/include/bullet/LinearMath/btTransform.h:127:50: note: initializing argument 1 of ‘void btTransform::setFromOpenGLMatrix(const btScalar*)’
[   25s]   127 |         void setFromOpenGLMatrix(const btScalar* m)
[   25s]       |                                  ~~~~~~~~~~~~~~~~^
[   25s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsSystem.cpp: In member function ‘virtual void BilliardBall::setWorldTransform(const btTransform&)’:
[   25s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsSystem.cpp:69:42: error: cannot convert ‘std::array<float, 16>::pointer’ {aka ‘float*’} to ‘btScalar*’ {aka ‘double*’}
[   25s]    69 |     src.getOpenGLMatrix(matrixBuffer.data());
[   25s]       |                         ~~~~~~~~~~~~~~~~~^~
[   25s]       |                                          |
[   25s]       |                                          std::array<float, 16>::pointer {aka float*}
[   25s] /usr/include/bullet/LinearMath/btTransform.h:135:41: note: initializing argument 1 of ‘void btTransform::getOpenGLMatrix(btScalar*) const’
[   25s]   135 |         void getOpenGLMatrix(btScalar * m) const
[   25s]       |                              ~~~~~~~~~~~^
[   25s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsSystem.cpp: In member function ‘virtual void BilliardsSystem::onEntityAdded(cro::Entity)’:
[   25s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsSystem.cpp:494:35: error: cannot convert ‘float*’ to ‘const btScalar*’ {aka ‘const double*’}
[   25s]   494 |     transform.setFromOpenGLMatrix(&entity.getComponent<cro::Transform>().getWorldTransform()[0][0]);
[   25s] /usr/include/bullet/LinearMath/btTransform.h:127:50: note: initializing argument 1 of ‘void btTransform::setFromOpenGLMatrix(const btScalar*)’
[   25s]   127 |         void setFromOpenGLMatrix(const btScalar* m)
[   25s]       |                                  ~~~~~~~~~~~~~~~~^
[   25s] make[2]: *** [samples/golf/CMakeFiles/golf.dir/build.make:303: samples/golf/CMakeFiles/golf.dir/src/golf/BilliardsSystem.cpp.o] Error 1
[   25s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/build'
[   25s] make[2]: *** Waiting for unfinished jobs....
[   25s] make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/build'
[   25s] [ 50%] Building CXX object samples/golf/CMakeFiles/golf.dir/src/golf/BilliardsClientCollision.cpp.o
[   25s] cd /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/build/samples/golf && /usr/bin/c++  -I/usr/include/SDL2 -I/usr/include/bullet -I/home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git2
0251004/samples/golf/../../libsocial/include -I/home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src -I/home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/crogine/include -W
all -Wno-invalid-offsetof -Wno-comment -std=c++17 -DBT_USE_DOUBLE_PRECISION -O3 -DNDEBUG -std=gnu++17 -DOPENSSL_LOAD_CONF -MD -MT samples/golf/CMakeFiles/golf.dir/src/golf/BilliardsClientCollision.cpp.o -MF CMakeFiles/golf.dir/src/golf/
BilliardsClientCollision.cpp.o.d -o CMakeFiles/golf.dir/src/golf/BilliardsClientCollision.cpp.o -c /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsClientCollision.cpp
[   25s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsClientCollision.cpp: In member function ‘virtual void BilliardsCollisionSystem::process(float)’:
[   25s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsClientCollision.cpp:180:39: error: cannot convert ‘float*’ to ‘const btScalar*’ {aka ‘const double*’}
[   25s]   180 |         transform.setFromOpenGLMatrix(&entity.getComponent<cro::Transform>().getLocalTransform()[0][0]);
[   25s] In file included from /usr/include/bullet/LinearMath/btIDebugDraw.h:20,
[   25s]                  from /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/DebugDraw.hpp:35,
[   25s]                  from /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsClientCollision.hpp:32,
[   25s]                  from /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsClientCollision.cpp:30:
[   25s] /usr/include/bullet/LinearMath/btTransform.h:127:50: note: initializing argument 1 of ‘void btTransform::setFromOpenGLMatrix(const btScalar*)’
[   25s]   127 |         void setFromOpenGLMatrix(const btScalar* m)
[   25s]       |                                  ~~~~~~~~~~~~~~~~^
[   25s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsClientCollision.cpp: In member function ‘virtual void BilliardsCollisionSystem::onEntityAdded(cro::Entity)’:
[   25s] /home/abuild/rpmbuild/BUILD/crogine-0-build/crogine-golfv1.21.2+git20251004/samples/golf/src/golf/BilliardsClientCollision.cpp:330:35: error: cannot convert ‘float*’ to ‘const btScalar*’ {aka ‘const double*’}
[   25s]   330 |     transform.setFromOpenGLMatrix(&e.getComponent<cro::Transform>().getWorldTransform()[0][0]);
[   25s] /usr/include/bullet/LinearMath/btTransform.h:127:50: note: initializing argument 1 of ‘void btTransform::setFromOpenGLMatrix(const btScalar*)’
[   25s]   127 |         void setFromOpenGLMatrix(const btScalar* m)
[   25s]       |                                  ~~~~~~~~~~~~~~~~^
[   25s] make[2]: *** [samples/golf/CMakeFiles/golf.dir/build.make:233: samples/golf/CMakeFiles/golf.dir/src/golf/BilliardsClientCollision.cpp.o] Error 1

mnhauke avatar Oct 18 '25 18:10 mnhauke

🤔 Hard to say. I mean if you're linking an external lib it should just work regardless of how that lib was built. Perhaps:

  • Try creating a manual typedef for btScalar instead of using the define
  • The build is somehow getting mixed up with the bullet headers in the crogine/extlib dir
  • The build is confused by the fact the game uses bullet 2.83 not 3.x

If all else fails try rebuilding bullet from source without the high precision define (the game works fine with regular precision)

fallahn avatar Oct 19 '25 10:10 fallahn

🤔 Hard to say. I mean if you're linking an external lib it should just work regardless of how that lib was built. Perhaps:

I agree but it seems different with bullet which defines some stuff at the compile time.

* Try creating a manual typedef for btScalar instead of using the define

Unfortunately that did not help.

* The build is somehow getting mixed up with the bullet headers in the crogine/extlib dir

I nuked the extlib folder already.

  • The function btTransform::setFromOpenGLMatrix(const btScalar* m) therefore expects a const double*. Meanwhile, cro::Transform::getLocalTransform() (from crogine) uses a 4×4 float matrix.

One Option could be to convert the float matrixes to double ...

const auto& mat = entity.getComponent<cro::Transform>().getLocalTransform();
btScalar dmat[16];
for (int i = 0; i < 16; ++i)
{
    dmat[i] = static_cast<btScalar>((&mat[0][0])[i]);
}
transform.setFromOpenGLMatrix(dmat);

... but this costs performance and better options probably exist.

* The build is confused by the fact the game uses bullet 2.83 not 3.x

If all else fails try rebuilding bullet from source without the high precision define (the game works fine with regular precision)

  • The game can be built and runs fine with bullet 3.17 (regular precision) The problem still is that many modern Linux distributions build bullet with double precision.

  • Using a locally bundled bullet with (regular precision) could be an option to workaround this issue

My goal is to create a package for your loveley game Super Video Golf for the openSUSE Linux distributions :-)

mnhauke avatar Oct 19 '25 18:10 mnhauke

Aw thanks :D

Are you using CMake? If bullet has a CMake file I can use FetchContent to automatically pull and build bullet when the game is built - possibly even link it statically so there's no extra libs to distribute.

fallahn avatar Oct 19 '25 18:10 fallahn

All package builds for openSUSE on OBS (Open Build Service) run in VM/chroot environments with only the required packages installed but without external network access.

Dependency handling with CMake's FetchContent still works since I can download all external dependencies in advance and then use FETCHCONTENT_SOURCE_DIR_<uppercaseDepName>.

Statically linking would be preferred to not interfere with the distro provided libs.

mnhauke avatar Oct 19 '25 18:10 mnhauke

OK, if I get a mo this week I'll look into it. It might actually help with the Steam Deck build too.

fallahn avatar Oct 19 '25 18:10 fallahn

So I've had a quick look at this - it seems the cmake files for bullet are a bit old and don't work well with FetchContent. 😔

Unfortunately, while I'd love to see golf packaged for openSUSE, I don't have the time to concentrate to fixing this right now, sorry. If you come up with a solution in the interim do let me know and I'll happily merge it (if it's suitable), but otherwise I'm going to put this on hold.

fallahn avatar Nov 05 '25 10:11 fallahn

Thanks for checking it out. No worries - I'll give it a try myself.

mnhauke avatar Nov 09 '25 19:11 mnhauke