Compare commits
3 Commits
ab90f49af9
...
bdbfd77446
| Author | SHA1 | Date | |
|---|---|---|---|
| bdbfd77446 | |||
| 83ae2f489d | |||
| 39157ea318 |
@ -24,6 +24,7 @@ let
|
||||
intelPackages_2024 = final.intel-apt.hpckit_2024;
|
||||
intelPackages_2025 = final.intel-apt.hpckit_2025;
|
||||
intelPackages = final.intelPackages_2025;
|
||||
oneMath = callPackage ./pkgs/onemath/default.nix { };
|
||||
jemallocNanos6 = callPackage ./pkgs/nanos6/jemalloc.nix { };
|
||||
lmbench = callPackage ./pkgs/lmbench/default.nix { };
|
||||
mcxx = callPackage ./pkgs/mcxx/default.nix { };
|
||||
|
||||
@ -47,40 +47,31 @@ let
|
||||
installPhase = ''
|
||||
awk -F': ' '\
|
||||
BEGIN { print "[ {" } \
|
||||
NR>1 && /^Package: / { print "} {"; } \
|
||||
NF==0 { empty=1; } \
|
||||
NF && empty { print "} {"; empty=0; } \
|
||||
/: / { printf "%s = \"%s\";\n", $1, $2 } \
|
||||
END { print "} ]" }' $srcs > $out
|
||||
'';
|
||||
};
|
||||
|
||||
aptPackages = import aptPackageIndex;
|
||||
|
||||
apthost = "https://apt.repos.intel.com/oneapi/";
|
||||
|
||||
getSum = pkgList: name:
|
||||
findMatch = name:
|
||||
let
|
||||
matches = lib.filter (x: name == x.Package) pkgList;
|
||||
#n = lib.length matches;
|
||||
#match = builtins.trace (name + " -- ${builtins.toString n}") (lib.elemAt matches 0);
|
||||
match = lib.elemAt matches 0;
|
||||
in
|
||||
match.SHA256;
|
||||
|
||||
getUrl = pkgList: name:
|
||||
let
|
||||
matches = lib.filter (x: name == x.Package) pkgList;
|
||||
#match = assert lib.length matches == 1; lib.elemAt matches 0;
|
||||
aptPackages = import aptPackageIndex;
|
||||
matches = lib.filter (x: name == x.Package) aptPackages;
|
||||
n = lib.length matches;
|
||||
match =
|
||||
#builtins.trace (name + " -- n=${builtins.toString n}")
|
||||
(lib.elemAt matches 0);
|
||||
match = builtins.traceVerbose (name + " -- ${builtins.toString n}") (builtins.head matches);
|
||||
|
||||
apthost = "https://apt.repos.intel.com/oneapi/";
|
||||
in
|
||||
apthost + match.Filename;
|
||||
{
|
||||
url = apthost + match.Filename;
|
||||
sha256 = match.SHA256;
|
||||
};
|
||||
|
||||
uncompressDebs = debs: name: stdenv.mkDerivation {
|
||||
name = name;
|
||||
srcs = debs;
|
||||
buildInputs = [ dpkg ];
|
||||
nativeBuildInputs = [ dpkg ];
|
||||
phases = [ "installPhase" ];
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
@ -93,10 +84,7 @@ let
|
||||
|
||||
joinDebs = name: names:
|
||||
let
|
||||
urls = builtins.map (x: getUrl aptPackages x) names;
|
||||
sums = builtins.map (x: getSum aptPackages x) names;
|
||||
getsrc = url: sha256: builtins.fetchurl { inherit url sha256; };
|
||||
debs = lib.zipListsWith getsrc urls sums;
|
||||
debs = builtins.map (x: builtins.fetchurl (findMatch x)) names;
|
||||
in
|
||||
uncompressDebs debs "${name}-source";
|
||||
|
||||
@ -453,7 +441,7 @@ let
|
||||
'';
|
||||
};
|
||||
|
||||
ifort-wrapper = wrapIntel rec {
|
||||
ifort-wrapper = wrapIntel {
|
||||
cc = intel-compiler-fortran;
|
||||
mygcc = gcc;
|
||||
extraBuild = ''
|
||||
|
||||
73
pkgs/onemath/default.nix
Normal file
73
pkgs/onemath/default.nix
Normal file
@ -0,0 +1,73 @@
|
||||
{ lib
|
||||
, intelPackages
|
||||
, withCFlags
|
||||
, fetchFromGitHub
|
||||
, cmake
|
||||
, cudaPackages
|
||||
, enableNvidia ? true
|
||||
, withHipTargets ? null # only one target at a time supported
|
||||
, rocmPackages
|
||||
, enableMkl ? true
|
||||
}:
|
||||
|
||||
let
|
||||
enableHip = withHipTargets != null;
|
||||
|
||||
stdenv = withCFlags (lib.optionals enableNvidia [ "--cuda-path=${cudaPackages.cudatoolkit}" ]) intelPackages.stdenv;
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "oneMath";
|
||||
version = "0.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "uxlfoundation";
|
||||
repo = "oneMath";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-De04PUmI68Jx4rJ+MRb+RepayZCapgnouCUCrAu6G38=";
|
||||
};
|
||||
|
||||
cmakeFlags = [
|
||||
(lib.cmakeBool "ENABLE_MKLCPU_BACKEND" enableMkl)
|
||||
(lib.cmakeBool "ENABLE_MKLGPU_BACKEND" enableMkl)
|
||||
|
||||
(lib.cmakeBool "ENABLE_CUBLAS_BACKEND" enableNvidia)
|
||||
(lib.cmakeBool "ENABLE_CUFFT_BACKEND" enableNvidia)
|
||||
(lib.cmakeBool "ENABLE_CURAND_BACKEND" enableNvidia)
|
||||
(lib.cmakeBool "ENABLE_CUSOLVER_BACKEND" enableNvidia)
|
||||
(lib.cmakeBool "ENABLE_CUSPARSE_BACKEND" enableNvidia)
|
||||
|
||||
(lib.cmakeBool "ENABLE_ROCBLAS_BACKEND" enableHip)
|
||||
(lib.cmakeBool "ENABLE_ROCFFT_BACKEND" enableHip)
|
||||
(lib.cmakeBool "ENABLE_ROCSOLVER_BACKEND" enableHip)
|
||||
(lib.cmakeBool "ENABLE_ROCRAND_BACKEND" enableHip)
|
||||
(lib.cmakeBool "ENABLE_ROCSPARSE_BACKEND" enableHip)
|
||||
|
||||
(lib.cmakeBool "BUILD_FUNCTIONAL_TESTS" false)
|
||||
(lib.cmakeBool "BUILD_EXAMPLES" false)
|
||||
] ++ lib.optionals enableHip [
|
||||
(lib.cmakeFeature "HIP_TARGETS" withHipTargets)
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = lib.optionals (enableMkl) [
|
||||
intelPackages.mkl
|
||||
intelPackages.tbb
|
||||
] ++ lib.optionals (enableHip) [
|
||||
rocmPackages.rocmPath
|
||||
rocmPackages.rocblas
|
||||
rocmPackages.rocfft
|
||||
rocmPackages.rocsolver
|
||||
rocmPackages.rocrand
|
||||
rocmPackages.rocsparse
|
||||
] ++ lib.optionals (enableNvidia) [
|
||||
(lib.getDev cudaPackages.cuda_cudart)
|
||||
cudaPackages.cudatoolkit
|
||||
|
||||
cudaPackages.libcublas
|
||||
cudaPackages.libcurand
|
||||
cudaPackages.libcufft
|
||||
cudaPackages.libcusparse
|
||||
cudaPackages.libcusolver
|
||||
];
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user