Skip to content
Snippets Groups Projects
Commit d9955e61 authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau Committed by Florian Uhlig
Browse files

Add info about boost archive versions + version checker binary

parent a6e7cba2
No related branches found
No related tags found
1 merge request!1753Add info about boost archive versions + version checker binary
Pipeline #29880 passed
...@@ -214,6 +214,11 @@ FairRoot: `v18.6.7` ...@@ -214,6 +214,11 @@ FairRoot: `v18.6.7`
Clang-format: `v11.0` Clang-format: `v11.0`
Boost archives being only ensured to be `backward compatible` (and therefore not necessarily
`forward compatible`), care must be taken when writing data and/or parameter files with it
that the versions used when writing and when using/reading are compatible. \
More information in the [following document](docs/boost_serialization_version.md).
# 5. Further remarks # 5. Further remarks
Compiling CbmRoot with multicore support using "make -j", without Compiling CbmRoot with multicore support using "make -j", without
......
# Boost serialization archive version
```
Boost version | BOOST_ARCHIVE_VERSION | Used in
1.54 | 10 | [Ubuntu Trusty 14.04 LTS default, EOL: 2024-04]
[...]
1.67 | 16 | [Debian 10 Buster 19.07, EOL: 2022-08]
1.68 | 17 | [Fairsoft jun19 and its patch versions]
1.69 | 17 |
1.70 | 17 |
1.71 | 17 | [Ubuntu Focal 20.04 LTS, EOL: 2030-04]
1.72 | 17 | [Fairsoft nov20]
1.73 | 18 |
1.74 | 18 | [Debian 11 Bullseye 21.08, EOL: 2024-07]
[Debian 12 Bookworm 23.07]
[Ubuntu Jammy 22.04 LTS, EOL: 2032-04]
1.75 | 18 | [Fairsoft apr21 and its patch versions]
1.76 | 19 |
1.77 | 19 |
1.78 | 19 | [Fairsoft apr22 and its patch versions]
1.79 | 19 |
1.80 | 19 | [Fairsoft nov22 and its patch versions]
1.81 | 19 |
1.82 | 19 |
1.83 | 19 | [Fairsoft jan24 and its patch versions]
1.84 | 20 |
dev | 20 |
```
-------------------
- Based on [the corresponding list in the Flesnet repository](https://github.com/cbm-fles/flesnet/blob/master/doc/boost_serialization.txt)
- List of BOOST_ARCHIVE_VERSION changes:
https://github.com/boostorg/serialization/blob/develop/src/basic_archive.cpp
# Version checker binary
See the [README of services/boost_bin_arch_version_checker](../services/boost_bin_arch_version_checker/README.md)
Standalone binary printing out the BOOST_ARCHIVE_VERSION of a boost binary archive and the minimal version of Fairsoft needed to read it.
# Caveats
1. The binary has to fully load/open the file to access the version number
1. `boost` throws an `unsupported version` exception of type `boost::archive::archive_exception` when encountering an archive created with a more recent and non-backward compatible version
=> !!! Use the newest version of `Fairsoft` or a most up to date version of `boost` to have largest compatibility !!!
=> User will probably want to use another version of `boost` than the one making troubles, therefore the independent compilation
# Compilation
With `Fairsoft nov22p1`
```
g++ check_archive_version.cpp -I/cvmfs/fairsoft.gsi.de/debian10/fairsoft/nov22p1/include/boost/archive/ -L/cvmfs/fairsoft.gsi.de/debian10/fairsoft/nov22p1/lib -Wl,-rpath,/cvmfs/fairsoft.gsi.de/debian10/fairsoft/nov22p1/lib -lboost_serialization -o check_archive_version
```
# Usage
```
./check_archive_version <PATH TO BOOST BINARY ARCHIVE>
```
# Example
```
> ./check_archive_version /lustre/cbm/online/output/mCBM_24/2914_00_00.rra
trying to check BOOST_ARCHIVE_VERSION of /lustre/cbm/online/output/mCBM_24/2914_00_00.rra
get_library_version() for /lustre/cbm/online/output/mCBM_24/2914_00_00.rra
=> 19
Minimal Fairsoft version: apr22 and its patch versions
```
# Pre-compiled version on lustre
- !!! Subject to changes without warning !!!
- Should work as long as operating under `Debian10` with `cvmfs` available (e.g. `vae23`or `GSI Linux on lxg/lxi`)
- Tested on `vae23` and one lxg machine
```
/lustre/cbm/users/ploizeau/tools/boost/check_archive_version
```
/* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
SPDX-License-Identifier: GPL-3.0-only
Authors: Pierre-Alain Loizeau [committer] */
#include <boost/archive/binary_iarchive.hpp>
#include <fstream>
#include <iostream>
#include <sstream>
int main(int argc, char* argv[])
{
if (2 != argc) {
std::cout << "This small programm needs a path to a boost archive as input argument!" << std::endl;
return -1;
}
std::cout << "trying to check BOOST_ARCHIVE_VERSION of " << argv[1] << std::endl;
std::ifstream ifs(argv[1], std::ios::binary);
if (!ifs) {
std::stringstream msg;
msg << "file \"" << argv[1] << "\" was not found";
throw std::runtime_error(msg.str());
}
boost::archive::binary_iarchive ia(ifs);
unsigned v = ia.get_library_version();
std::cout << "get_library_version() for " << argv[1] << "\n => " << v << std::endl;
if (v < 17) {
std::cout << "Any version of Fairsoft supported by Cbmroot should work" << std::endl;
}
else {
switch (v) {
case 17: {
std::cout << "Minimal Fairsoft version: jun19 and its patch versions" << std::endl;
break;
}
case 18: {
std::cout << "Minimal Fairsoft version: apr21 and its patch versions" << std::endl;
break;
}
case 19: {
std::cout << "Minimal Fairsoft version: apr22 and its patch versions" << std::endl;
break;
}
case 20:
default: {
std::cout << "No Fairsoft version supporting this file to date (10/04/2024)" << std::endl;
break;
}
}
}
return v;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment