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

Boost 1.74 cannot compile simple example with serialization/set.hpp #219

Closed
fcooper8472 opened this issue Sep 8, 2020 · 19 comments
Closed

Comments

@fcooper8472
Copy link

Minimal failing example.

Including boost/serialization/set.hpp does not compile:

#include <boost/serialization/set.hpp>

int main() {
    return 0;
}

the following error is produced:

/celibs/boost_1_74_0/boost/serialization/set.hpp: In function 'void boost::serialization::load_set_collection(Archive&, Container&)':

/celibs/boost_1_74_0/boost/serialization/set.hpp:40:33: error: 'library_version_type' in namespace 'boost::serialization' does not name a type; did you mean 'item_version_type'?

   40 |     const boost::serialization::library_version_type library_version(

      |                                 ^~~~~~~~~~~~~~~~~~~~

      |                                 item_version_type

/celibs/boost_1_74_0/boost/serialization/set.hpp:47:30: error: 'library_version_type' is not a member of 'boost::serialization'; did you mean 'item_version_type'?

   47 |     if(boost::serialization::library_version_type(3) < library_version){

      |                              ^~~~~~~~~~~~~~~~~~~~

      |                              item_version_type

/celibs/boost_1_74_0/boost/serialization/set.hpp:47:56: error: 'library_version' was not declared in this scope

   47 |     if(boost::serialization::library_version_type(3) < library_version){

      |                                                        ^~~~~~~~~~~~~~~

ASM generation compiler returned: 1

In file included from <source>:1:

/celibs/boost_1_74_0/boost/serialization/set.hpp: In function 'void boost::serialization::load_set_collection(Archive&, Container&)':

/celibs/boost_1_74_0/boost/serialization/set.hpp:40:33: error: 'library_version_type' in namespace 'boost::serialization' does not name a type; did you mean 'item_version_type'?

   40 |     const boost::serialization::library_version_type library_version(

      |                                 ^~~~~~~~~~~~~~~~~~~~

      |                                 item_version_type

/celibs/boost_1_74_0/boost/serialization/set.hpp:47:30: error: 'library_version_type' is not a member of 'boost::serialization'; did you mean 'item_version_type'?

   47 |     if(boost::serialization::library_version_type(3) < library_version){

      |                              ^~~~~~~~~~~~~~~~~~~~

      |                              item_version_type

/celibs/boost_1_74_0/boost/serialization/set.hpp:47:56: error: 'library_version' was not declared in this scope

   47 |     if(boost::serialization::library_version_type(3) < library_version){

      |                                                        ^~~~~~~~~~~~~~~

Execution build compiler returned: 1

This is not a problem pre-1.74.

@robertramey
Copy link
Member

OK - I fixed this one the develop branch. Should migrate to master on next release. Thanks for catching this!

@fcooper8472
Copy link
Author

Great, thanks for fixing!

@jagerman
Copy link

I also get this failure from boost/serialization/list.hpp, but the fix on master looks like it only applies to set.hpp. (Looking at the include dir, I think slist.hpp also needs it added).

@robertramey
Copy link
Member

right - will do. Are there any others?

@fcooper8472
Copy link
Author

Just gone through to check which headers when included on their own produce compilation errors (with g++-10):

#include <boost/serialization/boost_unordered_map.hpp>
#include <boost/serialization/boost_unordered_set.hpp>
#include <boost/serialization/hash_collections_load_imp.hpp>
#include <boost/serialization/list.hpp>
#include <boost/serialization/set.hpp>
#include <boost/serialization/slist.hpp>
#include <boost/serialization/unordered_collections_load_imp.hpp>
#include <boost/serialization/unordered_map.hpp>
#include <boost/serialization/unordered_set.hpp>

The following headers each produced the following error:

#include <boost/serialization/hash_collections_save_imp.hpp>
#include <boost/serialization/hash_map.hpp>
#include <boost/serialization/hash_set.hpp>

error: 'version' was not declared in this scope
...

The following header produces the following error:

#include <boost/serialization/optional.hpp>

error: 'version' is not a class template
...

Finally, there's a file:

boost/serialization/collection_size_type copy.hpp

that looks a bit suspect.

@fcooper8472 fcooper8472 reopened this Sep 16, 2020
@robertramey
Copy link
Member

I believe these are fixed. BUT I haven't run the tests you've run. So you should run them again.

I didn't get the comment "boost/serialization/collection_size_type copy.hpp" so there may be something to do in that area.

To summarize, this should be better, but somehow I don't think we're quite done yet. Ideally I'd like to add a bunch of tests for this so the problem can never happen again. Using B2 these would be "compile only". I don't remember how it would be done for CMake. In any case, it would be quite a number of tests. I'm not sure I'm up for this.

@fcooper8472
Copy link
Author

@robertramey just that there are both:

boost/serialization/collection_size_type.hpp
boost/serialization/collection_size_type copy.hpp

and the latter is the only header with a " copy" in it, and wondered if it was supposed to be there at all. The contents of the file are substantially different, but it doesn't seem to be referenced anywhere.

The library seems to compile happily without it (although I see the header files are being found using file(GLOB ...) in CMake which not recommended.

I'm unable to compile the tests though (see errors below which I don't have time right now to chase down), so I can't be certain whether or not that functionality is being used anywhere.

/usr/bin/ld: libwserialization.so: undefined reference to `boost::archive::detail::utf8_codecvt_facet::utf8_codecvt_facet(unsigned long)'

@robertramey
Copy link
Member

robertramey commented Sep 28, 2020 via email

hdclark pushed a commit to hdclark/Ygor that referenced this issue Dec 10, 2020
An extra header may now be required for Boost 1.74. See boostorg/serialization#219 and, for
example, jngrad/espresso@a392907 .
hdclark pushed a commit to hdclark/DICOMautomaton that referenced this issue Dec 10, 2020
An extra header may now be required for Boost 1.74. See boostorg/serialization#219 and, for
example, jngrad/espresso@a392907 .
deniskristak pushed a commit to deniskristak/easybuild-easyconfigs that referenced this issue Jan 15, 2021
deniskristak pushed a commit to deniskristak/easybuild-easyconfigs that referenced this issue Jan 15, 2021
jngrad added a commit to jngrad/espresso that referenced this issue Mar 8, 2021
This <boost/serialization/library_version_type.hpp> include guards against
an issue in boost::serialization from boost 1.74.0 that leads to compiler
error "'library_version_type' is not a member of 'boost::serialization'"
when including <boost/serialization/unordered_map.hpp>. More details
in ticket boostorg/serialization#219
@MatheusJulidori
Copy link

Seems to be happening again after ubuntu 22.04 update

Tried to make a file and this error was launched:

/usr/include/boost/serialization/unordered_collections_load_imp.hpp:51:27: error: ‘library_version_type’ is not a member of ‘boost::serialization’; did you mean ‘item_version_type’?
   51 |     boost::serialization::library_version_type library_version(
      |                           ^~~~~~~~
      |                           item_version_type
/usr/include/boost/serialization/unordered_collections_load_imp.hpp:57:30: error: ‘library_version_type’ is not a member of ‘boost::serialization’; did you mean ‘item_version_type’?
   57 |     if(boost::serialization::library_version_type(3) < library_version){
      |                              ^~~~~~~~
      |                              item_version_type
/usr/include/boost/serialization/unordered_collections_load_imp.hpp:57:56: error: ‘library_version’ was not declared in this scope; did you mean ‘SSLeay_version’?
   57 |     if(boost::serialization::library_version_type(3) < library_version){

@chrischarlesharrison
Copy link

I can confirm Matheus' issue with a fresh install of Ubuntu 22.

@pavel-odintsov
Copy link

I've used this bugfix jngrad/espresso@f33faf0 for our project and it worked just fine pavel-odintsov/fastnetmon@c0d0454

@Jonas-Wessner
Copy link

I still get the following error with boost 1.74 which I have just freshly installed with apt-get a couple of minutes ago on Ubuntu 22.04.

/usr/include/boost/serialization/set.hpp:40:33: error: ‘library_version_type’ in namespace ‘boost::serialization’ does not name a type; did you mean ‘item_version_type’?
   40 |     const boost::serialization::library_version_type library_version(
      |                                 ^~~~~~~~~~~~~~~~~~~~

@robertramey
Copy link
Member

I've totally lost track of this. Current version looks OK to see. So I'm going to close this issue. Fee free to re-open (again) or make a new issue(better)

@fallaha
Copy link

fallaha commented Sep 6, 2023

I can confirm this issue (library_version_type) with a fresh install of Ubuntu 22.

@robertramey
Copy link
Member

Thinking about this. Let's assume for now that this issue is only present in Boost 1.74. And suppose we found it and had a fix. Then what would we do? The release date is August 2020. Would be go back an update the Boost 1.74 package? Somehow I doubt it. My suggestion would be to:

  • verify if the same issue occurs in the current release.
  • If not - do nothing
  • if it does - fix it in the current release
  • Recommend to users who experience this issue to upgrade the most recent release

@fallaha
Copy link

fallaha commented Sep 6, 2023

OK, but how can I update it in UBUNTU 22.04 apt package manager?
can't you update it in UBUNTU repository?

@robertramey
Copy link
Member

Sorry, I don't know all the vagaries of boost distribution.

@Jonas-Wessner
Copy link

Jonas-Wessner commented Sep 7, 2023

The issue is that the problem exists in the currently by apt delivered version. (1.74).
Building and installing from source is a nightmare if you are on a laptop since it will take many hours.
Anyways, I just made this comment because I think a bug report is in general valuable information. If you don't want to use it, then don't. I also understand that fixing a bug in an old software version is not prioritized.

@angelinesalberto
Copy link

I have the same problem with boost-1.82.0 and rocky

/mnt/lustre/home/spack/spack/opt/spack/linux-rocky8-icelake/gcc-8.5.0/boost-1.82.0-v2eykt7r24sm77j3d3lcr7r6qfe4pe3m//include/boost/property_tree/ptree_serialization.hpp:66:24: error: 'library_version_type' in namespace 'bsa' does not name a type
const bsa::library_version_type library_version(
^~~~~~~~~~~~~~~~~~~~
/mnt/lustre/home/spack/spack/opt/spack/linux-rocky8-icelake/gcc-8.5.0/boost-1.82.0-v2eykt7r24sm77j3d3lcr7r6qfe4pe3m//include/boost/property_tree/ptree_serialization.hpp:69:21: error: 'library_version_type' is not a member of 'bsa'
if(bsa::library_version_type(3) < library_version){
^~~~~~~~~~~~~~~~~~~~
/mnt/lustre/home/spack/spack/opt/spack/linux-rocky8-icelake/gcc-8.5.0/boost-1.82.0-v2eykt7r24sm77j3d3lcr7r6qfe4pe3m//include/boost/property_tree/ptree_serialization.hpp:69:21: note: suggested alternative:
In file included from /mnt/lustre/home/spack/spack/opt/spack/linux-rocky8-icelake/gcc-8.5.0/boost-1.82.0-v2eykt7r24sm77j3d3lcr7r6qfe4pe3m//include/boost/serialization/vector.hpp:28,
from ../../../../src/util/serialization.h:39,
from ../../../../src/util/input/input.h:31,
from ../../../../src/util/input/input.cc:27:
/mnt/lustre/home/spack/spack/opt/spack/linux-rocky8-icelake/gcc-8.5.0/boost-1.82.0-v2eykt7r24sm77j3d3lcr7r6qfe4pe3m//include/boost/serialization/library_version_type.hpp:36:7: note: 'boost::serialization::library_version_type'
class library_version_type {
^~~~~~~~~~~~~~~~~~~~
In file included from ../../../../src/util/serialization.h:46,
from ../../../../src/util/input/input.h:31,
from ../../../../src/util/input/input.cc:27:
/mnt/lustre/home/spack/spack/opt/spack/linux-rocky8-icelake/gcc-8.5.0/boost-1.82.0-v2eykt7r24sm77j3d3lcr7r6qfe4pe3m//include/boost/property_tree/ptree_serialization.hpp:69:47: error: 'library_version' was not declared in this scope
if(bsa::library_version_type(3) < library_version){
^~~~~~~~~~~~~~~
/mnt/lustre/home/spack/spack/opt/spack/linux-rocky8-icelake/gcc-8.5.0/boost-1.82.0-v2eykt7r24sm77j3d3lcr7r6qfe4pe3m//include/boost/property_tree/ptree_serialization.hpp:69:47: note: suggested alternative: 'item_version'
if(bsa::library_version_type(3) < library_version){
^~~~~~~~~~~~~~~
item_version

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

No branches or pull requests

9 participants