Skip to content

Commit

Permalink
Try to build dpcpp open-source version
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoruto committed Dec 20, 2024
1 parent 2039fc8 commit 2c9d3c5
Show file tree
Hide file tree
Showing 4 changed files with 198 additions and 34 deletions.
68 changes: 34 additions & 34 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# },
# }:
pkgs: rec {
# dpcpp = pkgs.callPackage ./dpcpp { };
# banana-cursor = pkgs.callPackage ./banana-cursor/package.nix {};
zluda-rocm5 = pkgs.callPackage ./zluda-rocm5/package.nix { };
# candy-icons = pkgs.callPackage ./candy-icons/package.nix { };
Expand Down
91 changes: 91 additions & 0 deletions pkgs/dpcpp/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
lib,
stdenv,
fetchFromGitHub,

cmake,
python3,
ninja,
hwloc,
perl,

level-zero,
}:
let
date = "2024-12-19";

vc-intrinsics = fetchFromGitHub {
owner = "intel";
repo = "vc-intrinsics";
rev = "v0.21.0";
sha256 = "sha256-Ujekj1EeUuOsb1dXMk9XYYe0b1ZzKU7xygLkH8F71d8=";
};

unified-runtime = fetchFromGitHub {
owner = "oneapi-src";
repo = "unified-runtime";
rev = "v0.11.1";
sha256 = "sha256-WxbkisEZNTvZ+4xa/cUjaaTDWY3rOCdJraxKtRqbZL0=";
};

compute-runtime = fetchFromGitHub {
owner = "intel";
repo = "compute-runtime";
rev = "24.39.31294.12";
sha256 = "sha256-7GNtAo20DgxAxYSPt6Nh92nuuaS9tzsQGH+sLnsvBKU=";
};
in
stdenv.mkDerivation {
pname = "dpcpp";
version = "0-unstable-${date}";

src = fetchFromGitHub {
owner = "intel";
repo = "llvm";
rev = "nightly-${date}";
sha256 = "rtGeE/7cTSgTg+KxuZOfc6HDHG4Fgte0jjh4nYLo/E8=";
};

buildInputs = [
level-zero
];

nativeBuildInputs = [
cmake
python3
ninja
hwloc
perl
];

unpackPhase = ":";

configurePhase = ":";

buildPhase = ''
export LEVEL_ZERO_DIR=${level-zero}
python3 $src/buildbot/configure.py \
--obj-dir=$PWD \
--cmake-opt="-DLLVMGenXIntrinsics_SOURCE_DIR=${vc-intrinsics}" \
--cmake-opt="-DSYCL_UR_USE_FETCH_CONTENT=OFF" \
--cmake-opt="-DSYCL_UR_SOURCE_DIR=${unified-runtime}" \
--cmake-opt="-DUR_LEVEL_ZERO_LOADER_LIBRARY=${level-zero}/lib" \
--cmake-opt="-DUR_LEVEL_ZERO_INCLUDE_DIR=${level-zero}" \
--cmake-opt="-DCOMPUTE_RUNTIME_LEVEL_ZERO_INCLUDE=${compute-runtime}"
python3 $src/buildbot/compile.py
'';

# installPhase = ''
# '';

# postInstallPhase = ''
# '';

meta = with lib; {
homepage = "https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html";
description = "Intel's C, C++, SYCL, and Data Parallel C++ (DPC++) compilers for Intel processor-based systems";
license = licenses.free;
platforms = platforms.linux;
maintainers = with maintainers; [ arunoruto ];
};
}
72 changes: 72 additions & 0 deletions pkgs/dpcpp/proprietary.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
lib,
stdenv,
fetchurl,
autoPatchelfHook,

ncurses,
xorg,
}:
let
pname = "dpcpp";
version = "2025.0.4.20";

installer = stdenv.mkDerivation {
name = "${pname}-installer-${version}";

src = fetchurl {
url = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/84c039b6-2b7d-4544-a745-3fcf8afd643f/intel-${pname}-cpp-compiler-${version}_offline.sh";
sha256 = "A8qubgwz5h0SoFSrnFyDkZzdfSW3OSl3keR3dOx/ti0=";
executable = true;
};

unpackPhase = ''
mkdir -p $out
$src -x -f $out
'';

nativeBuildInputs = [
autoPatchelfHook
ncurses
stdenv.cc.cc.lib
xorg.libXau
];
};
in
stdenv.mkDerivation {
inherit pname;
inherit version;

src = installer;

dontPatchELF = true;

nativeBuildInputs = [
# autoPatchelfHook
# ncurses
];

unpackPhase = ":";

# configurePhase = ":";

# buildPhase = ''
# '';

installPhase = ''
mkdir -p $out
ls -la $src/intel-dpcpp-cpp-compiler-${version}_offline/install.sh
$src/intel-dpcpp-cpp-compiler-${version}_offline/install.sh -s --eula=accept --install-dir=$out
'';

# postInstallPhase = ''
# '';

meta = with lib; {
homepage = "https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html";
description = "Intel's C, C++, SYCL, and Data Parallel C++ (DPC++) compilers for Intel processor-based systems";
license = licenses.free;
platforms = platforms.linux;
maintainers = with maintainers; [ arunoruto ];
};
}

0 comments on commit 2c9d3c5

Please sign in to comment.