lol
at 24.11-pre 62 lines 1.6 kB view raw
1{ lib 2, stdenv 3, fetchFromGitHub 4, cmake 5, gfortran 6, python3 7, amd-blis 8, aocl-utils 9 10, withOpenMP ? true 11, blas64 ? false 12, withAMDOpt ? true 13}: 14 15stdenv.mkDerivation rec { 16 pname = "amd-libflame"; 17 version = "4.2"; 18 19 src = fetchFromGitHub { 20 owner = "amd"; 21 repo = "libflame"; 22 rev = version; 23 hash = "sha256-eiH2eq+nKUjlB1bZTZNRW1+efCHZ68UOSFy0NpcY1FI="; 24 }; 25 26 postPatch = '' 27 patchShebangs build 28 29 # Enforce reproducible build compiler flags 30 substituteInPlace CMakeLists.txt --replace '-mtune=native' "" 31 ''; 32 33 passthru = { inherit blas64; }; 34 35 nativeBuildInputs = [ cmake gfortran python3 ]; 36 37 buildInputs = [ amd-blis aocl-utils ]; 38 39 cmakeFlags = [ 40 "-DLIBAOCLUTILS_LIBRARY_PATH=${lib.getLib aocl-utils}/lib/libaoclutils${stdenv.hostPlatform.extensions.sharedLibrary}" 41 "-DLIBAOCLUTILS_INCLUDE_PATH=${lib.getDev aocl-utils}/include" 42 "-DENABLE_BUILTIN_LAPACK2FLAME=ON" 43 "-DENABLE_CBLAS_INTERFACES=ON" 44 "-DENABLE_EXT_LAPACK_INTERFACE=ON" 45 ] 46 ++ lib.optional (!withOpenMP) "-DENABLE_MULTITHREADING=OFF" 47 ++ lib.optional blas64 "-DENABLE_ILP64=ON" 48 ++ lib.optional withAMDOpt "-DENABLE_AMD_OPT=ON"; 49 50 postInstall = '' 51 ln -s $out/lib/libflame.so $out/lib/liblapack.so.3 52 ln -s $out/lib/libflame.so $out/lib/liblapacke.so.3 53 ''; 54 55 meta = with lib; { 56 description = "LAPACK-compatible linear algebra library optimized for AMD CPUs"; 57 homepage = "https://developer.amd.com/amd-aocl/blas-library/"; 58 license = licenses.bsd3; 59 maintainers = [ maintainers.markuskowa ]; 60 platforms = [ "x86_64-linux" ]; 61 }; 62}