You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XRT uses https://github.com/Tencent/rapidjson to parse JSON files but this is an archaic C++ which is mostly unchanged since 2016.
Compiling XRT leads to
In file included from /home/rkeryell/Xilinx/Projects/AIE/xdna-driver/xrt/src/runtime_src/tools/xclbinutil/RapidJsonUtilities.h:24,
from /home/rkeryell/Xilinx/Projects/AIE/xdna-driver/xrt/src/runtime_src/tools/xclbinutil/RapidJsonUtilities.cxx:20:
/usr/include/rapidjson/document.h: In member function ‘rapidjson::GenericStringRef<CharType>& rapidjson::GenericStringRef<CharType>::operator=(const rapidjson::GenericStringRef<CharType>&)’:
/usr/include/rapidjson/document.h:319:82: error: assignment of read-only member ‘rapidjson::GenericStringRef<CharType>::length’
319 | GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }
|
which is actually Tencent/rapidjson#718 which was opened and solved in... 2016!
For some reasons Ubuntu/Debian distributes a version from 2016 from before this patch plus some Debian-specific changes.
I can see a few solutions by order of decreasing quality:
get rid of this obsolete library and move to a modern library as there are many of them shipped in Linux distributions;
ship the fixed file with XRT if the license allows it or use something like CMake/FetchContent to install our own;
get the library updated on Debian/Ubuntu, but it will take some time;
patch the library by commenting line 319 of /usr/include/rapidjson/document.h as
In the following the members are const so obviously there cannot be an assignment operator...
template<typename CharType>
structGenericStringRef {
GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }
const Ch* const s; //!< plain CharType pointerconst SizeType length; //!< length of the string (excluding the trailing NULL terminator)
The text was updated successfully, but these errors were encountered:
keryell
changed the title
XRT uses rapidjson which does not compile on Ubuntu 24.04
XRT uses rapidjson-dev which does not compile on Ubuntu 24.04
May 3, 2024
XRT uses https://github.com/Tencent/rapidjson to parse JSON files but this is an archaic C++ which is mostly unchanged since 2016.
Compiling XRT leads to
which is actually Tencent/rapidjson#718 which was opened and solved in... 2016!
For some reasons Ubuntu/Debian distributes a version from 2016 from before this patch plus some Debian-specific changes.
I can see a few solutions by order of decreasing quality:
/usr/include/rapidjson/document.h
as// GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }
(which is what I did to have XRT running on my laptop because I am lazy).
Some background information:
https://github.com/Tencent/rapidjson
https://packages.ubuntu.com/noble/rapidjson-dev
https://packages.debian.org/sid/rapidjson-dev
In the following the members are
const
so obviously there cannot be an assignment operator...The text was updated successfully, but these errors were encountered: