Closed renatojmsdh closed 2 years ago
Hi @renatojmsdh ! Thanks!
Regarding your issue I think the problem does not come from the libpleno but from the lma lib. I guess lma have some struggle with newer version of gcc.
I suspect that it misses a const
at the right place in the allocator of the typdef
of the map type defined in src/libv/lma/lm/bundle/bundle10.hpp at the lines 487 to 495:
typedef typename br::as_map<
typename mpl::transform<
ListeParam,
bf::pair<
mpl::_1,
std::map<mpl::_1,ttt::Indice<mpl::_1>>
>
>::type
>::type MapAdressParameters;
I'm looking into this with the devs/maintainers of the lib lma since I'm not able to reproduce this error on my machine.
Could you try this quick change? In the aforementioned file, could you replace the typedef
definition by this code:
typedef typename br::as_map<
typename mpl::transform<
ListeParam,
bf::pair<
mpl::_1,
std::map<
mpl::_1,
ttt::Indice<mpl::_1>,
std::less<mpl::_1>,
std::allocator<std::pair<mpl::_1 const, ttt::Indice<mpl::_1>>
>
>
>
>::type
>::type MapAdressParameters;
By expliciting the other templates parameters, it may fix the issue but not I'm not certain. Could keep me update if it works? I'll keep looking for a fix in the meantime!
Otherwise if you are in a hurry, you could still downgrade the version of gcc
to the 7.5, the code has been tested for this version, even though this solution is not really satisfactory...
Hello @MathLabu thanks for the nice and prompt reply.
So downgrading to gcc-7.5 worked fine (I don't have problems with the downgrade because all libraries are being installed inside a Singularity container...so no harm to the overall system).
I first tested replacing the typedef const in lma but similar errors in other definitions with gcc-10 appeared. Some of them for info:
/usr/include/c++/10/bits/stl_map.h:123:71: error: static assertion failed: std::map must have the same value_type as its allocator
/usr/include/c++/10/bits/stl_map.h: In instantiation of 'class std::map<Distortions*, ttt::Indice<Distortions*>, std::less<Distortions*>, std::allocator<std::pair<const mpl_::arg<1>, ttt::Indice<Distortions*> > > >':
/usr/include/c++/10/bits/stl_map.h:123:71: error: static assertion failed: std::map must have the same value_type as its allocator
/usr/include/c++/10/bits/stl_map.h: In instantiation of 'class std::map<FocalLength*, ttt::Indice<FocalLength*>, std::less<FocalLength*>, std::allocator<std::pair<const mpl_::arg<1>, ttt::Indice<FocalLength*> > > >':
/code/libpleno/pleno/processing/calibration/plenoptic.cpp:109:2: required from here
/usr/include/c++/10/bits/stl_map.h:123:71: error: static assertion failed: std::map must have the same value_type as its allocator
123 | static_assert(is_same<typename _Alloc::value_type, value_type>::value,
/usr/include/c++/10/bits/stl_map.h: In instantiation of 'class std::map<GridMesh_<3>*, ttt::Indice<GridMesh_<3>*>, std::less<GridMesh_<3>*>, std::allocator<std::pair<const mpl_::arg<1>, ttt::Indice<GridMesh_<3>*> > > >':
/code/libpleno/pleno/processing/calibration/plenoptic.cpp:109:2: required from here
/usr/include/c++/10/bits/stl_map.h:123:71: error: static assertion failed: std::map must have the same value_type as its allocator
/usr/include/c++/10/bits/stl_map.h: In instantiation of 'class std::map<ThinLensCamera*, ttt::Indice<ThinLensCamera*>, std::less<ThinLensCamera*>, std::allocator<std::pair<const mpl_::arg<1>, ttt::Indice<ThinLensCamera*> > > >':
/code/libpleno/pleno/processing/calibration/plenoptic.cpp:109:2: required from here
/usr/include/c++/10/bits/stl_map.h:123:71: error: static assertion failed: std::map must have the same value_type as its allocator
/usr/include/c++/10/bits/stl_map.h: In instantiation of 'class std::map<Sensor*, ttt::Indice<Sensor*>, std::less<Sensor*>, std::allocator<std::pair<const mpl_::arg<1>, ttt::Indice<Sensor*> > > >':
In instantiation of 'class std::map<Pose_<3>*, ttt::Indice<Pose_<3>*>, std::less<Pose_<3>*>, std::allocator<std::pair<const mpl_::arg<1>, ttt::Indice<Pose_<3>*> > > >':
Thanks again for your help and time for solving it! We can now start testing and running it :wink:
Hello @MathLabu, nice work! I'm trying to install the library but I'm having one issue: static assertion failed: std::map must have the same value_type as its allocator. After installing the dependencies and during the compilation of libpleno in ubuntu 20.04 and gcc-10. Would you have a clue and help solving this? Thanks!