Skip to content

Build fail with rapidjson when using GCC=14.1.0 #4947

Closed as not planned
Closed as not planned

Description

@QuantumMisaka

Describe the bug

When building ABACUS with rapidjson support with GCC 14.1.0, error occurs:

[ 90%] Building CXX object source/module_io/CMakeFiles/io_basic.dir/write_dos_lcao.cpp.o
[ 90%] Building CXX object source/module_io/CMakeFiles/io_basic.dir/write_orb_info.cpp.o
In file included from /lustre/home/2201110432/WORK/test/abacus-develop/source/module_io/json_output/abacusjson.h:12,
                 from /lustre/home/2201110432/WORK/test/abacus-develop/source/module_io/para_json.cpp:11:
/lustre/home/2201110432/WORK/test/abacus-develop/toolchain-gcc/install/rapidjson-1.1.0/include/rapidjson/document.h: In member function ‘rapidjson::GenericStringRef<CharType>& rapidjson::GenericStringRef<CharType>::operator=(const rapidjson::GenericStringRef<CharType>&)’:
/lustre/home/2201110432/WORK/test/abacus-develop/toolchain-gcc/install/rapidjson-1.1.0/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; }
      |                                                                           ~~~~~~~^~~~~~~~~~~~
gmake[2]: *** [source/module_io/CMakeFiles/io_basic.dir/build.make:440: source/module_io/CMakeFiles/io_basic.dir/para_json.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
[ 90%] Built target io_input
[ 90%] Built target io_advanced
gmake[1]: *** [CMakeFiles/Makefile2:1839: source/module_io/CMakeFiles/io_basic.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
-- Install configuration: ""

For GCC 8.5.0 or 12.2.0, everything is normal.

Expected behavior

ABACUS with Rapidjson for GCC=14 should be normally built

To Reproduce

build ABACUS with GCC=14.1.0 with -DENABLE_RAPIDJSON=ON , along with:

  • SCALAPACK 2.2.1
  • OpenMPI 5.0.3
  • OpenBLAS 0.3.27
  • ELPA 2024.03.001
  • CEREAL

Environment

ABACUS version: https://github.com/QuantumMisaka/abacus-develop

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Verify the issue is not a duplicate.
  • Describe the bug.
  • Steps to reproduce.
  • Expected behavior.
  • Error message.
  • Environment details.
  • Additional context.
  • Assign a priority level (low, medium, high, urgent).
  • Assign the issue to a team member.
  • Label the issue with relevant tags.
  • Identify possible related issues.
  • Create a unit test or automated test to reproduce the bug (if applicable).
  • Fix the bug.
  • Test the fix.
  • Update documentation (if necessary).
  • Close the issue and inform the reporter (if applicable).

Activity

  1. caic99 commented on Aug 12, 2024

    @caic99
    Member
  2. WHUweiqingzhou commented on Aug 15, 2024

    @WHUweiqingzhou
    Collaborator

    Maybe wait for the fix?

  3. Growl1234 commented on Sep 19, 2026

    @Growl1234

    With #7979 ABACUS no longer uses RapidJSON, and with #7993 the unused cereal JSON archive inclusion is removed. Therefore, this issue should no longer exist now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions