Unverified Commit bd88d6c1 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

onnxruntime: use --compile-no-warning-as-error for clang&ROCm (#459965)

parents 4e6f45de e900cba5
Loading
Loading
Loading
Loading
+19 −21
Original line number Diff line number Diff line
@@ -237,6 +237,10 @@ effectiveStdenv.mkDerivation rec {
    (lib.cmakeBool "onnxruntime_USE_ROCM" rocmSupport)
    (lib.cmakeBool "onnxruntime_ENABLE_LTO" (!cudaSupport || cudaPackages.cudaOlder "12.8"))
  ]
  ++ lib.optionals (effectiveStdenv.cc.isClang || rocmSupport) [
    # Disable -Werror from COMPILE_WARNING_AS_ERROR target property
    "--compile-no-warning-as-error"
  ]
  ++ lib.optionals pythonSupport [
    (lib.cmakeBool "onnxruntime_ENABLE_PYTHON" true)
  ]
@@ -249,8 +253,6 @@ effectiveStdenv.mkDerivation rec {
    (lib.cmakeFeature "onnxruntime_NVCC_THREADS" "1")
  ]
  ++ lib.optionals rocmSupport [
    # Werror combines with rocprim header issues to cause errors (warp size const deprecation)
    "--compile-no-warning-as-error"
    (lib.cmakeFeature "CMAKE_HIP_ARCHITECTURES" (
      builtins.concatStringsSep ";" rocmPackages.clr.localGpuTargets or rocmPackages.clr.gpuTargets
    ))
@@ -260,11 +262,7 @@ effectiveStdenv.mkDerivation rec {
    (lib.cmakeBool "onnxruntime_USE_COMPOSABLE_KERNEL_CK_TILE" false)
  ];

  env =
    lib.optionalAttrs effectiveStdenv.cc.isClang {
      NIX_CFLAGS_COMPILE = "-Wno-error";
    }
    // lib.optionalAttrs rocmSupport {
  env = lib.optionalAttrs rocmSupport {
    MIOPEN_PATH = rocmPackages.miopen;
    # HIP steps fail to find ROCm libs when not in HIPFLAGS, causing
    # fatal error: 'rocrand/rocrand.h' file not found