Skip to content

Commit

Permalink
libhwy: disable RVV
Browse files Browse the repository at this point in the history
It will not work on processors that lack the V extension until runtime
dispatch is implemented: google/highway#838
  • Loading branch information
fgaz committed Jan 29, 2024
1 parent b7b2023 commit 0e6d821
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkgs/development/libraries/libhwy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, ninja
, gtest
, fetchFromGitHub
, fetchpatch
}:

stdenv.mkDerivation rec {
Expand All @@ -17,6 +18,15 @@ stdenv.mkDerivation rec {
hash = "sha256-Z+mAR9nSAbCskUvo6oK79Yd85bu0HtI2aR5THS1EozM=";
};

patches = lib.optional stdenv.hostPlatform.isRiscV
# Adds CMake option HWY_CMAKE_RVV
# https://github.com/google/highway/pull/1743
(fetchpatch {
name = "libhwy-add-rvv-optout.patch";
url = "https://github.com/google/highway/commit/5d58d233fbcec0c6a39df8186a877329147324b3.patch";
hash = "sha256-ileSNYddOt1F5rooRB0fXT20WkVlnG+gP5w7qJdBuww=";
});

nativeBuildInputs = [ cmake ninja ];

# Required for case-insensitive filesystems ("BUILD" exists)
Expand All @@ -43,6 +53,11 @@ stdenv.mkDerivation rec {
# HwyMathTestGroup/HwyMathTest.TestAllAtanh/EMU128
# HwyMathTestGroup/HwyMathTest.TestAllLog1p/EMU128
"-DHWY_CMAKE_SSE2=ON"
] ++ lib.optionals stdenv.hostPlatform.isRiscV [
# Runtime dispatch is not implemented https://github.com/google/highway/issues/838
# so tests (and likely normal operation) fail with SIGILL on processors without V.
# Until the issue is resolved, we disable RVV completely.
"-DHWY_CMAKE_RVV=OFF"
];

# hydra's darwin machines run into https://github.com/libjxl/libjxl/issues/408
Expand Down

0 comments on commit 0e6d821

Please sign in to comment.