Skip to content

Commit

Permalink
amd-libflame: 4.2 -> 5.0 (#348058)
Browse files Browse the repository at this point in the history
  • Loading branch information
markuskowa authored Oct 16, 2024
2 parents 5e30d97 + 3665297 commit e08d911
Showing 1 changed file with 38 additions and 27 deletions.
65 changes: 38 additions & 27 deletions pkgs/development/libraries/science/math/amd-libflame/default.nix
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, gfortran
, python3
, amd-blis
, aocl-utils

, withOpenMP ? true
, blas64 ? false
, withAMDOpt ? true
{
lib,
stdenv,
fetchFromGitHub,
cmake,
gfortran,
python3,
amd-blis,
aocl-utils,

withOpenMP ? true,
blas64 ? false,
withAMDOpt ? true,
}:

stdenv.mkDerivation rec {
pname = "amd-libflame";
version = "4.2";
version = "5.0";

src = fetchFromGitHub {
owner = "amd";
repo = "libflame";
rev = version;
hash = "sha256-eiH2eq+nKUjlB1bZTZNRW1+efCHZ68UOSFy0NpcY1FI=";
hash = "sha256-Shsv5Zd59FN5tq1LY7QqPRtAHEysHIVbPeKIIZ/2eMw=";
};

postPatch = ''
Expand All @@ -30,22 +31,32 @@ stdenv.mkDerivation rec {
substituteInPlace CMakeLists.txt --replace '-mtune=native' ""
'';

passthru = { inherit blas64; };
passthru = {
inherit blas64;
};

nativeBuildInputs = [ cmake gfortran python3 ];
nativeBuildInputs = [
cmake
gfortran
python3
];

buildInputs = [ amd-blis aocl-utils ];
buildInputs = [
amd-blis
aocl-utils
];

cmakeFlags = [
"-DLIBAOCLUTILS_LIBRARY_PATH=${lib.getLib aocl-utils}/lib/libaoclutils${stdenv.hostPlatform.extensions.sharedLibrary}"
"-DLIBAOCLUTILS_INCLUDE_PATH=${lib.getDev aocl-utils}/include"
"-DENABLE_BUILTIN_LAPACK2FLAME=ON"
"-DENABLE_CBLAS_INTERFACES=ON"
"-DENABLE_EXT_LAPACK_INTERFACE=ON"
]
++ lib.optional (!withOpenMP) "-DENABLE_MULTITHREADING=OFF"
++ lib.optional blas64 "-DENABLE_ILP64=ON"
++ lib.optional withAMDOpt "-DENABLE_AMD_OPT=ON";
cmakeFlags =
[
"-DLIBAOCLUTILS_LIBRARY_PATH=${lib.getLib aocl-utils}/lib/libaoclutils${stdenv.hostPlatform.extensions.sharedLibrary}"
"-DLIBAOCLUTILS_INCLUDE_PATH=${lib.getDev aocl-utils}/include"
"-DENABLE_BUILTIN_LAPACK2FLAME=ON"
"-DENABLE_CBLAS_INTERFACES=ON"
"-DENABLE_EXT_LAPACK_INTERFACE=ON"
]
++ lib.optional (!withOpenMP) "-DENABLE_MULTITHREADING=OFF"
++ lib.optional blas64 "-DENABLE_ILP64=ON"
++ lib.optional withAMDOpt "-DENABLE_AMD_OPT=ON";

postInstall = ''
ln -s $out/lib/libflame.so $out/lib/liblapack.so.3
Expand Down

0 comments on commit e08d911

Please sign in to comment.