5

I read somewhere that the serialization library of boost has to be compiled (I forgot where I read it, otherwise I would have posted a link).

So I downloaded the latest release from source forge and extracted it to a path in my project. And now?

I investigated the folder, but I couldn't find a makefile.

So what do I have to do, to compile the boost:serialization lib?

Edit: nevertheless I tried to work with it, without compiling it, but I get this error:

boost/archive/basic_xml_oarchive.hpp:92:9: error: 
no matching function for call to 'assertion_failed'
    BOOST_MPL_ASSERT((serialization::is_wrapper< T >));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So I think the reason for this is, that it wasn't compiled. Is that right?

Rico-E
  • 1,806
  • 2
  • 28
  • 47
  • Full instructions to build Boost are here: http://www.boost.org/doc/libs/1_55_0/more/getting_started/ – JBentley Jan 15 '14 at 15:26
  • @JBentley: ahh... there is the page where I read, that the serialization lib has to be compiled :). Oh... and I see, that there are the install instructions too. Thanks – Rico-E Jan 15 '14 at 15:30
  • You can install boost library for Ubuntu from the package manager -> https://stackoverflow.com/questions/12578499/how-to-install-boost-on-ubuntu – raw-bin hood May 28 '20 at 02:24

1 Answers1

13

To build Boost, follow the instructions here.

As per your comment, you want to build just a part of Boost (serialization). If you follow the above link, there is a section containing the following advice (wording might vary, I've copied it from the Windows instructions):

For a description of other options you can pass when invoking b2, type:

b2 --help

In particular, to limit the amount of time spent building, you may be interested in:

  • reviewing the list of library names with --show-libraries
  • limiting which libraries get built with the --with-library-name or --without-library-name options

Typing b2 --show-libraries yields the following:

The following libraries require building:
    - atomic
    - chrono
    - context
    - coroutine
    - date_time
    - exception
    - filesystem
    - graph
    - graph_parallel
    - iostreams
    - locale
    - log
    - math
    - mpi
    - program_options
    - python
    - random
    - regex
    - serialization
    - signals
    - system
    - test
    - thread
    - timer
    - wave

So, to build just serialization, pass the option --with-serialization to b2 e.g. to build all library types (static/dynamic library, static/dynamic runtime, debug/release, single/multithreading) using VS2013 you could type this:

b2 toolset=msvc-12.0 --with-serialization --build-type=complete stage

Note, if you plan to make use of Boost in future projects, it may be simpler to just build the entire thing (i.e. omitting the --with-serialization option) so that all libraries are ready to use straight away whenever you need them.

Community
  • 1
  • 1
JBentley
  • 6,099
  • 5
  • 37
  • 72
  • 1
    thank you. After your recommendation I built all libs. I'm getting `link.jam no such file or directory` at the very first beginning. Is there something wrong? – Rico-E Jan 16 '14 at 06:00
  • 1
    @Rico-E this whole process seems obfuscated. – Chris Apr 05 '17 at 01:50