Compare commits

...
This repository has been archived on 2025-10-07. You can view files and clone it, but cannot push or open issues or pull requests.

4 Commits

2 changed files with 70 additions and 0 deletions

View File

@ -47,6 +47,7 @@ let
tagaspi = callPackage ./pkgs/tagaspi/default.nix { };
tampi = callPackage ./pkgs/tampi/default.nix { };
wxparaver = callPackage ./pkgs/paraver/default.nix { };
amd_blis = callPackage ./pkgs/amd_blis/default.nix { };
};
in bscPkgs // {

69
pkgs/amd_blis/default.nix Normal file
View File

@ -0,0 +1,69 @@
{
lib,
stdenv,
fetchFromGitHub,
perl,
python3,
# Enable BLAS interface with 64-bit integer width.
blasIntSize ? "64",
# Target architecture. "auto" lets the script decide for itself.
# For fox, "zen4" should be used.
withArchitecture ? "auto",
# Enable OpenMP-based threading.
withOpenMP ? true,
# TODO: Use tag of last release insted of commit
gitUrl ? "https://github.com/amd/blis.git",
gitBranch ? "master",
gitCommit ? "16f852a065e76e824d77bc39e2baa82ac19ed419"
}:
assert lib.assertOneOf "blasIntSize" blasIntSize ["32" "64"];
let
threadingSuffix = lib.optionalString withOpenMP "-mt";
git = rec {
version = src.shortRev;
src = builtins.fetchGit {
url = gitUrl;
ref = gitBranch;
rev = gitCommit;
};
};
in
stdenv.mkDerivation rec {
pname = "amd_blis";
inherit (git) src version;
nativeBuildInputs = [
perl
python3
];
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
'';
}