Files
nixpkgs/pkgs/by-name/am/amd-blis/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

82 lines
1.9 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
perl,
python3,
# Enable BLAS interface with 64-bit integer width.
blas64 ? false,
# Target architecture. "amdzen" compiles kernels for all Zen
# generations. To build kernels for specific Zen generations,
# use "zen", "zen2", "zen3", "zen4", or "zen5".
withArchitecture ? "amdzen",
# Enable OpenMP-based threading.
withOpenMP ? true,
}:
let
threadingSuffix = lib.optionalString withOpenMP "-mt";
blasIntSize = if blas64 then "64" else "32";
in
stdenv.mkDerivation (finalAttrs: {
pname = "amd-blis";
version = "5.1";
src = fetchFromGitHub {
owner = "amd";
repo = "blis";
rev = finalAttrs.version;
hash = "sha256-hqb/Q1CBqtC4AXqHNd7voewGUD675hJ9IwvP3Mn9b+M=";
};
patches = [
# Set the date stamp to $SOURCE_DATE_EPOCH
./build-date.patch
];
inherit blas64;
nativeBuildInputs = [
perl
python3
];
# Tests currently fail with non-Zen CPUs due to a floating point
# exception in one of the generic kernels. Try to re-enable the
# next release.
doCheck = false;
enableParallelBuilding = true;
configureFlags = [
"--enable-cblas"
"--blas-int-size=${blasIntSize}"
]
++ lib.optionals withOpenMP [ "--enable-threading=openmp" ]
++ [ withArchitecture ];
postPatch = ''
patchShebangs configure build/flatten-headers.py
'';
postInstall = ''
ls $out/lib
ln -s $out/lib/libblis${threadingSuffix}.so $out/lib/libblas.so.3
ln -s $out/lib/libblis${threadingSuffix}.so $out/lib/libcblas.so.3
ln -s $out/lib/libblas.so.3 $out/lib/libblas.so
ln -s $out/lib/libcblas.so.3 $out/lib/libcblas.so
'';
meta = {
description = "BLAS-compatible library optimized for AMD CPUs";
homepage = "https://developer.amd.com/amd-aocl/blas-library/";
license = lib.licenses.bsd3;
maintainers = [ lib.maintainers.markuskowa ];
platforms = [ "x86_64-linux" ];
};
})