Jump to content

SystemC embedded boost completely incompatible with latest boost?


Recommended Posts

Hello all, I am finding that SystemC 2.2 cannot harmoniously compile with boost 1.58 when -DSC_INCLUDE_DYNAMIC_PROCESSES is defined. It creates a condition where SystemC's embedded boost declarations are previously defined in the real boost.


Is there any workaround for this without completely hacking SystemC's boost sources to properly embed boost in "sc_boost" namespace instead of it colliding with the boost namespace from a different release?


Details of an example error:


In file included from /tmp/systemc/include/sysc/kernel/sc_boost.h:58:0,
                 from /tmp/systemc/include/sysc/kernel/sc_dynamic_processes.h:54,
                 from /tmp/systemc/include/systemc:94,
                 from ExampleX.h:32,
                 from Example.h:32,
                 from Example.cpp:25
/tmp/systemc/include/sysc/packages/boost/ref.hpp:31:25: error: redefinition of 'class boost::reference_wrapper<Type>'
In file included from /tmp/boost/1.58.0/boost/ref.hpp:15:0,
                 from /tmp/boost/1.58.0/boost/tuple/tuple.hpp:27,
                 from /tmp/boost/1.58.0/boost/multi_index/detail/index_base.hpp:28,
                 from /tmp/boost/1.58.0/boost/multi_index/detail/base_type.hpp:21,
                 from /tmp/boost/1.58.0/boost/multi_index_container.hpp:34,
                 from ExampleY.h:24,
                 from Example.h:27,
                 from Example.cpp:25:

PS. We aren't able to move to SystemC 2.3, but would like to know if this was solved in recent editions?

Link to comment
Share on other sites

As Roman pointed out, these symbol clashes have been avoided since SystemC 2.3 by moving the embedded copy to the sc_boost namespace.


In SystemC 2.2, you can try to get away with it by explicitly including all duplicate headers from the recent Boost version first, i.e. before including SystemC (hoping that the include guards have not been changed).  For those files, where the include guards have changed, you need to explicitly #define the sentinels as well to hide their duplicate inclusion.


There still be dragons, though.




Edited by Philipp A. Hartmann
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...