forked from rarias/jungle
151 lines
3.4 KiB
Nix
151 lines
3.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
callPackage,
|
|
dpkg,
|
|
fetchurl,
|
|
|
|
sqlite,
|
|
elfutils,
|
|
|
|
intelAptRepoURL ? "https://apt.repos.intel.com/oneapi/",
|
|
}:
|
|
|
|
let
|
|
inherit (builtins) map mapAttrs readFile;
|
|
|
|
fetchDeb =
|
|
p:
|
|
fetchurl {
|
|
url = intelAptRepoURL + p.file;
|
|
inherit (p) sha256;
|
|
};
|
|
|
|
dpkgExtractAll =
|
|
pname: version:
|
|
{ srcs, deps }:
|
|
stdenv.mkDerivation {
|
|
inherit pname version srcs;
|
|
|
|
nativeBuildInputs = [ dpkg ];
|
|
phases = [ "installPhase" ];
|
|
|
|
passthru = { inherit deps; };
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
for src in $srcs; do
|
|
echo "Unpacking $src"
|
|
dpkg -x $src $out
|
|
done
|
|
'';
|
|
};
|
|
|
|
extractKit =
|
|
name: version: pkg:
|
|
dpkgExtractAll "${name}-extracted" version {
|
|
srcs = map fetchDeb pkg;
|
|
deps = pkg;
|
|
};
|
|
|
|
patchIntel = callPackage ./patch_intel.nix { };
|
|
|
|
# Version information for each hpckit. This is used to normalize the paths
|
|
# so that files are in $out/{bin,lib,include...} instead of all over the place
|
|
# in $out/opt/intel/oneapi/*/*/{...}.
|
|
#
|
|
# The most important is the compiler component, which is used to build the
|
|
# stdenv for the hpckit.
|
|
#
|
|
# NOTE: this have to be manually specified, so we can avoid IFD. To add a
|
|
# new version, add a new field with an empty attrset, (e.g. "2026" = {}; ),
|
|
# build hpckit_2026.unpatched and use the values from
|
|
# result/opt/intel/oneapi/* to populate the attrset.
|
|
#
|
|
# WARN: if there are more than one version in the folders of the unpatched
|
|
# components, our dependency resolution hacks have probably failed and the
|
|
# package set may be broken.
|
|
components = {
|
|
# hpckit-2023 = {
|
|
# ccl = "2021.10.0";
|
|
# compiler = "2023.2.4";
|
|
# # conda_channel = "linux-64"; # TODO: which package pulls this?
|
|
# dal = "2023.2.0";
|
|
# debugger = "2023.2.0";
|
|
# dev-utilities = "2021.10.0";
|
|
# diagnostics = "2022.4.0";
|
|
# dnnl = "2023.2.0";
|
|
# dpcpp-ct = "2023.2.0";
|
|
# dpl = "2022.2.0";
|
|
# ipp = "2021.9.0";
|
|
# ippcp = "2021.8.0";
|
|
# itac = "2021.10.0";
|
|
# mkl = "2023.2.0";
|
|
# mpi = "2021.10.0";
|
|
# tbb = "2021.10.0";
|
|
#
|
|
# llvmMajorVersion = 14;
|
|
# };
|
|
|
|
hpckit-2024 = {
|
|
tcm = "1.1";
|
|
|
|
ccl = "2021.13";
|
|
compiler = "2024.2";
|
|
dal = "2024.6";
|
|
debugger = "2024.2";
|
|
dev-utilities = "2024.2";
|
|
diagnostics = "2024.2";
|
|
dnnl = "2024.2";
|
|
dpcpp-ct = "2024.2";
|
|
dpl = "2022.6";
|
|
ipp = "2021.12";
|
|
ippcp = "2021.12";
|
|
mkl = "2024.2";
|
|
mpi = "2021.13";
|
|
tbb = "2021.13";
|
|
|
|
llvmMajorVersion = 19;
|
|
|
|
extraPackages = [
|
|
sqlite
|
|
elfutils
|
|
];
|
|
};
|
|
|
|
hpckit-2025 = {
|
|
ishmem = "1.5";
|
|
tcm = "1.4";
|
|
umf = "1.0";
|
|
|
|
ccl = "2021.17";
|
|
compiler = "2025.3";
|
|
dal = "2025.10";
|
|
debugger = "2025.3";
|
|
dev-utilities = "2025.3";
|
|
dnnl = "2025.3";
|
|
dpcpp-ct = "2025.3";
|
|
dpl = "2022.10";
|
|
ipp = "2022.3";
|
|
ippcp = "2025.3";
|
|
mkl = "2025.3";
|
|
mpi = "2021.17";
|
|
tbb = "2022.3";
|
|
|
|
llvmMajorVersion = 21;
|
|
};
|
|
};
|
|
|
|
kit = fromTOML (readFile ./packages.toml);
|
|
in
|
|
mapAttrs (
|
|
name: value:
|
|
patchIntel {
|
|
unpatched = extractKit "hpckit" kit.meta.${name}.version value;
|
|
components = components.${name};
|
|
}
|
|
) (removeAttrs kit [ "meta" ])
|
|
// {
|
|
inherit patchIntel extractKit kit;
|
|
}
|