Cantera / cantera

Chemical kinetics, thermodynamics, and transport tool suite
https://cantera.org
Other
582 stars 342 forks source link

MSVC failures with fmt 7.1 #1540

Closed ischoegl closed 12 months ago

ischoegl commented 12 months ago

Problem description

Newly set up GH runners for MSVC fail with {fmt} 7.1

Steps to reproduce

Set up GH action with

      matrix:
        os: ["windows-2022"]
        vs-toolset: ["14.1", "14.3"]
        python-version: ["3.8", "3.10", "3.11"]
        include:
        - python-version: 3.8
          fmt-ver: 10
        - python-version: 3.10
          fmt-ver: 8.1
        - python-version: 3.11
          fmt-ver: 7.1

Behavior

See GH result for #1538: https://github.com/Cantera/cantera/actions/runs/5502508185/jobs/10026809364?pr=1538

On both MSVC 14.1 and 14.3, there are numerous failures similar to:

<some_name>.obj : error LNK2001: unresolved external symbol "public: static char const * const fmt::v7::detail::basic_data<void>::right_padding_shifts" (?right_padding_shifts@?$basic_data@X@detail@v7@fmt@@2QBDB)
build\lib\cantera_shared.dll : fatal error LNK1120: 7 unresolved externals
scons: *** [build\lib\cantera_shared.dll] Error 1120

The issue looks similar to https://github.com/fmtlib/fmt/issues/1193

The resolution appears to be to compile with the option /DFMT_HEADER_ONLY=1 (see https://github.com/fmtlib/fmt/issues/1193#issuecomment-498877391)

System information