Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 2.8.1 build errors on Linux #13609

Closed
wants to merge 5 commits into from

Conversation

jmickelin
Copy link
Contributor

This PR incorporates the changes suggested in #13608.

It builds partially on #13080 but additionally solves the new errors introduced between versions 2.8.0 and 2.8.1.

@SachCZ
Copy link
Collaborator

SachCZ commented Nov 20, 2024

Hello @jmickelin, these thank you for you fixes. These are all very useful. Yet, there are some minor thinks that need to be addressed. Some minor things:

  • the dbus change looks good to me
  • the Eigen source we are relying on (3.3.7) seems to export cmake targets, I would thus be in favor of deleting the ancient find module
  • test_common should probably not link against boost_headeronly, the issue probably lies in one of the targets missing target_link_libraries(... PUBLIC ...), but honestly this is bit of a nitpick

Bigger issues:

  • we do not compile against open ssl on other platforms - we should probably call target_link_libraries conditionally

Anyway all these should be easy to address. Thank you for your time, we intend to use this.

@SachCZ
Copy link
Collaborator

SachCZ commented Nov 20, 2024

Just to clarify. What I mean by "should probably not link against boost_headeronly" is the target_link_libraries in the cmake sense. Not actual linking - that makes no sense.

@jmickelin
Copy link
Contributor Author

Awesome! I'll hand it off to you to iron out the details, then?

Regarding test_common I realized I did not try compiling it after just adding the link to slic3r and not test_common. It's possible that would have been enough to make it available in the tests.

Thank you :)

@jmickelin
Copy link
Contributor Author

jmickelin commented Nov 21, 2024

FYI, I'm getting a couple of new errors on 2.9.0-alpha1 now:

boost::log linker error in slic3r-arrange-wrapper and arrange_tests

This seems to creep up later in the fff_print tests as well.

I added yet another boost_headeronly link, but this time to a dependency (libslic3r), and made it PUBLIC.

This ought to be enough to satisfy tests/sla_print as well.

--- a/src/libslic3r/CMakeLists.txt
+++ b/src/libslic3r/CMakeLists.txt
@@ -596,6 +596,7 @@ target_link_libraries(libslic3r PUBLIC
     libigl
     agg
     ankerl
+    boost_headeronly
 )

 if (APPLE)
CMake output
[ 64%] Building CXX object tests/libslic3r/CMakeFiles/libslic3r_tests.dir/test_surface_mesh.cpp.o
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `Slic3r::arr2::extract_selected<Slic3r::arr2::SimpleArrangeItem>(Slic3r::arr2::ArrangeTask<Slic3r::arr2::SimpleArrangeItem>&, Slic3r::arr2::ArrangeableModel const&, Slic3r::arr2::ArrangeableToItemConverter<Slic3r::arr2::SimpleArrangeItem> const&)::{lambda(Slic3r::arr2::Arrangeable const&)#1}::operator()(Slic3r::arr2::Arrangeable const&) const':
src/slic3r-arrange-wrapper/src/Tasks/ArrangeTaskImpl.hpp:44:(.text._ZZN6Slic3r4arr216extract_selectedINS0_17SimpleArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_[_ZZN6Slic3r4arr216extract_selectedINS0_17SimpleArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_]+0x345): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
ld: src/slic3r-arrange-wrapper/src/Tasks/ArrangeTaskImpl.hpp:44:(.text._ZZN6Slic3r4arr216extract_selectedINS0_17SimpleArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_[_ZZN6Slic3r4arr216extract_selectedINS0_17SimpleArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_]+0x383): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::record_pump(boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>&, boost::log::v2s_mt_posix::record&)':
build/src/slic3r-arrange-wrapper/include/boost/log/sources/record_ostream.hpp:508:(.text._ZZN6Slic3r4arr216extract_selectedINS0_17SimpleArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_[_ZZN6Slic3r4arr216extract_selectedINS0_17SimpleArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_]+0x390): undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider<char>::allocate_compound(boost::log::v2s_mt_posix::record&)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::record::reset()':
build/src/slic3r-arrange-wrapper/include/boost/log/core/record.hpp:157:(.text._ZZN6Slic3r4arr216extract_selectedINS0_17SimpleArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_[_ZZN6Slic3r4arr216extract_selectedINS0_17SimpleArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_]+0x4a3): undefined reference to `boost::log::v2s_mt_posix::record_view::public_data::destroy(boost::log::v2s_mt_posix::record_view::public_data const*)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_composite_logger<char, boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex>, boost::log::v2s_mt_posix::sources::features<boost::log::v2s_mt_posix::sources::severity<boost::log::v2s_mt_posix::trivial::severity_level> > >::open_record<boost::parameter::aux::tagged_argument_list_of_1<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> > >(boost::parameter::aux::tagged_argument_list_of_1<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> > const&)':
build/src/slic3r-arrange-wrapper/include/boost/log/sources/basic_logger.hpp:460:(.text._ZN5boost3log12v2s_mt_posix7sources22basic_composite_loggerIcNS2_18severity_logger_mtINS1_7trivial14severity_levelEEENS2_18multi_thread_modelINS1_3aux14light_rw_mutexEEENS2_8featuresIJNS2_8severityIS6_EEEEEE11open_recordINS_9parameter3aux25tagged_argument_list_of_1INSJ_15tagged_argumentINS1_8keywords3tag8severityEKS6_EEEEEENS1_6recordERKT_[_ZN5boost3log12v2s_mt_posix7sources22basic_composite_loggerIcNS2_18severity_logger_mtINS1_7trivial14severity_levelEEENS2_18multi_thread_modelINS1_3aux14light_rw_mutexEEENS2_8featuresIJNS2_8severityIS6_EEEEEE11open_recordINS_9parameter3aux25tagged_argument_list_of_1INSJ_15tagged_argumentINS1_8keywords3tag8severityEKS6_EEEEEENS1_6recordERKT_]+0x15): undefined reference to `boost::log::v2s_mt_posix::core::get_logging_enabled() const'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::sources::aux::severity_level<boost::log::v2s_mt_posix::trivial::severity_level>::set_value(boost::log::v2s_mt_posix::trivial::severity_level)':
build/src/slic3r-arrange-wrapper/include/boost/log/sources/severity_feature.hpp:137:(.text._ZN5boost3log12v2s_mt_posix7sources22basic_composite_loggerIcNS2_18severity_logger_mtINS1_7trivial14severity_levelEEENS2_18multi_thread_modelINS1_3aux14light_rw_mutexEEENS2_8featuresIJNS2_8severityIS6_EEEEEE11open_recordINS_9parameter3aux25tagged_argument_list_of_1INSJ_15tagged_argumentINS1_8keywords3tag8severityEKS6_EEEEEENS1_6recordERKT_[_ZN5boost3log12v2s_mt_posix7sources22basic_composite_loggerIcNS2_18severity_logger_mtINS1_7trivial14severity_levelEEENS2_18multi_thread_modelINS1_3aux14light_rw_mutexEEENS2_8featuresIJNS2_8severityIS6_EEEEEE11open_recordINS_9parameter3aux25tagged_argument_list_of_1INSJ_15tagged_argumentINS1_8keywords3tag8severityEKS6_EEEEEENS1_6recordERKT_]+0x2b): undefined reference to `boost::log::v2s_mt_posix::sources::aux::get_severity_level()'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_logger<char, boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex> >::open_record_unlocked<boost::parameter::aux::tagged_argument_list_of_1<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> > >(boost::parameter::aux::tagged_argument_list_of_1<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> > const&)':
build/src/slic3r-arrange-wrapper/include/boost/log/sources/basic_logger.hpp:260:(.text._ZN5boost3log12v2s_mt_posix7sources22basic_composite_loggerIcNS2_18severity_logger_mtINS1_7trivial14severity_levelEEENS2_18multi_thread_modelINS1_3aux14light_rw_mutexEEENS2_8featuresIJNS2_8severityIS6_EEEEEE11open_recordINS_9parameter3aux25tagged_argument_list_of_1INSJ_15tagged_argumentINS1_8keywords3tag8severityEKS6_EEEEEENS1_6recordERKT_[_ZN5boost3log12v2s_mt_posix7sources22basic_composite_loggerIcNS2_18severity_logger_mtINS1_7trivial14severity_levelEEENS2_18multi_thread_modelINS1_3aux14light_rw_mutexEEENS2_8featuresIJNS2_8severityIS6_EEEEEE11open_recordINS_9parameter3aux25tagged_argument_list_of_1INSJ_15tagged_argumentINS1_8keywords3tag8severityEKS6_EEEEEENS1_6recordERKT_]+0x3d): undefined reference to `boost::log::v2s_mt_posix::core::open_record(boost::log::v2s_mt_posix::attribute_set const&)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::core::push_record(boost::log::v2s_mt_posix::record&&)':
build/src/slic3r-arrange-wrapper/include/boost/log/core/core.hpp:308:(.text._ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEED2Ev[_ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEED2Ev]+0x31): undefined reference to `boost::log::v2s_mt_posix::core::push_record_move(boost::log::v2s_mt_posix::record&)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::auto_release::~auto_release()':
build/src/slic3r-arrange-wrapper/include/boost/log/sources/record_ostream.hpp:493:(.text._ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEED2Ev[_ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEED2Ev]+0x41): undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider<char>::release_compound(boost::log::v2s_mt_posix::aux::stream_provider<char>::stream_compound*)'
ld: build/src/slic3r-arrange-wrapper/include/boost/log/sources/record_ostream.hpp:493:(.text._ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEED2Ev[_ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEED2Ev]+0x55): undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider<char>::release_compound(boost::log::v2s_mt_posix::aux::stream_provider<char>::stream_compound*)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `Slic3r::arr2::extract<Slic3r::arr2::SimpleArrangeItem>(Slic3r::arr2::FillBedTask<Slic3r::arr2::SimpleArrangeItem>&, Slic3r::arr2::Scene const&, Slic3r::arr2::ArrangeableToItemConverter<Slic3r::arr2::SimpleArrangeItem> const&)::{lambda(Slic3r::arr2::Arrangeable const&)#3}::operator()(Slic3r::arr2::Arrangeable const&) const':
src/slic3r-arrange-wrapper/src/Tasks/FillBedTaskImpl.hpp:108:(.text._ZZN6Slic3r4arr27extractINS0_17SimpleArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_[_ZZN6Slic3r4arr27extractINS0_17SimpleArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_]+0x5d1): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
ld: src/slic3r-arrange-wrapper/src/Tasks/FillBedTaskImpl.hpp:108:(.text._ZZN6Slic3r4arr27extractINS0_17SimpleArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_[_ZZN6Slic3r4arr27extractINS0_17SimpleArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_]+0x60f): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::record_pump(boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>&, boost::log::v2s_mt_posix::record&)':
build/src/slic3r-arrange-wrapper/include/boost/log/sources/record_ostream.hpp:508:(.text._ZZN6Slic3r4arr27extractINS0_17SimpleArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_[_ZZN6Slic3r4arr27extractINS0_17SimpleArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_]+0x61c): undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider<char>::allocate_compound(boost::log::v2s_mt_posix::record&)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::record::reset()':
build/src/slic3r-arrange-wrapper/include/boost/log/core/record.hpp:157:(.text._ZZN6Slic3r4arr27extractINS0_17SimpleArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_[_ZZN6Slic3r4arr27extractINS0_17SimpleArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_]+0x72f): undefined reference to `boost::log::v2s_mt_posix::record_view::public_data::destroy(boost::log::v2s_mt_posix::record_view::public_data const*)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `Slic3r::arr2::MultiplySelectionTask<Slic3r::arr2::SimpleArrangeItem>::create(Slic3r::arr2::Scene const&, unsigned long, Slic3r::arr2::ArrangeableToItemConverter<Slic3r::arr2::SimpleArrangeItem> const&)::{lambda(Slic3r::arr2::Arrangeable const&)#2}::operator()(Slic3r::arr2::Arrangeable const&) const':
src/slic3r-arrange-wrapper/src/Tasks/MultiplySelectionTaskImpl.hpp:66:(.text._ZZN6Slic3r4arr221MultiplySelectionTaskINS0_17SimpleArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_[_ZZN6Slic3r4arr221MultiplySelectionTaskINS0_17SimpleArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_]+0x5b7): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
ld: src/slic3r-arrange-wrapper/src/Tasks/MultiplySelectionTaskImpl.hpp:66:(.text._ZZN6Slic3r4arr221MultiplySelectionTaskINS0_17SimpleArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_[_ZZN6Slic3r4arr221MultiplySelectionTaskINS0_17SimpleArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_]+0x5f5): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::record_pump(boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>&, boost::log::v2s_mt_posix::record&)':
build/src/slic3r-arrange-wrapper/include/boost/log/sources/record_ostream.hpp:508:(.text._ZZN6Slic3r4arr221MultiplySelectionTaskINS0_17SimpleArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_[_ZZN6Slic3r4arr221MultiplySelectionTaskINS0_17SimpleArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_]+0x602): undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider<char>::allocate_compound(boost::log::v2s_mt_posix::record&)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(SimpleArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::record::reset()':
build/src/slic3r-arrange-wrapper/include/boost/log/core/record.hpp:157:(.text._ZZN6Slic3r4arr221MultiplySelectionTaskINS0_17SimpleArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_[_ZZN6Slic3r4arr221MultiplySelectionTaskINS0_17SimpleArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_]+0x715): undefined reference to `boost::log::v2s_mt_posix::record_view::public_data::destroy(boost::log::v2s_mt_posix::record_view::public_data const*)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(ArrangeItem.cpp.o): in function `Slic3r::arr2::extract_selected<Slic3r::arr2::ArrangeItem>(Slic3r::arr2::ArrangeTask<Slic3r::arr2::ArrangeItem>&, Slic3r::arr2::ArrangeableModel const&, Slic3r::arr2::ArrangeableToItemConverter<Slic3r::arr2::ArrangeItem> const&)::{lambda(Slic3r::arr2::Arrangeable const&)#1}::operator()(Slic3r::arr2::Arrangeable const&) const':
src/slic3r-arrange-wrapper/src/Tasks/ArrangeTaskImpl.hpp:44:(.text._ZZN6Slic3r4arr216extract_selectedINS0_11ArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_[_ZZN6Slic3r4arr216extract_selectedINS0_11ArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_]+0x1ee): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
ld: src/slic3r-arrange-wrapper/src/Tasks/ArrangeTaskImpl.hpp:44:(.text._ZZN6Slic3r4arr216extract_selectedINS0_11ArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_[_ZZN6Slic3r4arr216extract_selectedINS0_11ArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_]+0x22f): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(ArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::record_pump(boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>&, boost::log::v2s_mt_posix::record&)':
build/src/slic3r-arrange-wrapper/include/boost/log/sources/record_ostream.hpp:508:(.text._ZZN6Slic3r4arr216extract_selectedINS0_11ArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_[_ZZN6Slic3r4arr216extract_selectedINS0_11ArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_]+0x23e): undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider<char>::allocate_compound(boost::log::v2s_mt_posix::record&)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(ArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::record::reset()':
build/src/slic3r-arrange-wrapper/include/boost/log/core/record.hpp:157:(.text._ZZN6Slic3r4arr216extract_selectedINS0_11ArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_[_ZZN6Slic3r4arr216extract_selectedINS0_11ArrangeItemEEEvRNS0_11ArrangeTaskIT_EERKNS0_16ArrangeableModelERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE_clESG_]+0x353): undefined reference to `boost::log::v2s_mt_posix::record_view::public_data::destroy(boost::log::v2s_mt_posix::record_view::public_data const*)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(ArrangeItem.cpp.o): in function `Slic3r::arr2::extract<Slic3r::arr2::ArrangeItem>(Slic3r::arr2::FillBedTask<Slic3r::arr2::ArrangeItem>&, Slic3r::arr2::Scene const&, Slic3r::arr2::ArrangeableToItemConverter<Slic3r::arr2::ArrangeItem> const&)::{lambda(Slic3r::arr2::Arrangeable const&)#3}::operator()(Slic3r::arr2::Arrangeable const&) const':
src/slic3r-arrange-wrapper/src/Tasks/FillBedTaskImpl.hpp:108:(.text._ZZN6Slic3r4arr27extractINS0_11ArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_[_ZZN6Slic3r4arr27extractINS0_11ArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_]+0x2b5): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
ld: src/slic3r-arrange-wrapper/src/Tasks/FillBedTaskImpl.hpp:108:(.text._ZZN6Slic3r4arr27extractINS0_11ArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_[_ZZN6Slic3r4arr27extractINS0_11ArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_]+0x2f6): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(ArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::record_pump(boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>&, boost::log::v2s_mt_posix::record&)':
build/src/slic3r-arrange-wrapper/include/boost/log/sources/record_ostream.hpp:508:(.text._ZZN6Slic3r4arr27extractINS0_11ArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_[_ZZN6Slic3r4arr27extractINS0_11ArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_]+0x305): undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider<char>::allocate_compound(boost::log::v2s_mt_posix::record&)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(ArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::record::reset()':
build/src/slic3r-arrange-wrapper/include/boost/log/core/record.hpp:157:(.text._ZZN6Slic3r4arr27extractINS0_11ArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_[_ZZN6Slic3r4arr27extractINS0_11ArrangeItemEEEvRNS0_11FillBedTaskIT_EERKNS0_5SceneERKNS0_26ArrangeableToItemConverterIS4_EEENKUlRKNS0_11ArrangeableEE1_clESG_]+0x41a): undefined reference to `boost::log::v2s_mt_posix::record_view::public_data::destroy(boost::log::v2s_mt_posix::record_view::public_data const*)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(ArrangeItem.cpp.o): in function `Slic3r::arr2::MultiplySelectionTask<Slic3r::arr2::ArrangeItem>::create(Slic3r::arr2::Scene const&, unsigned long, Slic3r::arr2::ArrangeableToItemConverter<Slic3r::arr2::ArrangeItem> const&)::{lambda(Slic3r::arr2::Arrangeable const&)#2}::operator()(Slic3r::arr2::Arrangeable const&) const':
src/slic3r-arrange-wrapper/src/Tasks/MultiplySelectionTaskImpl.hpp:66:(.text._ZZN6Slic3r4arr221MultiplySelectionTaskINS0_11ArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_[_ZZN6Slic3r4arr221MultiplySelectionTaskINS0_11ArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_]+0x28f): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
ld: src/slic3r-arrange-wrapper/src/Tasks/MultiplySelectionTaskImpl.hpp:66:(.text._ZZN6Slic3r4arr221MultiplySelectionTaskINS0_11ArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_[_ZZN6Slic3r4arr221MultiplySelectionTaskINS0_11ArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_]+0x2d0): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(ArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::record_pump(boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>&, boost::log::v2s_mt_posix::record&)':
build/src/slic3r-arrange-wrapper/include/boost/log/sources/record_ostream.hpp:508:(.text._ZZN6Slic3r4arr221MultiplySelectionTaskINS0_11ArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_[_ZZN6Slic3r4arr221MultiplySelectionTaskINS0_11ArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_]+0x2df): undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider<char>::allocate_compound(boost::log::v2s_mt_posix::record&)'
ld: ../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a(ArrangeItem.cpp.o): in function `boost::log::v2s_mt_posix::record::reset()':
build/src/slic3r-arrange-wrapper/include/boost/log/core/record.hpp:157:(.text._ZZN6Slic3r4arr221MultiplySelectionTaskINS0_11ArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_[_ZZN6Slic3r4arr221MultiplySelectionTaskINS0_11ArrangeItemEE6createERKNS0_5SceneEmRKNS0_26ArrangeableToItemConverterIS2_EEENKUlRKNS0_11ArrangeableEE0_clESD_]+0x3f4): undefined reference to `boost::log::v2s_mt_posix::record_view::public_data::destroy(boost::log::v2s_mt_posix::record_view::public_data const*)'
[ 64%] Building CXX object src/slic3r/CMakeFiles/libslic3r_gui.dir/GUI/WebViewDialog.cpp.o
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [tests/arrange/CMakeFiles/arrange_tests.dir/build.make:186: tests/arrange/arrange_tests] Error 1
make[1]: *** [CMakeFiles/Makefile2:1513: tests/arrange/CMakeFiles/arrange_tests.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Missing member 'is_regular_file' in boost::filesystem::directory_entry

This wasn't added as a method to directory_entry until Boost version 1.83, by the looks of it. I was running 1.81 on my system. It does however exist as a normal function in prior versions:

Compare 1.82 with 1.83.

I suggest to either bump the version bound to Boost (which is at 1.66.0 now), or rewrite it in a way that works in both older and newer versions.

Here is a patch for the latter:

--- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp
+++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp
@@ -120,7 +120,7 @@ BackgroundSlicingProcess::~BackgroundSlicingProcess()
        std::string prefix = boost::filesystem::path(m_temp_output_path).filename().string();
        prefix = prefix.substr(0, prefix.find('_'));
     for (const auto& entry : boost::filesystem::directory_iterator(temp_dir))) {
-        if (entry.is_regular_file()) {
+        if (boost::filesystem::is_regular_file(entry.path())) {
             const std::string filename = entry.path().filename().string();
             if (boost::starts_with(filename, prefix) && boost::ends_with(filename, ".gcode"))
                 boost::filesystem::remove(entry);
CMake output
[ 66%] Building CXX object tests/fff_print/CMakeFiles/fff_print_tests.dir/test_flow.cpp.o
src/slic3r/GUI/BackgroundSlicingProcess.cpp:123:19: error: no member named 'is_regular_file' in 'boost::filesystem::directory_entry'
  123 |         if (entry.is_regular_file()) {
      |             ~~~~~ ^
1 error generated.
make[2]: *** [src/slic3r/CMakeFiles/libslic3r_gui.dir/build.make:301: src/slic3r/CMakeFiles/libslic3r_gui.dir/GUI/BackgroundSlicingProcess.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1451: src/slic3r/CMakeFiles/libslic3r_gui.dir/all] Error 2

With both of these, I can successfully build 2.9.0-alpha1. I'll rebase this PR onto that and add these changes in a minute.

Rose-David and others added 5 commits November 21, 2024 07:10
This solves the build error with the missing `Eigen3::Eigen` build
target.

Partially fixes prusa3d#13608
This solves the build error with missing headers.

Partially fixes prusa3d#13608.
This solves the linker error about missing `boost::log` symbols.

Fixes prusa3d#13608.
…versions

The method boost::filesytem::directory_entry.is_regular_file was added
starting in version 1.83, but the lowest Boost version of this project
is 1.66.0.
@jmickelin jmickelin force-pushed the fix-2.8.1-build-errors branch from cb59b22 to f73ed7f Compare November 21, 2024 06:22
@jmickelin
Copy link
Contributor Author

Done! I changed the commit which added the boost_headeronly link in test_common to do it in libslic3r instead, fixing both the original issue and this new one from 2.9.1-alpha1. I kept the commits for OpenSSL and the new FindEigen3.cmake around, in case you would need them in your cherry-pick.

@sl1pkn07
Copy link

sl1pkn07 commented Dec 14, 2024

Hi

can you rebase this? seems #13608 has been merged (if this pr is still needed)

greetings

EDIT: maybe

diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt
index 82e91bb10b1..27c226120dd 100644
--- a/src/slic3r/CMakeLists.txt
+++ b/src/slic3r/CMakeLists.txt
@@ -462,6 +462,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
         ${DBus1_LIBRARIES}
         OpenSSL::SSL
         OpenSSL::Crypto
+        boost_headeronly
     )
 elseif (APPLE)
     target_link_libraries(libslic3r_gui PUBLIC ${DISKARBITRATION_LIBRARY} ${COREWLAN_LIBRARY})
diff --git a/src/slic3r/GUI/BackgroundSlicingProcess.cpp b/src/slic3r/GUI/BackgroundSlicingProcess.cpp
index 67df537d5cc..fc9ba340229 100644
--- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp
+++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp
@@ -120,7 +120,7 @@ BackgroundSlicingProcess::~BackgroundSlicingProcess()
 	std::string prefix = boost::filesystem::path(m_temp_output_path).filename().string();
 	prefix = prefix.substr(0, prefix.find('_'));
     for (const auto& entry : boost::filesystem::directory_iterator(temp_dir)) {
-        if (entry.is_regular_file()) {
+        if (boost::filesystem::is_regular_file(entry.path())) {
             const std::string filename = entry.path().filename().string();
             if (boost::starts_with(filename, prefix) && boost::ends_with(filename, ".gcode"))
                 boost::filesystem::remove(entry);

@jmickelin
Copy link
Contributor Author

jmickelin commented Dec 15, 2024

@sl1pkn07 Hi, I believe it's not necessary, since all of these fixes were cherry picked onto 2.9.0-beta1: The first thing in your diff is in 20a02b5 and the second one was solved by bumping the version requirement for Boost to 1.83 here 78a0470. If you are still experiencing build issues mentioning Boost, I would double check that your system has the right version installed and rerun the configure script. But yes, to backport it to work with older Boost versions, the second half of the diff would do the trick (unless other changes in 2.9.0-beta1 rely on stuff not present in Boost <1.83).

Since all the remaining commits are also merged, I think this can be closed, so I'll do that now :)

@jmickelin jmickelin closed this Dec 15, 2024
@sl1pkn07
Copy link

ok, then this is for older boost. then can i drop it

any plans to update boost to 1.86.0?

greetings

@jmickelin
Copy link
Contributor Author

Correct.

For the second question, I think you can use any newer version you want, and the build system should pick up on it. The version check is just a lower bound (to check whether a feature that is being used is present or not). Boost is just a utility library, and there aren't any bleeding edge features visible to end users by using the very latest one or anything.

@sl1pkn07
Copy link

sl1pkn07 commented Dec 16, 2024

i asked because this

[ 86%] Building CXX object src/slic3r/CMakeFiles/libslic3r_gui.dir/GUI/Jobs/NotificationProgressIndicator.cpp.o
/tmp/makepkg/prusa-slicer-git/src/PrusaSlicer/src/slic3r/Config/Version.cpp: In static member function ‘static std::vector<Slic3r::GUI::Config::Index> Slic3r::GUI::Config::Index::load_db()’:
/tmp/makepkg/prusa-slicer-git/src/PrusaSlicer/src/slic3r/Config/Version.cpp:246:51: error: ‘directory_iterator’ is not a member of ‘boost::filesystem’; did you mean ‘directory_entry’?
  246 |         for (auto &dir_entry : boost::filesystem::directory_iterator(cache_dir))
      |                                                   ^~~~~~~~~~~~~~~~~~
      |                                                   directory_entry
/tmp/makepkg/prusa-slicer-git/src/PrusaSlicer/src/slic3r/Config/Version.cpp:259:47: error: ‘directory_iterator’ is not a member of ‘boost::filesystem’; did you mean ‘directory_entry’?
  259 |     for (auto &dir_entry : boost::filesystem::directory_iterator(vendor_dir))
      |                                               ^~~~~~~~~~~~~~~~~~
      |                                               directory_entry

with boost 1.86.0

EDIT: seems gentoo have patches for this and other boost things

https://gitweb.gentoo.org/repo/gentoo.git/tree/media-gfx/prusaslicer/files/prusaslicer-2.8.0-missing-includes.patch
https://gitweb.gentoo.org/repo/gentoo.git/tree/media-gfx/prusaslicer/files/prusaslicer-2.8.1-fstream.patch

@jmickelin
Copy link
Contributor Author

Interesting! Really good catch, sorry I misunderstood you.

I can't replicate it on Nix, but I did find this:

It looks like boost/filesystem/directory.hpp used to be pulled into Version.cpp implicitly via boost/filesystem/operations.hpp, but that line was removed in Boost 1.85: boostorg/filesystem@5df060e#diff-8a1c401693350e208246583ce56d64527e55696d6ff8f696471ebd7b67a8e928L26

Apparently that file was using it for some deprecated code, and the include was removed along with the code when it was removed: https://www.boost.org/doc/libs/1_86_0/libs/filesystem/doc/release_history.html#:~:text=Removed%20APIs%20that,and%20features%20section.

It's not entirely clear to me whether Version.cpp in PrusaSlicer somehow gets the header pulled in differently on my system (since I don't get any error), but I think it makes total sense to do it explicitly like in that first Gentoo patch anyway. I can create a followup PR to this one tomorrow, if I have time.

Do you mind sharing what OS/distro you are using, and (if possible -- I have no clue how 😛 ) the build flags that were used to compile Boost? Since neither of those changes from the Gentoo patches were related to any of the issues I ran into, I did gloss over them when I wrote this PR, but that also means that I have no way of testing them now. Does the build succeed for you if you just add

#include <boost/filesystem/directory.hpp>

to src/slic3r/Config/Version.cpp? Ignore the additional change to src/slic3r/GUI/UserAccountCommunication.cpp for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants