2021-05-03 20:48:10 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, gtest }:
|
2022-09-09 14:08:57 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "xsimd";
|
|
|
|
version = "8.1.0";
|
2021-05-03 20:48:10 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xtensor-stack";
|
|
|
|
repo = "xsimd";
|
|
|
|
rev = version;
|
2022-09-09 14:08:57 +00:00
|
|
|
sha256 = "sha256-Aqs6XJkGjAjGAp0PprabSM4m+32M/UXpSHppCHdzaZk=";
|
2021-05-03 20:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DBUILD_TESTS=ON" ];
|
|
|
|
|
|
|
|
doCheck = true;
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ gtest ];
|
2021-05-03 20:48:10 +00:00
|
|
|
checkTarget = "xtest";
|
2022-09-09 14:08:57 +00:00
|
|
|
GTEST_FILTER =
|
|
|
|
let
|
2021-05-03 20:48:10 +00:00
|
|
|
# Upstream Issue: https://github.com/xtensor-stack/xsimd/issues/456
|
|
|
|
filteredTests = lib.optionals stdenv.hostPlatform.isDarwin [
|
2022-09-09 14:08:57 +00:00
|
|
|
"error_gamma_test/*"
|
2021-05-03 20:48:10 +00:00
|
|
|
];
|
2022-09-09 14:08:57 +00:00
|
|
|
in
|
|
|
|
"-${builtins.concatStringsSep ":" filteredTests}";
|
2021-05-03 20:48:10 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
# https://github.com/xtensor-stack/xsimd/issues/748
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace xsimd.pc.in \
|
|
|
|
--replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
|
|
|
|
'';
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "C++ wrappers for SIMD intrinsics";
|
|
|
|
homepage = "https://github.com/xtensor-stack/xsimd";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ tobim ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|