Error building on raspberrypi5

Hi,
I am new to Ovito, I am installing it on Rpi5 following the instructions for linux.
I get this error, while it builds the various files.

Thanks for your kind help.
Best,

Marco

> cmake --build . --parallel
> [1/576] Building CXX object src/ovito/core/CMakeFiles/Core.dir/rendering/FrameGraph.cpp.o
> FAILED: src/ovito/core/CMakeFiles/Core.dir/rendering/FrameGraph.cpp.o 
> /usr/bin/c++ -DBOOST_ALL_NO_LIB -DCore_EXPORTS -DOVITO_CORE_EXPORT=Q_DECL_EXPORT -DOVITO_PLUGINS_RELATIVE_PATH=\"../lib/ovito/plugins\" -DOVITO_PLUGIN_NAME=\"Core\" -DOVITO_PYTHON_LAYER_PATH=\"../lib/ovito/plugins/python\" -DOVITO_VIDEO_OUTPUT_SUPPORT -DOVITO_ZLIB_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT=1 -DQT_NO_FOREACH=1 -DQT_NO_KEYWORDS=1 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/home/rpi5zaro/ovito/build/src/ovito/core/Core_autogen/include -I/home/rpi5zaro/ovito/src -isystem /usr/include/aarch64-linux-gnu/qt6/QtCore -isystem /usr/include/aarch64-linux-gnu/qt6 -isystem /usr/lib/aarch64-linux-gnu/qt6/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt6/QtGui -isystem /home/rpi5zaro/ovito/src/3rdparty/function2/include -isystem /usr/include/aarch64-linux-gnu/qt6/QtNetwork -O3 -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wno-multichar -std=gnu++20 -Winvalid-pch -include /home/rpi5zaro/ovito/build/src/ovito/core/CMakeFiles/Core.dir/cmake_pch.hxx -MD -MT src/ovito/core/CMakeFiles/Core.dir/rendering/FrameGraph.cpp.o -MF src/ovito/core/CMakeFiles/Core.dir/rendering/FrameGraph.cpp.o.d -o src/ovito/core/CMakeFiles/Core.dir/rendering/FrameGraph.cpp.o -c /home/rpi5zaro/ovito/src/ovito/core/rendering/FrameGraph.cpp
> In file included from /usr/include/aarch64-linux-gnu/qt6/QtCore/qdebug.h:24,
>                  from /usr/include/aarch64-linux-gnu/qt6/QtCore/qcoreapplication.h:18,
>                  from /usr/include/aarch64-linux-gnu/qt6/QtCore/QCoreApplication:1,
>                  from /home/rpi5zaro/ovito/src/ovito/core/Core.h:66,
>                  from /home/rpi5zaro/ovito/build/src/ovito/core/CMakeFiles/Core.dir/cmake_pch.hxx:5,
>                  from <command-line>:
> /usr/include/aarch64-linux-gnu/qt6/QtCore/qvarlengtharray.h: In instantiation of 'void QVLABase<T>::reallocate_impl(qsizetype, void*, qsizetype, qsizetype, const T*) [with T = Ovito::FrameGraph::RenderingCommand; qsizetype = long long int]':
> /usr/include/aarch64-linux-gnu/qt6/QtCore/qvarlengtharray.h:187:13:   required from 'QVLABase<T>::value_type& QVLABase<T>::emplace_back_impl(qsizetype, void*, Args&& ...) [with Args = {Ovito::FrameGraph::RenderingCommand::Flag, std::unique_ptr<Ovito::RenderingPrimitive, std::default_delete<Ovito::RenderingPrimitive> >, const Ovito::AffineTransformationT<double>&, Ovito::OORef<const Ovito::Pipeline>, Ovito::OORef<Ovito::ObjectPickInfo>, unsigned int&}; T = Ovito::FrameGraph::RenderingCommand; reference = Ovito::FrameGraph::RenderingCommand&; qsizetype = long long int]'
> /usr/include/aarch64-linux-gnu/qt6/QtCore/qvarlengtharray.h:541:37:   required from 'T& QVarLengthArray<T, Prealloc>::emplace_back(Args&& ...) [with Args = {Ovito::FrameGraph::RenderingCommand::Flag, std::unique_ptr<Ovito::RenderingPrimitive, std::default_delete<Ovito::RenderingPrimitive> >, const Ovito::AffineTransformationT<double>&, Ovito::OORef<const Ovito::Pipeline>, Ovito::OORef<Ovito::ObjectPickInfo>, unsigned int&}; T = Ovito::FrameGraph::RenderingCommand; long long int Prealloc = 2]'
> /home/rpi5zaro/ovito/src/ovito/core/rendering/FrameGraph.h:169:33:   required from 'Ovito::FrameGraph::RenderingCommand& Ovito::FrameGraph::RenderingCommandGroup::addCommand(Args&& ...) [with Args = {Ovito::FrameGraph::RenderingCommand::Flag, std::unique_ptr<Ovito::RenderingPrimitive, std::default_delete<Ovito::RenderingPrimitive> >, const Ovito::AffineTransformationT<double>&, Ovito::OORef<const Ovito::Pipeline>, Ovito::OORef<Ovito::ObjectPickInfo>, unsigned int&}]'
> /home/rpi5zaro/ovito/src/ovito/core/rendering/FrameGraph.cpp:70:22:   required from here
> /usr/include/aarch64-linux-gnu/qt6/QtCore/qvarlengtharray.h:763:13: error: no matching function for call to 'Ovito::FrameGraph::RenderingCommand::RenderingCommand()'
>   763 |             new (data() + size()) T;
>       |             ^~~~~~~~~~~~~~~~~~~~~~~
> In file included from /home/rpi5zaro/ovito/src/ovito/core/rendering/FrameGraph.cpp:24:
> /home/rpi5zaro/ovito/src/ovito/core/rendering/FrameGraph.h:86:26: note: candidate: 'Ovito::FrameGraph::RenderingCommand::RenderingCommand(Flags, std::unique_ptr<Ovito::RenderingPrimitive>, const Ovito::AffineTransformation&, Ovito::OORef<const Ovito::Pipeline>, Ovito::OORef<Ovito::ObjectPickInfo>, uint32_t)'
>    86 |                 explicit RenderingCommand(Flags flags, std::unique_ptr<RenderingPrimitive> primitive, const AffineTransformation& tm, OORef<const Pipeline> pipeline = {}, OORef<ObjectPickInfo> pickInfo = {}, uint32_t pickElementOffset = 0) :
>       |                          ^~~~~~~~~~~~~~~~
> /home/rpi5zaro/ovito/src/ovito/core/rendering/FrameGraph.h:86:26: note:   candidate expects 6 arguments, 0 provided
> /home/rpi5zaro/ovito/src/ovito/core/rendering/FrameGraph.h:72:33: note: candidate: 'Ovito::FrameGraph::RenderingCommand::RenderingCommand(Ovito::FrameGraph::RenderingCommand&&)'
>    72 |         class OVITO_CORE_EXPORT RenderingCommand
>       |                                 ^~~~~~~~~~~~~~~~
> /home/rpi5zaro/ovito/src/ovito/core/rendering/FrameGraph.h:72:33: note:   candidate expects 1 argument, 0 provided
> In file included from /home/rpi5zaro/ovito/src/ovito/core/rendering/FrameGraph.h:33:
> /home/rpi5zaro/ovito/src/ovito/core/rendering/CylinderPrimitive.h: In lambda function:
> /home/rpi5zaro/ovito/src/ovito/core/rendering/CylinderPrimitive.h:153:50: note: parameter passing for argument of type 'std::pair<double, double>' when C++17 is enabled changed to match C++14 in GCC 10.1
>   153 |                 cachedMaxWidth = widths()->minMax().second;
>       |                                  ~~~~~~~~~~~~~~~~^~
> ninja: build stopped: subcommand failed.

I’m not sure, but it looks like either an incompatibility of the c++ compiler or the Qt6 framework. Which versions are you using?

Hi,
qt6 is 6.4.2, while gcc/g++ are Debian 12.2.0-14 12.2.0
using v10.3.6 of ovito compiles fine.

Thanks a lot!

Marco

We nowadays build OVITO with newer Qt versions (6.7 or 6.8), and ensuring backwards compatibility with old Qt releases is not always easy. Please take a look at the header file FrameGraph.h. Here should find a fallback that is being used when building with old Qt versions:

#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
		QVarLengthArray<RenderingCommand, 2> _commands;
#else
		std::vector<RenderingCommand> _commands;
#endif

I suggest you change the threshold from 6.4.0 to 6.5.0 such that the fallback will also be used with your Qt 6.4.2.

Hi,
thanks, that fixes the error, but another one pops up… On the other hand, version 3.10.6 of ovito compiles and runs fine. The other error is below, if you want to have a look. Otherwise, thanks for your help in any case.
Best,

Marco

FAILED: src/ovito/particles/CMakeFiles/Particles.dir/modifier/analysis/chill_plus/ChillPlusModifier.cpp.o
/usr/bin/c++ -DBOOST_ALL_NO_LIB -DGARGANTUA=1 -DGEO_USE_DUMMY_ATOMICS=1 -DOVITO_BUILD_PLUGIN_MESH -DOVITO_BUILD_PLUGIN_PARTICLES -DOVITO_BUILD_PLUGIN_STDMOD -DOVITO_BUILD_PLUGIN_STDOBJ -DOVITO_CORE_EXPORT=Q_DECL_IMPORT -DOVITO_DELAUNAY_EXPORT=Q_DECL_IMPORT -DOVITO_GRID_EXPORT=Q_DECL_IMPORT -DOVITO_MESH_EXPORT=Q_DECL_IMPORT -DOVITO_OPENGLRENDERER_EXPORT=Q_DECL_IMPORT -DOVITO_PARTICLES_EXPORT=Q_DECL_EXPORT -DOVITO_PLUGIN_NAME="Particles" -DOVITO_STDMOD_EXPORT=Q_DECL_IMPORT -DOVITO_STDOBJ_EXPORT=Q_DECL_IMPORT -DOVITO_VIDEO_OUTPUT_SUPPORT -DOVITO_ZLIB_SUPPORT -DParticles_EXPORTS -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT=1 -DQT_NO_FOREACH=1 -DQT_NO_KEYWORDS=1 -DQT_OPENGL_LIB -DQT_XML_LIB -I/home/rpi5zaro/ovito/build_master/src/ovito/particles/Particles_autogen/include -I/home/rpi5zaro/ovito/src -I/home/rpi5zaro/ovito/src/3rdparty/voro++/src -I/home/rpi5zaro/ovito/src/3rdparty/ptm/… -I/home/rpi5zaro/ovito/src/3rdparty/mwm_csp/… -I/home/rpi5zaro/ovito/src/3rdparty/xdrfile/… -I/home/rpi5zaro/ovito/src/3rdparty/gsd/… -I/home/rpi5zaro/ovito/build_master/src/3rdparty/muparser -I/home/rpi5zaro/ovito/src/3rdparty/muparser/… -I/home/rpi5zaro/ovito/src/3rdparty/geogram/… -isystem /usr/include/aarch64-linux-gnu/qt6/QtCore -isystem /usr/include/aarch64-linux-gnu/qt6 -isystem /usr/lib/aarch64-linux-gnu/qt6/mkspecs/linux-g++ -isystem /usr/include/aarch64-linux-gnu/qt6/QtGui -isystem /home/rpi5zaro/ovito/src/3rdparty/function2/include -isystem /usr/include/aarch64-linux-gnu/qt6/QtNetwork -isystem /usr/include/aarch64-linux-gnu/qt6/QtXml -isystem /usr/include/aarch64-linux-gnu/qt6/QtOpenGL -O3 -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wno-multichar -std=gnu++20 -Winvalid-pch -include /home/rpi5zaro/ovito/build_master/src/ovito/particles/CMakeFiles/Particles.dir/cmake_pch.hxx -MD -MT src/ovito/particles/CMakeFiles/Particles.dir/modifier/analysis/chill_plus/ChillPlusModifier.cpp.o -MF src/ovito/particles/CMakeFiles/Particles.dir/modifier/analysis/chill_plus/ChillPlusModifier.cpp.o.d -o src/ovito/particles/CMakeFiles/Particles.dir/modifier/analysis/chill_plus/ChillPlusModifier.cpp.o -c /home/rpi5zaro/ovito/src/ovito/particles/modifier/analysis/chill_plus/ChillPlusModifier.cpp
In file included from /usr/include/boost/numeric/ublas/vector.hpp:21,
from /usr/include/boost/numeric/ublas/matrix.hpp:18,
from /home/rpi5zaro/ovito/src/ovito/particles/modifier/analysis/chill_plus/ChillPlusModifier.h:30,
from /home/rpi5zaro/ovito/src/ovito/particles/modifier/analysis/chill_plus/ChillPlusModifier.cpp:30:
/usr/include/boost/numeric/ublas/storage.hpp: In instantiation of ‘boost::numeric::ublas::unbounded_array<T, ALLOC>::unbounded_array(size_type, const ALLOC&) [with T = std::complex; ALLOC = std::allocator<std::complex >; size_type = long unsigned int]’:
/usr/include/boost/numeric/ublas/matrix.hpp:133:42: required from ‘boost::numeric::ublas::matrix<T, L, A>::matrix(size_type, size_type) [with T = std::complex; L = boost::numeric::ublas::basic_row_major<>; A = boost::numeric::ublas::unbounded_array<std::complex, std::allocator<std::complex > >; size_type = long unsigned int]’
/home/rpi5zaro/ovito/src/ovito/particles/modifier/analysis/chill_plus/ChillPlusModifier.cpp:80:81: required from here
/usr/include/boost/numeric/ublas/storage.hpp:79:30: error: ‘class std::allocator<std::complex >’ has no member named ‘construct’
79 | alloc_.construct(d, value_type());
| ~^~~
[7/198] Building CXX object src/ovito/particles/CMakeFiles/Particles.dir/import/vasp/POSCARImporter.cpp.o
ninja: build stopped: subcommand failed.

Given that all dependencies and build tools remained the same on your system, this error most likely is a result of the change in language standard we use to compile the code. We’ve ported the OVITO code base from C++17 to C++20 during the 3.10 → 3.11 release cycle.

In this particular case, a missing #include <complex> statement could be responsible for the error. I’ve added that include statement to the dev3.11.1 branch of the git repository. You can switch to that branch if you like to test this hypothesis. The branch also includes the other code change we’ve discussed earlier.