9 stdenv.mkDerivation rec {
13 src = fetchFromGitHub {
17 hash = "sha256-Z+mAR9nSAbCskUvo6oK79Yd85bu0HtI2aR5THS1EozM=";
20 nativeBuildInputs = [ cmake ninja ];
22 # Required for case-insensitive filesystems ("BUILD" exists)
23 dontUseCmakeBuildDir = true;
26 libExt = stdenv.hostPlatform.extensions.library;
29 "-DCMAKE_INSTALL_LIBDIR=lib"
30 "-DCMAKE_INSTALL_INCLUDEDIR=include"
31 ] ++ lib.optionals doCheck [
32 "-DHWY_SYSTEM_GTEST:BOOL=ON"
33 "-DGTEST_INCLUDE_DIR=${lib.getDev gtest}/include"
34 "-DGTEST_LIBRARY=${lib.getLib gtest}/lib/libgtest${libExt}"
35 "-DGTEST_MAIN_LIBRARY=${lib.getLib gtest}/lib/libgtest_main${libExt}"
36 ] ++ lib.optionals stdenv.hostPlatform.isAarch32 [
38 ] ++ lib.optionals stdenv.hostPlatform.isx86_32 [
39 # Quoting CMakelists.txt:
40 # This must be set on 32-bit x86 with GCC < 13.1, otherwise math_test will be
41 # skipped. For GCC 13.1+, you can also build with -fexcess-precision=standard.
43 # HwyMathTestGroup/HwyMathTest.TestAllAtanh/EMU128
44 # HwyMathTestGroup/HwyMathTest.TestAllLog1p/EMU128
48 # hydra's darwin machines run into https://github.com/libjxl/libjxl/issues/408
49 doCheck = !stdenv.hostPlatform.isDarwin;
52 description = "Performance-portable, length-agnostic SIMD with runtime dispatch";
53 homepage = "https://github.com/google/highway";
54 license = with licenses; [ asl20 bsd3 ];
55 platforms = platforms.unix;
56 maintainers = with maintainers; [ zhaofengli ];