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

Build error for xrt with gcc-14 and solution #134

Closed
xmixahlx opened this issue Jun 21, 2024 · 2 comments
Closed

Build error for xrt with gcc-14 and solution #134

xmixahlx opened this issue Jun 21, 2024 · 2 comments

Comments

@xmixahlx
Copy link

xmixahlx commented Jun 21, 2024

I received an error building xrt with gcc-14:

In file included from /home/mike/Development/MISC/xdna-driver_main/xrt/src/runtime_src/tools/xclbinutil/R>
                 from /home/mike/Development/MISC/xdna-driver_main/xrt/src/runtime_src/tools/xclbinutil/R>
/usr/include/rapidjson/document.h: In member function 'rapidjson::GenericStringRef<CharType>& rapidjson::>
/usr/include/rapidjson/document.h:319:82: error: assignment of read-only member 'rapidjson::GenericString>
  319 |     GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }

This issue is also described in (several) bug reports as an issue with rapidjson 1.1.0 (the current release, although very old):
https://www.mail-archive.com/[email protected]/msg196747.html
https://bugs.gentoo.org/919374

The solution is to either patch 1.1.0 with a more recent commit:

https://github.com/Tencent/rapidjson/commit/3b2441b8.patch

... or pull rapidjson from git upstream (which is what I did to resolve after disabling the build tests):

git clone --depth=1 https://github.com/tencent/rapidjson.git rapidjson
cd rapidjson
mkdir tmpbuild
cd tmpbuild
CC=gcc-14 CXX=g++-14 cmake -DRAPIDJSON_BUILD_TESTS=OFF ..
make -j `nproc`
sudo make install

Now all of the XDNA components (linux kernel, xrt, xrt-xdna) successfully build with gcc-14.

Thanks @maxzhen and @sonals for your help.

Cheers,
Michael

@keryell
Copy link
Contributor

keryell commented Jun 26, 2024

I think this is also Xilinx/XRT#8139

@keryell
Copy link
Contributor

keryell commented Jun 26, 2024

The long term solution is to use another modern JSON library instead.

@maxzhen maxzhen closed this as completed Jul 24, 2024
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

3 participants