compile error under fedora rawhide

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
cheese
Space Krill
Posts: 2
Joined: Fri Jun 18, 2021 5:14 pm

compile error under fedora rawhide

#1 Post by cheese »

hi

i try to compile freeorion v0.4.10.1 under fedora rawhide at seem to get troubles with the gcc 11 there.
compiler errors as follows:

Code: Select all

make[2]: Leaving directory '/builddir/build/BUILD/src-tarball/x86_64-redhat-linux-gnu'
make[2]: Entering directory '/builddir/build/BUILD/src-tarball/x86_64-redhat-linux-gnu'
[ 21%] Building CXX object CMakeFiles/freeorioncommon.dir/combat/CombatEvents.cpp.o
/usr/bin/ccache /usr/lib64/ccache/g++ -DBINPATH=\"/usr/bin\" -DBOOST_ALL_DYN_LINK -DENABLE_BINRELOC -DFREEORION_BUILD_COMMON -DFREEORION_LINUX -DFREEORION_PYTHON_VERSION=\"3.10\" -DSHAREPATH=\"/usr/share\" -Dfreeorioncommon_EXPORTS -I/builddir/build/BUILD/src-tarball/GG/Boost::boost -I/builddir/build/BUILD/src-tarb
all/GG -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchrono
us-unwind-tables -fstack-clash-protection -fcf-protection -DNDEBUG -fPIC -fvisibility=hidden -Wall -std=c++14 -MD -MT CMakeFiles/freeorioncommon.dir/combat/CombatEvents.cpp.o -MF CMakeFiles/freeorioncommon.dir/combat/CombatEvents.cpp.o.d -o CMakeFiles/freeorioncommon.dir/combat/CombatEvents.cpp.o -c /builddir/build
/BUILD/src-tarball/combat/CombatEvents.cpp
make[2]: Leaving directory '/builddir/build/BUILD/src-tarball/x86_64-redhat-linux-gnu'
In file included from /usr/include/c++/11/bits/move.h:57,
                 from /usr/include/c++/11/bits/stl_pair.h:59,
                 from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/stl_tree.h:63,
                 from /usr/include/c++/11/map:60,
                 from /builddir/build/BUILD/src-tarball/combat/CombatEvents.h:5,
                 from /builddir/build/BUILD/src-tarball/combat/CombatEvents.cpp:1:
/usr/include/c++/11/type_traits: In instantiation of 'struct std::is_destructible<GameRules>':
/usr/include/c++/11/future:769:21:   required from 'class std::future<GameRules>'
/usr/include/boost/optional/detail/optional_aligned_storage.hpp:31:20:   required from 'union boost::optional_detail::aligned_storage<std::future<GameRules> >::dummy_u'
/usr/include/boost/optional/detail/optional_aligned_storage.hpp:34:7:   required from 'class boost::optional_detail::aligned_storage<std::future<GameRules> >'
/usr/include/boost/optional/optional.hpp:775:18:   required from 'class boost::optional_detail::optional_base<std::future<GameRules> >'
/usr/include/boost/optional/optional.hpp:850:7:   required from 'class boost::optional<std::future<GameRules> >'
/builddir/build/BUILD/src-tarball/combat/../universe/../util/Pending.h:38:41:   required from 'struct Pending::Pending<GameRules>'
/usr/include/boost/optional/detail/optional_aligned_storage.hpp:31:20:   required from 'union boost::optional_detail::aligned_storage<Pending::Pending<GameRules> >::dummy_u'
/usr/include/boost/optional/detail/optional_aligned_storage.hpp:34:7:   required from 'class boost::optional_detail::aligned_storage<Pending::Pending<GameRules> >'
/usr/include/boost/optional/optional.hpp:775:18:   required from 'class boost::optional_detail::optional_base<Pending::Pending<GameRules> >'
/usr/include/boost/optional/optional.hpp:850:7:   required from 'class boost::optional<Pending::Pending<GameRules> >'
/builddir/build/BUILD/src-tarball/combat/../util/GameRules.h:157:83:   required from here
/usr/include/c++/11/type_traits:849:52: error: static assertion failed: template argument must be a complete class or an unbounded array
  849 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:849:52: note: 'std::__is_complete_or_unbounded<std::__type_identity<GameRules> >((std::__type_identity<GameRules>{}, std::__type_identity<GameRules>()))' evaluates to false
In file included from /builddir/build/BUILD/src-tarball/combat/../universe/../util/Pending.h:10,
                 from /builddir/build/BUILD/src-tarball/combat/../universe/Universe.h:8,
                 from /builddir/build/BUILD/src-tarball/combat/CombatEvents.cpp:7:
/usr/include/c++/11/future: In instantiation of 'class std::future<GameRules>':
/usr/include/boost/optional/detail/optional_aligned_storage.hpp:31:20:   required from 'union boost::optional_detail::aligned_storage<std::future<GameRules> >::dummy_u'
/usr/include/boost/optional/detail/optional_aligned_storage.hpp:34:7:   required from 'class boost::optional_detail::aligned_storage<std::future<GameRules> >'
/usr/include/boost/optional/optional.hpp:775:18:   required from 'class boost::optional_detail::optional_base<std::future<GameRules> >'
/usr/include/boost/optional/optional.hpp:850:7:   required from 'class boost::optional<std::future<GameRules> >'
/builddir/build/BUILD/src-tarball/combat/../universe/../util/Pending.h:38:41:   required from 'struct Pending::Pending<GameRules>'
/usr/include/boost/optional/detail/optional_aligned_storage.hpp:31:20:   required from 'union boost::optional_detail::aligned_storage<Pending::Pending<GameRules> >::dummy_u'
/usr/include/boost/optional/detail/optional_aligned_storage.hpp:34:7:   required from 'class boost::optional_detail::aligned_storage<Pending::Pending<GameRules> >'
/usr/include/boost/optional/optional.hpp:775:18:   required from 'class boost::optional_detail::optional_base<Pending::Pending<GameRules> >'
/usr/include/boost/optional/optional.hpp:850:7:   required from 'class boost::optional<Pending::Pending<GameRules> >'
/builddir/build/BUILD/src-tarball/combat/../util/GameRules.h:157:83:   required from here
/usr/include/c++/11/future:769:21: error: static assertion failed: result type must be destructible
  769 |       static_assert(is_destructible<_Res>{},
      |                     ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/future:769:21: note: 'std::is_destructible<GameRules>()' evaluates to false
/builddir/build/BUILD/src-tarball/combat/CombatEvents.cpp: In member function 'virtual std::string StealthChangeEvent::CombatLogDescription(int) const':
/builddir/build/BUILD/src-tarball/combat/CombatEvents.cpp:471:25: warning: loop variable 'event' creates a copy from type 'const std::shared_ptr<StealthChangeEvent::StealthChangeEventDetail>' [-Wrange-loop-construct]
  471 |         for (const auto event : target.second)
      |                         ^~~~~
/builddir/build/BUILD/src-tarball/combat/CombatEvents.cpp:471:25: note: use reference type to prevent copying
  471 |         for (const auto event : target.second)
      |                         ^~~~~
      |                         &
/builddir/build/BUILD/src-tarball/combat/CombatEvents.cpp: In member function 'virtual std::vector<std::shared_ptr<const CombatEvent> > StealthChangeEvent::SubEvents(int) const':
/builddir/build/BUILD/src-tarball/combat/CombatEvents.cpp:494:25: warning: loop variable 'event' creates a copy from type 'const std::shared_ptr<StealthChangeEvent::StealthChangeEventDetail>' [-Wrange-loop-construct]
  494 |         for (const auto event : target.second)
      |                         ^~~~~
/builddir/build/BUILD/src-tarball/combat/CombatEvents.cpp:494:25: note: use reference type to prevent copying
  494 |         for (const auto event : target.second)
      |                         ^~~~~
      |                         &
/builddir/build/BUILD/src-tarball/combat/CombatEvents.cpp: In member function 'virtual std::string WeaponsPlatformEvent::DebugString() const':
/builddir/build/BUILD/src-tarball/combat/CombatEvents.cpp:1052:25: warning: loop variable 'attack' creates a copy from type 'const std::shared_ptr<WeaponFireEvent>' [-Wrange-loop-construct]
 1052 |         for (const auto attack : target.second)
      |                         ^~~~~~
/builddir/build/BUILD/src-tarball/combat/CombatEvents.cpp:1052:25: note: use reference type to prevent copying
 1052 |         for (const auto attack : target.second)
      |                         ^~~~~~
      |                         &
In file included from /builddir/build/BUILD/src-tarball/combat/../universe/../util/Pending.h:10,
                 from /builddir/build/BUILD/src-tarball/combat/../universe/Universe.h:8,
                 from /builddir/build/BUILD/src-tarball/combat/CombatEvents.cpp:7:
/usr/include/c++/11/future: In instantiation of 'class std::shared_future<GameRules>':
/usr/include/c++/11/future:788:66:   required from 'std::future<_Res>::future(std::future<_Res>&&) [with _Res = GameRules]'
/usr/include/boost/optional/optional.hpp:409:8:   required from 'void boost::optional_detail::optional_base<T>::construct(boost::optional_detail::optional_base<T>::rval_reference_type) [with T = std::future<GameRules>; boost::optional_detail::optional_base<T>::rval_reference_type = std::future<GameRules>&&]'
/usr/include/boost/optional/optional.hpp:211:18:   required from 'boost::optional_detail::optional_base<T>::optional_base(boost::optional_detail::optional_base<T>&&) [with T = std::future<GameRules>]'
/usr/include/boost/optional/optional.hpp:975:5:   required from 'Pending::Pending<T>::Pending(Pending::Pending<T>&&) [with T = GameRules]'
/usr/include/boost/optional/optional.hpp:409:8:   required from 'void boost::optional_detail::optional_base<T>::construct(boost::optional_detail::optional_base<T>::rval_reference_type) [with T = Pending::Pending<GameRules>; boost::optional_detail::optional_base<T>::rval_reference_type = Pending::Pending<GameRules>&
&]'
/usr/include/boost/optional/optional.hpp:211:18:   required from 'boost::optional_detail::optional_base<T>::optional_base(boost::optional_detail::optional_base<T>&&) [with T = Pending::Pending<GameRules>]'
/usr/include/boost/optional/optional.hpp:975:5:   required from here
/usr/include/c++/11/future:906:21: error: static assertion failed: result type must be destructible
  906 |       static_assert(is_destructible<_Res>{},
      |                     ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/future:906:21: note: 'std::is_destructible<GameRules>()' evaluates to false
make[2]: *** [CMakeFiles/freeorioncommon.dir/build.make:93: CMakeFiles/freeorioncommon.dir/combat/CombatEvents.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:526: CMakeFiles/freeorioncommon.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13093
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: compile error under fedora rawhide

#2 Post by Geoff the Medio »

Seemingly the same issue as in https://github.com/freeorion/freeorion/issues/3460 where an updated GCC 11 causes issues.

Porting the relevant changes back to v0.4.10 is non-trivial, though not overly difficult.

The changes are in this and probably nearby commits: https://github.com/freeorion/freeorion/ ... aff19963c3

cheese
Space Krill
Posts: 2
Joined: Fri Jun 18, 2021 5:14 pm

Re: compile error under fedora rawhide

#3 Post by cheese »

is there a timeframe for the next versioned release? i'm not very fluent in gcc.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13093
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: compile error under fedora rawhide

#4 Post by Geoff the Medio »

Next release timing is unknown.

Can you try building: https://github.com/freeorion/freeorion/pull/3498

Post Reply