Unverified Commit 947f79b2 authored by Alexander Bantyev's avatar Alexander Bantyev
Browse files

fixup! intel-oneapi.{base,hpc}: init at 2025.2.1.44

parent 66e2080e
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -56,12 +56,12 @@
  libffi,
  stdenv,
}:
intel-oneapi.mkIntelOneApi rec {
intel-oneapi.mkIntelOneApi (fa: {
  pname = "intel-oneapi-base-toolkit";

  src = fetchurl {
    url = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/3b7a16b3-a7b0-460f-be16-de0d64fa6b1e/intel-oneapi-base-toolkit-2025.2.1.44_offline.sh";
    sha256 = "0fg4mcp6syhmp2fhariv3raxlikakvm557w7ppc9vfdsj4ji2md1";
    hash = "sha256-oVURJZG6uZ3YvYefUuqeakbaVR47ZgWduBV6bS6r5Dk=";
  };

  versionYear = "2025";
@@ -176,7 +176,7 @@ intel-oneapi.mkIntelOneApi rec {
  ];

  passthru.updateScript = intel-oneapi.mkUpdateScript {
    inherit pname;
    inherit (fa) pname;
    file = "base.nix";
    downloadPage = "https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html?packages=oneapi-toolkit&oneapi-toolkit-os=linux&oneapi-lin=offline";
  };
@@ -191,7 +191,7 @@ intel-oneapi.mkIntelOneApi rec {
      nativeBuildInputs = [
        pkg-config
      ];
      buildInputs = [ intel-oneapi ];
      buildInputs = [ intel-oneapi.base ];

      buildPhase = ''
        # This will fail if no libs with mkl- in their name are found
@@ -225,7 +225,7 @@ intel-oneapi.mkIntelOneApi rec {
      # mpirun: can't find mpiexec.hydra for some reason
      # sycl-ls, sycl-trace: doesn't respect --help
      regex_skip="(.*-32)|(IMB-.*)|fi_info|fi_pingpong|gdb-oneapi|hydra_bstrap_proxy|hydra_nameserver|hydra_pmi_proxy|mpirun|sycl-ls|sycl-trace"
      export I_MPI_ROOT="${intel-oneapi}/mpi/latest"
      export I_MPI_ROOT="${intel-oneapi.base}/mpi/latest"
      for bin in "${intel-oneapi}"/bin/*; do
        if [[ "$bin" =~ $regex_skip ]] || [ ! -f "$bin" ] || [[ ! -x "$bin" ]]; then
          echo "skipping $bin"
@@ -238,7 +238,7 @@ intel-oneapi.mkIntelOneApi rec {
    '';
  };

  meta = with lib; {
  meta = {
    description = "Intel oneAPI Base Toolkit";
    homepage = "https://software.intel.com/content/www/us/en/develop/tools/oneapi/base-toolkit.html";
    license = with lib.licenses; [
@@ -251,4 +251,4 @@ intel-oneapi.mkIntelOneApi rec {
    ];
    platforms = [ "x86_64-linux" ];
  };
}
})
+5 −5
Original line number Diff line number Diff line
@@ -26,12 +26,12 @@
  level-zero,
  libffi,
}:
intel-oneapi.mkIntelOneApi rec {
intel-oneapi.mkIntelOneApi (fa: {
  pname = "intel-oneapi-hpc-toolkit";

  src = fetchurl {
    url = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/2d2a6686-ff06-44ce-baf0-ab84f8dafa89/intel-oneapi-hpc-toolkit-2025.2.1.44_offline.sh";
    sha256 = "1ys8s2nh6snjiz7aglag7awy12ww01z026hzcidzy68kxq71wba8";
    hash = "sha256-SC0eDu4TGf9bZB8aAX4AnIvguTpP0afOj9JqA63QSPs=";
  };

  versionYear = "2025";
@@ -62,12 +62,12 @@ intel-oneapi.mkIntelOneApi rec {
  ];

  passthru.updateScript = intel-oneapi.mkUpdateScript {
    inherit pname;
    inherit (fa) pname;
    file = "hpc.nix";
    downloadPage = "https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit-download.html?packages=hpc-toolkit&hpc-toolkit-os=linux&hpc-toolkit-lin=offline";
  };

  meta = with lib; {
  meta = {
    description = "Intel oneAPI HPC Toolkit";
    homepage = "https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit.html";
    license = with lib.licenses; [
@@ -80,4 +80,4 @@ intel-oneapi.mkIntelOneApi rec {
    ];
    platforms = [ "x86_64-linux" ];
  };
}
})
+56 −47
Original line number Diff line number Diff line
@@ -12,10 +12,27 @@
  writeShellScript,
  writeText,
  writeTextFile,

  # For the updater script
  writeShellApplication,
  curl,
  jq,
  htmlq,
  common-updater-scripts,
  writableTmpDirAsHomeHook,
}:

{
  mkIntelOneApi =
  mkIntelOneApi = lib.extendMkDerivation {
    constructDrv = stdenv.mkDerivation;

    excludeDrvArgNames = [
      "depsByComponent"
      "components"
    ];

    extendDrvArgs =
      fa:
      {
        pname,
        versionYear,
@@ -32,8 +49,6 @@
      let
        shortName = name: builtins.elemAt (lib.splitString "." name) 3;
      in
    stdenv.mkDerivation (
      fa:
      {
        version = "${fa.versionYear}.${fa.versionMajor}.${fa.versionMinor}.${fa.versionRel}";

@@ -45,21 +60,21 @@
          bubblewrap

          autoPatchelfHook
          writableTmpDirAsHomeHook
        ];

        buildInputs = [
          # For patchShebangs
          python3
        ];

        ]
        # autoPatchelfHook will add these libraries to RPATH as required
        buildInputs = lib.concatLists (
          map (
        ++ lib.concatMap (
          comp:
          if comp == "all" || comp == "default" then
            lib.concatLists (builtins.attrValues depsByComponent)
          else
            depsByComponent.${shortName comp} or [ ]
          ) components
        );
        ) components;

        phases = [
          "installPhase"
@@ -69,9 +84,6 @@
        # See https://software.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/installation/install-with-command-line.html
        installPhase = ''
          runHook preInstall
          # The installer expects a writeable home directory, even if installing elsewhere
          export HOME="$(mktemp -d)"

          # The installer expects that the installation directory is already present
          mkdir -p "$out"

@@ -111,12 +123,8 @@

          runHook postInstall
        '';
      }
      // (builtins.removeAttrs args [
        "depsByComponent"
        "components"
      ])
    );
      };
  };

  mkUpdateScript =
    {
@@ -124,13 +132,15 @@
      downloadPage,
      file,
    }:
    writeTextFile {
    writeShellApplication {
      name = "update-intel-oneapi";
      executable = true;
      runtimeInputs = [
        curl
        jq
        htmlq
        common-updater-scripts
      ];
      text = ''
        #!/usr/bin/env nix-shell
        #!nix-shell -i bash -p curl jq htmlq common-updater-scripts

        download_page=${lib.escapeShellArg downloadPage}
        pname=${lib.escapeShellArg pname}
        nixpkgs="$(git rev-parse --show-toplevel)"
@@ -158,11 +168,10 @@
        fi

        if [[ "$(grep 'url =' "$file")" =~ "$url" ]] && [[ "''${BASH_REMATCH[0]}" == "$url" ]]; then
            echo "The URL is the same ($url), skipping prefetch" >&2
            sha256="$(jq .sha256 < "$outFile")"
            echo "The URL is the same ($url), skipping update" >&2
        else
            echo "The new download URL is $url, prefetching it to store" >&2
            sha256=$(nix-prefetch-url --quiet "$url")
            hash="$(nix-hash --to-sri --type sha256 "$(nix-prefetch-url --quiet "$url")")"
        fi

        sed -i "s|versionYear = \".*\";|versionYear = \"$versionYear\";|" "$file"
@@ -170,7 +179,7 @@
        sed -i "s|versionMinor = \".*\";|versionMinor = \"$versionMinor\";|" "$file"
        sed -i "s|versionRel = \".*\";|versionRel = \"$versionRel\";|" "$file"
        sed -i "s|url = \".*\";|url = \"$url\";|" "$file"
        sed -i "s|sha256 = \".*\";|sha256 = \"$sha256\";|" "$file"
        sed -i "s|hash = \".*\";|hash = \"$hash\";|" "$file"
      '';
    };

+12 −0
Original line number Diff line number Diff line
#include <assert.h>

#include <mkl_cblas.h>

int main() {
  float u[] = {1., 2., 3.};
  float v[] = {4., 5., 6.};

  float dp = cblas_sdot(3, u, 1, v, 1);

  assert(dp == 32.);
}