Something went wrong. Try again.
lol
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263{ lib, fetchurl, zlib, rdma-core, libpsm2, ucx, numactl, level-zero, pkg-config, libdrm, elfutils, libxxf86vm, libxrandr, libxfixes, libxext, libxdamage, libxcomposite, libx11, libxcb, glib, nss, nspr, dbus, at-spi2-atk, cups, gtk3, pango, cairo, libgbm, expat, libxkbcommon, eudev, alsa-lib, ncurses5, bzip2, gdbm, libxcrypt-legacy, freetype, gtk2, gdk-pixbuf, fontconfig, libuuid, sqlite,
# The list of components to install; # Either [ "all" ], [ "default" ], or a custom list of components. # If you want to install all default components plus an extra one, pass [ "default" <your extra components here> ] # Note that changing this will also change the `buildInputs` of the derivation. # The default value is not "default" because some of the components in the defualt set are currently broken. components ? [ "intel.oneapi.lin.advisor" "intel.oneapi.lin.dpcpp-cpp-compiler" "intel.oneapi.lin.dpcpp_dbg" "intel.oneapi.lin.vtune" "intel.oneapi.lin.mkl.devel" ],
intel-oneapi,
# For tests runCommand, libffi, stdenv,}:intel-oneapi.mkIntelOneApi (finalAttrs: { pname = "intel-oneapi-base-toolkit";
src = fetchurl { url = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/6caa93ca-e10a-4cc5-b210-68f385feea9e/intel-oneapi-base-toolkit-2025.3.1.36_offline.sh"; hash = "sha256-xXV6FP4t1ChSi/bcDFpkmMexNejPTtk2Nay/PmSpCFA="; };
versionYear = "2025"; versionMajor = "3"; versionMinor = "1"; versionRel = "36";
inherit components;
# Figured out by looking at autoPatchelfHook failure output depsByComponent = rec { advisor = [ libdrm zlib gtk2 gdk-pixbuf at-spi2-atk glib pango gdk-pixbuf cairo fontconfig glib freetype libx11 libxxf86vm libxext libxcb libxcomposite libxdamage libxfixes libxrandr nss dbus cups libgbm expat libxkbcommon eudev alsa-lib ncurses5 bzip2 libuuid gdbm libxcrypt-legacy sqlite nspr ]; dpcpp-cpp-compiler = [ zlib level-zero ]; dpcpp_dbg = [ level-zero zlib ]; dpcpp-ct = [ zlib ]; mpi = [ zlib rdma-core libpsm2 ucx libuuid numactl level-zero libffi ]; pti = [ level-zero ]; vtune = [ libdrm elfutils zlib libx11 libxext libxcb libxcomposite libxdamage libxfixes libxrandr glib nss dbus at-spi2-atk cups gtk3 pango cairo libgbm expat libxkbcommon eudev alsa-lib at-spi2-atk ncurses5 bzip2 libuuid gdbm libxcrypt-legacy sqlite nspr ]; mkl = mpi ++ pti; };
autoPatchelfIgnoreMissingDeps = [ # Needs to be dynamically loaded as it depends on the hardware "libcuda.so.1" # All too old, not in nixpkgs anymore "libffi.so.6" "libgdbm.so.4" "libopencl-clang.so.14" "libreadline.so.6" ];
passthru.updateScript = intel-oneapi.mkUpdateScript { inherit (finalAttrs) 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"; };
passthru.tests = { mkl-libs = stdenv.mkDerivation { name = "intel-oneapi-test-mkl-libs"; unpackPhase = '' cp ${./test.c} test.c '';
nativeBuildInputs = [ pkg-config ]; buildInputs = [ intel-oneapi.base ];
buildPhase = '' # This will fail if no libs with mkl- in their name are found libs="$(pkg-config --list-all | cut -d\ -f1 | grep mkl-)" for lib in $libs; do echo "Testing that the build succeeds with $lib" >&2 gcc test.c -o test-with-$lib $(pkg-config --cflags --libs $lib) done '';
doCheck = true;
checkPhase = '' for lib in $libs; do echo "Testing that the executable built with $lib runs" >&2 ./test-with-$lib done '';
installPhase = '' touch "$out" ''; };
all-binaries-run = runCommand "intel-oneapi-test-all-binaries-run" { } '' # .*-32: 32-bit executables can't be properly patched by patchelf # IMB-.*: all fail with a weird "bad file descriptor" error # fi_info, fi_pingpong: exits with 1 even if ran with `--help` # gdb-openapi: Python not initialized # hydra_bstrap_proxy, hydra_nameserver, hydra_pmi_proxy: doesn't respect --help # 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.base}/mpi/latest" for bin in "${intel-oneapi.base}"/bin/*; do if [[ "$bin" =~ $regex_skip ]] || [ ! -f "$bin" ] || [[ ! -x "$bin" ]]; then echo "skipping $bin" continue fi echo "trying to run $bin --help or -help" "$bin" --help || "$bin" -help done touch "$out" ''; };
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; [ intel-eula issl asl20 ]; maintainers = with lib.maintainers; [ balsoft ]; platforms = [ "x86_64-linux" ]; };})