Skip to content

NVHPC: nvfortran COMPILE_WARNING_AS_ERROR fails with Ninja

CMake 3.24 added CMAKE_COMPILE_WARNING_AS_ERROR. This works for NVHPC + Unix Makefiles, but does NOT work for NVHPC + Ninja for nvfortran Fortran compiler. -Werror all-warnings is emitted which errors compilation with Ninja and nvfortran, but Make can handle it.

It appears the proper syntax for this flag is -Werror=all-warnings, which does work with Ninja and nvfortran.

Despite nvfortran --help | grep Werror matching nvc etc. it seems nvfortran is stricter in combination with Ninja.

Edited by scivision
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information