Search code examples
conan

How do I run "conan init" and disable the warning about GCC ABI (libstdc++11) compatibility?


Every time I run conan init in a fresh docker container, I get the following warning:

************************* WARNING: GCC OLD ABI COMPATIBILITY ***********************

Conan detected a GCC version > 5 but has adjusted the 'compiler.libcxx' setting to
'libstdc++' for backwards compatibility.
Your compiler is likely using the new CXX11 ABI by default (libstdc++11).

If you want Conan to use the new ABI for the default profile, run:

    $ conan profile update settings.compiler.libcxx=libstdc++11 default

Or edit '/home/smith/.conan/profiles/default' and set compiler.libcxx=libstdc++11

************************************************************************************

It's annoying, and distracting. Redundant, too, since the very next command I run in the script is the one for setting the ABI, as suggested in the warning.

conan profile update settings.compiler.libcxx=libstdc++11 default

Is there a way to disable the warning, to avoid seeing it?


Solution

  • This warning can be skipped when CONAN_V2_MODE is on: e.g.:

    conan:~$ export CONAN_V2_MODE=1
    conan:~$ conan config init
    WARN: Remotes registry file missing, creating default one in /home/conan/.conan/remotes.json
    Auto detecting your dev setup to initialize the default profile (/home/conan/.conan/profiles/default) 
    Found gcc 9.2
    gcc>=5, using the major as version
    gcc C++ standard library: libstdc++11
    Default settings
        os=Linux
        os_build=Linux
        arch=x86_64
        arch_build=x86_64
        compiler=gcc
        compiler.version=9
        compiler.libcxx=libstdc++11
        build_type=Release
    *** You can change them in /home/conan/.conan/profiles/default ***
    *** Or override with -s compiler='other' -s ...s***
    

    But that variable also activates some other conan v2 options. You can read more here: https://docs.conan.io/en/latest/reference/conan_v2_mode.html