Skip to content

Commit

Permalink
[nix] add standalone LLVM build for buddy-mlir
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin committed Aug 6, 2024
1 parent 766c5e3 commit 739301e
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions nix/pkgs/buddy-llvm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{ stdenv
, cmake
, ninja
, python3
, fetchFromGitHub
}:

let
pythonEnv = python3.withPackages (ps: [
ps.numpy
ps.pybind11
ps.pyyaml
ps.ml-dtypes
]);
in
stdenv.mkDerivation rec {
name = "llvm-for-buddy-mlir";
version = "6c59f0e1b0fb56c909ad7c9aad4bde37dc006ae0";
src = fetchFromGitHub {
owner = "llvm";
repo = "llvm-project";
rev = version;
hash = "sha256-bMJJ2q1hSh7m0ewclHOmIe7lOHv110rz/P7D3pw8Uiw=";
};

requiredSystemFeatures = [ "big-parallel" ];

propagatedBuildInputs = [
pythonEnv
];

nativeBuildInputs = [
cmake
ninja
];

cmakeDir = "../llvm";
cmakeFlags = [
"-DLLVM_ENABLE_PROJECTS=mlir"
"-DLLVM_TARGETS_TO_BUILD=host;RISCV"
"-DLLVM_ENABLE_ASSERTIONS=ON"
"-DCMAKE_BUILD_TYPE=RELEASE"
"-DMLIR_ENABLE_BINDINGS_PYTHON=ON"
];
}

0 comments on commit 739301e

Please sign in to comment.