esa / pagmo2

A C++ platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pagmo2/
GNU General Public License v3.0
834 stars 162 forks source link

error when building pagmo2 #498

Closed Thaer83 closed 2 years ago

Thaer83 commented 2 years ago

When executing this command (cmake --build .) the following error occurs.

[  1%] Building CXX object CMakeFiles/pagmo.dir/src/islands/fork_island.cpp.o
In file included from /usr/include/boost/serialization/void_cast.hpp:29:0,
                 from /usr/include/boost/archive/detail/iserializer.hpp:79,
                 from /usr/include/boost/archive/detail/interface_iarchive.hpp:22,
                 from /usr/include/boost/archive/detail/common_iarchive.hpp:23,
                 from /usr/include/boost/archive/basic_binary_iarchive.hpp:30,
                 from /usr/include/boost/archive/binary_iarchive_impl.hpp:21,
                 from /usr/include/boost/archive/binary_iarchive.hpp:20,
                 from /home/thaer/pagmo2/include/pagmo/s11n.hpp:53,
                 from /home/thaer/pagmo2/include/pagmo/problem.hpp:52,
                 from /home/thaer/pagmo2/include/pagmo/bfe.hpp:48,
                 from /home/thaer/pagmo2/include/pagmo/population.hpp:39,
                 from /home/thaer/pagmo2/include/pagmo/algorithm.hpp:48,
                 from /home/thaer/pagmo2/src/islands/fork_island.cpp:49:
/usr/include/boost/type_traits/is_virtual_base_of.hpp: In instantiation of ‘struct boost::detail::is_virtual_base_of_impl<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island>, boost::integral_constant<bool, true> >::boost_type_traits_internal_struct_X’:
/usr/include/boost/type_traits/is_virtual_base_of.hpp:80:5:   required from ‘const bool boost::detail::is_virtual_base_of_impl<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island>, boost::integral_constant<bool, true> >::value/usr/include/boost/type_traits/is_virtual_base_of.hpp:88:4:   required from ‘const bool boost::detail::is_virtual_base_of_impl2<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island> >::value/usr/include/boost/type_traits/is_virtual_base_of.hpp:97:45:   required from ‘struct boost::is_virtual_base_of<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island> >/usr/include/boost/mpl/if.hpp:63:11:   required from ‘struct boost::mpl::if_<boost::is_virtual_base_of<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island> >, boost::mpl::identity<boost::serialization::void_cast_detail::void_caster_virtual_base<pagmo::detail::isl_inner<pagmo::fork_island>, pagmo::detail::isl_inner_base> >, boost::mpl::identity<boost::serialization::void_cast_detail::void_caster_primitive<pagmo::detail::isl_inner<pagmo::fork_island>, pagmo::detail::isl_inner_base> > >/usr/include/boost/mpl/eval_if.hpp:37:41:   required from ‘struct boost::mpl::eval_if<boost::is_virtual_base_of<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island> >, boost::mpl::identity<boost::serialization::void_cast_detail::void_caster_virtual_base<pagmo::detail::isl_inner<pagmo::fork_island>, pagmo::detail::isl_inner_base> >, boost::mpl::identity<boost::serialization::void_cast_detail::void_caster_primitive<pagmo::detail::isl_inner<pagmo::fork_island>, pagmo::detail::isl_inner_base> > >/usr/include/boost/serialization/void_cast.hpp:279:17:   [ skipping 15 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/usr/include/boost/serialization/export.hpp:86:1:   required from ‘struct boost::archive::detail::ptr_serialization_support<boost::archive::binary_iarchive, pagmo::detail::isl_inner<pagmo::fork_island> >/usr/include/boost/archive/detail/register_archive.hpp:25:8:   required from ‘struct boost::archive::detail::_ptr_serialization_support<boost::archive::binary_iarchive, pagmo::detail::isl_inner<pagmo::fork_island> >/usr/include/boost/archive/binary_iarchive.hpp:57:1:   required by substitution of ‘template<class Serializable> typename boost::archive::detail::_ptr_serialization_support<boost::archive::binary_iarchive, Serializable>::type boost::archive::detail::instantiate_ptr_serialization(Serializable*, boost::archive::binary_iarchive*, boost::archive::detail::adl_tag) [with Serializable = pagmo::detail::isl_inner<pagmo::fork_island>]/usr/include/boost/serialization/export.hpp:123:38:   required from ‘void boost::archive::detail::extra_detail::guid_initializer<T>::export_guid(mpl_::false_) const [with T = pagmo::detail::isl_inner<pagmo::fork_island>; mpl_::false_ = mpl_::bool_<false>]/usr/include/boost/serialization/export.hpp:133:20:   required from ‘const boost::archive::detail::extra_detail::guid_initializer<T>& boost::archive::detail::extra_detail::guid_initializer<T>::export_guid() const [with T = pagmo::detail::isl_inner<pagmo::fork_island>]/home/thaer/pagmo2/src/islands/fork_island.cpp:380:1:   required from here
/usr/include/boost/type_traits/is_virtual_base_of.hpp:63:12: error: cannot derive from ‘final’ base ‘pagmo::detail::isl_inner<pagmo::fork_island>’ in derived type ‘boost::detail::is_virtual_base_of_impl<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island>, boost::integral_constant<bool, true> >::boost_type_traits_internal_struct_X’
     struct boost_type_traits_internal_struct_X : public Derived, virtual Base
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/type_traits/is_virtual_base_of.hpp: In instantiation of ‘struct boost::detail::is_virtual_base_of_impl<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island>, boost::integral_constant<bool, true> >::boost_type_traits_internal_struct_Y’:
/usr/include/boost/type_traits/is_virtual_base_of.hpp:80:5:   required from ‘const bool boost::detail::is_virtual_base_of_impl<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island>, boost::integral_constant<bool, true> >::value/usr/include/boost/type_traits/is_virtual_base_of.hpp:88:4:   required from ‘const bool boost::detail::is_virtual_base_of_impl2<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island> >::value/usr/include/boost/type_traits/is_virtual_base_of.hpp:97:45:   required from ‘struct boost::is_virtual_base_of<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island> >/usr/include/boost/mpl/if.hpp:63:11:   required from ‘struct boost::mpl::if_<boost::is_virtual_base_of<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island> >, boost::mpl::identity<boost::serialization::void_cast_detail::void_caster_virtual_base<pagmo::detail::isl_inner<pagmo::fork_island>, pagmo::detail::isl_inner_base> >, boost::mpl::identity<boost::serialization::void_cast_detail::void_caster_primitive<pagmo::detail::isl_inner<pagmo::fork_island>, pagmo::detail::isl_inner_base> > >/usr/include/boost/mpl/eval_if.hpp:37:41:   required from ‘struct boost::mpl::eval_if<boost::is_virtual_base_of<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island> >, boost::mpl::identity<boost::serialization::void_cast_detail::void_caster_virtual_base<pagmo::detail::isl_inner<pagmo::fork_island>, pagmo::detail::isl_inner_base> >, boost::mpl::identity<boost::serialization::void_cast_detail::void_caster_primitive<pagmo::detail::isl_inner<pagmo::fork_island>, pagmo::detail::isl_inner_base> > >/usr/include/boost/serialization/void_cast.hpp:279:17:   [ skipping 15 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/usr/include/boost/serialization/export.hpp:86:1:   required from ‘struct boost::archive::detail::ptr_serialization_support<boost::archive::binary_iarchive, pagmo::detail::isl_inner<pagmo::fork_island> >/usr/include/boost/archive/detail/register_archive.hpp:25:8:   required from ‘struct boost::archive::detail::_ptr_serialization_support<boost::archive::binary_iarchive, pagmo::detail::isl_inner<pagmo::fork_island> >/usr/include/boost/archive/binary_iarchive.hpp:57:1:   required by substitution of ‘template<class Serializable> typename boost::archive::detail::_ptr_serialization_support<boost::archive::binary_iarchive, Serializable>::type boost::archive::detail::instantiate_ptr_serialization(Serializable*, boost::archive::binary_iarchive*, boost::archive::detail::adl_tag) [with Serializable = pagmo::detail::isl_inner<pagmo::fork_island>]/usr/include/boost/serialization/export.hpp:123:38:   required from ‘void boost::archive::detail::extra_detail::guid_initializer<T>::export_guid(mpl_::false_) const [with T = pagmo::detail::isl_inner<pagmo::fork_island>; mpl_::false_ = mpl_::bool_<false>]/usr/include/boost/serialization/export.hpp:133:20:   required from ‘const boost::archive::detail::extra_detail::guid_initializer<T>& boost::archive::detail::extra_detail::guid_initializer<T>::export_guid() const [with T = pagmo::detail::isl_inner<pagmo::fork_island>]/home/thaer/pagmo2/src/islands/fork_island.cpp:380:1:   required from here
/usr/include/boost/type_traits/is_virtual_base_of.hpp:71:12: error: cannot derive from ‘final’ base ‘pagmo::detail::isl_inner<pagmo::fork_island>’ in derived type ‘boost::detail::is_virtual_base_of_impl<pagmo::detail::isl_inner_base, pagmo::detail::isl_inner<pagmo::fork_island>, boost::integral_constant<bool, true> >::boost_type_traits_internal_struct_Y’
     struct boost_type_traits_internal_struct_Y : public Derived
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CMakeFiles/pagmo.dir/build.make:75: recipe for target 'CMakeFiles/pagmo.dir/src/islands/fork_island.cpp.o' failed
make[2]: *** [CMakeFiles/pagmo.dir/src/islands/fork_island.cpp.o] Error 1
CMakeFiles/Makefile2:83: recipe for target 'CMakeFiles/pagmo.dir/all' failed
make[1]: *** [CMakeFiles/pagmo.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2
gaplopes commented 2 years ago

I'm having the same problem... Did you manage to solve it?

jschueller commented 2 years ago

you need boost>=1.68, see #503

bluescarni commented 2 years ago

Thanks to @jschueller the bumped Boost requirement will be in the next version, so I will close this report. Please re-open if needed.