Skip to content

Verilator build fails with “requires a C++14 or newer compiler” due to hard-coded -std=gnu++11 #2641

@BekiryY

Description

@BekiryY

Is there an existing core-v-verif task for this?

  • I have searched the existing task issues

Task Description

While building cv32e40p/sim/core testbench using Verilator (v5.040), the generated makefiles still compile with -std=gnu++11, even when newer compilers and flags are provided.
This causes the build to fail with:

/usr/local/share/verilator/include/verilatedos.h:281:3: error:
#error "Verilator requires a C++14 or newer compiler"

Environment:

Verilator: 5.040 (built with g++-11)

GCC: g++-11 (C++17 default)

Host: Ubuntu 24 / VirtualBox

Description of Done

Verilator builds should use a modern C++ standard (≥ C++14).
Either:

Allow overriding -std via Makefile variables (VERI_FLAGS, VERI_COMPILE_FLAGS, etc.), or

Pass --compiler-flags to Verilator instead of -CFLAGS so user-defined flags appear after internal defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    taskAssignment to create something new

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions