Update: I solved it. Instead of a HPX issue, it was rather a Clang characteristic: Had to pass -undefined dynamic_lookup to Clang to ignore the missing symbols when building the shared component library. I guess this is the default behavior of GCC. Also, I guess the project used to compile on OS X earlier because we have only introduced these cyclic dependencies between components more recently.
Some more information: http://stackoverflow.com/questions/25421479/clang-and-undefined-symbols-when-building-a-library Maybe this monologue helps someone :-) Best, Tim > On 16 Nov 2016, at 15:53, Tim Biedert <[email protected]> wrote: > > A follow-up to the issue: My CMakeLists.txt looks basically like this: > > add_hpx_component(Block > ESSENTIAL > SOURCES Block.cpp Block.h # ... > ) > > add_hpx_component(Container > ESSENTIAL > SOURCES Container.cpp Container.h # ... > COMPONENT_DEPENDENCIES Block > ) > > The undefined symbols error comes at the first stage "Linking CXX shared > library libhpx_Block.dylib”. > > When I add Container.cpp and Container.h to the SOURCES of the *Block* > component the undefined symbols disappear (and the linker complains about > other now duplicate symbols, but that’s a different issue). > > I’m just wondering: Why is it working on Arch (HPX couple of weeks old) and > Ubuntu (HPX some months old), but not on macOS with the latest master of > HPX? Also, I haven’t tested the project for some months on OS X, but I > believe it used to work this way, too. > > Thanks! > > Best, > Tim > > > > > > > > > > >> On 16 Nov 2016, at 15:32, Tim Biedert <[email protected] >> <mailto:[email protected]>> wrote: >> >> On macOS with current HPX master I get the following linker errors when >> compiling my project, which works fine on my Arch Linux machine with a >> couple of weeks old HPX. >> >> Undefined symbols for architecture x86_64: >> "hpx::actions::transfer_action<server::Container::render_action>::transfer_action()", >> referenced from: >> hpx::actions::detail::register_action<server::Container::render_action>::create(bool) >> in Block.cpp.o >> hpx::actions::detail::register_action<server::Container::render_action>::create(bool) >> in CommunicationHandler.cpp.o >> "hpx::actions::transfer_action<server::Container::loadData_action>::transfer_action()", >> referenced from: >> hpx::actions::detail::register_action<server::Container::loadData_action>::create(bool) >> in Block.cpp.o >> hpx::actions::detail::register_action<server::Container::loadData_action>::create(bool) >> in CommunicationHandler.cpp.o >> "hpx::actions::transfer_action<server::Container::initBlocks_action>::transfer_action()", >> referenced from: >> hpx::actions::detail::register_action<server::Container::initBlocks_action>::create(bool) >> in Block.cpp.o >> hpx::actions::detail::register_action<server::Container::initBlocks_action>::create(bool) >> in CommunicationHandler.cpp.o >> "hpx::actions::transfer_action<server::Container::updateConfig_action>::transfer_action()", >> referenced from: >> hpx::actions::detail::register_action<server::Container::updateConfig_action>::create(bool) >> in Block.cpp.o >> hpx::actions::detail::register_action<server::Container::updateConfig_action>::create(bool) >> in CommunicationHandler.cpp.o >> "hpx::actions::transfer_continuation_action<server::Container::render_action>::transfer_continuation_action()", >> referenced from: >> hpx::actions::detail::register_action<server::Container::render_action>::create(bool) >> in Block.cpp.o >> hpx::actions::detail::register_action<server::Container::render_action>::create(bool) >> in CommunicationHandler.cpp.o >> "hpx::actions::transfer_continuation_action<server::Container::loadData_action>::transfer_continuation_action()", >> referenced from: >> hpx::actions::detail::register_action<server::Container::loadData_action>::create(bool) >> in Block.cpp.o >> hpx::actions::detail::register_action<server::Container::loadData_action>::create(bool) >> in CommunicationHandler.cpp.o >> "hpx::actions::transfer_continuation_action<server::Container::initBlocks_action>::transfer_continuation_action()", >> referenced from: >> hpx::actions::detail::register_action<server::Container::initBlocks_action>::create(bool) >> in Block.cpp.o >> hpx::actions::detail::register_action<server::Container::initBlocks_action>::create(bool) >> in CommunicationHandler.cpp.o >> "hpx::actions::transfer_continuation_action<server::Container::updateConfig_action>::transfer_continuation_action()", >> referenced from: >> hpx::actions::detail::register_action<server::Container::updateConfig_action>::create(bool) >> in Block.cpp.o >> hpx::actions::detail::register_action<server::Container::updateConfig_action>::create(bool) >> in CommunicationHandler.cpp.o >> "char const* >> hpx::actions::detail::get_action_name<server::Container::render_action>()", >> referenced from: >> hpx::actions::detail::register_action<server::Container::render_action>::register_action() >> in Block.cpp.o >> hpx::actions::detail::register_action<server::Container::render_action>::register_action() >> in CommunicationHandler.cpp.o >> "char const* >> hpx::actions::detail::get_action_name<server::Container::loadData_action>()", >> referenced from: >> hpx::actions::detail::register_action<server::Container::loadData_action>::register_action() >> in Block.cpp.o >> hpx::actions::detail::register_action<server::Container::loadData_action>::register_action() >> in CommunicationHandler.cpp.o >> "char const* >> hpx::actions::detail::get_action_name<server::Container::initBlocks_action>()", >> referenced from: >> hpx::actions::detail::register_action<server::Container::initBlocks_action>::register_action() >> in Block.cpp.o >> hpx::actions::detail::register_action<server::Container::initBlocks_action>::register_action() >> in CommunicationHandler.cpp.o >> "char const* >> hpx::actions::detail::get_action_name<server::Container::updateConfig_action>()", >> referenced from: >> hpx::actions::detail::register_action<server::Container::updateConfig_action>::register_action() >> in Block.cpp.o >> hpx::actions::detail::register_action<server::Container::updateConfig_action>::register_action() >> in CommunicationHandler.cpp.o >> ld: symbol(s) not found for architecture x86_64 >> >> >> Any ideas where this comes from? >> >> >> Some (simplified) code to show how actions are declared/registered: >> >> >> >> >> —— Container.h: —— >> >> namespace server >> { >> class Container : public hpx::components::simple_component_base<Container> >> { >> public: >> glm::ivec3 loadData(const Config& config); >> HPX_DEFINE_COMPONENT_ACTION(Container, loadData); >> >> // ... >> }; >> >> } >> >> HPX_REGISTER_ACTION_DECLARATION(server::Container::loadData_action, >> container_loadData_action); >> // similar for other actions >> >> >> >> —— Container.cpp: —— >> >> #include "Container.h" >> >> HPX_REGISTER_COMPONENT_MODULE(); >> >> typedef hpx::components::simple_component<server::Container> Container_type; >> HPX_REGISTER_COMPONENT(Container_type, Container); >> >> HPX_REGISTER_ACTION(Container_type::wrapped_type::loadData_action, >> container_loadData_action); >> // similar for other actions >> >> >> namespace server >> { >> glm::ivec3 Container::loadData(const Config& config) >> { >> // ... >> } >> } >> >> >> >> >> >> Thanks! >> Tim >> >> >> _______________________________________________ >> hpx-users mailing list >> [email protected] <mailto:[email protected]> >> https://mail.cct.lsu.edu/mailman/listinfo/hpx-users > > _______________________________________________ > hpx-users mailing list > [email protected] > https://mail.cct.lsu.edu/mailman/listinfo/hpx-users
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ hpx-users mailing list [email protected] https://mail.cct.lsu.edu/mailman/listinfo/hpx-users
