Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-14109

Make memory-model-test compatible with the v5 toolchain

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT12.0.0, 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: Evergreen
    • None
    • Storage Engines
    • 1
    • StorEng - 2025-03-14

      Two issues have arisen during work to get the memory-model-test task working with the v5 toolchain.

      == Installing the toolchain ==

      While testing the new v5 toolchain, the toolchain must currently be explicitly installed. Attempting to install the v5 toolchain directly in the inline script generates a syntax error in the Evergreen script. This is related to the <<< operator in the install command (see this webpage for relevant info).

       

      == Compiler flag issues if an older compiler is picked by by mistake ==

      The command to compile the memory-mode-test is:
      g++ -o memory_model_test -O2 memory_model_test.cpp -lpthread -std=c++20 -Wall -Werror
      Before compiling, the current version of the memory-model-test adds the v4 toolchain to the path using the following:
       export "PATH=/opt/mongodbtoolchain/v4/bin:$PATH"
       
      Changing the path setup to:
       export "PATH=/opt/mongodbtoolchain/v5/bin:$PATH"

      will work if the v5 toolchain is correctly installed. If it is not installed, then the gcc compiler will be picked up from /usr/bin, and the following error generated:

      g+: error: unrecognized command line option '-std=c20'; did you mean '-std=c+2a'?

      This is because the compiler in /usr/bin is is too old to recognise the -std=c+20 option (hence the reference to -std=c+2a which applied to gcc v9 and older). -std=c+20 is supported by the v4 and v5 toolchain compilers.

      A temporary workaround is to create a seperate script to run the installation of v5 toolchain and run the tests, and and then the tests pass.  Hopefully, once the v5 toolchain is installed by default, the change to get the test to run will be as simple as changing v4 to v5 in the toolchain path.

            Assignee:
            jasmine.bi@mongodb.com Jasmine Bi
            Reporter:
            jasmine.bi@mongodb.com Jasmine Bi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: