Compare commits

..

2 commits

2 changed files with 22 additions and 22 deletions

View file

@ -2,16 +2,16 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1681269223, "lastModified": 1690370995,
"narHash": "sha256-i6OeI2f7qGvmLfD07l1Az5iBL+bFeP0RHixisWtpUGo=", "narHash": "sha256-9z//23jGegLJrf3ITStLwVf715O39dq5u48Kr/XW14U=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "87edbd74246ccdfa64503f334ed86fa04010bab9", "rev": "f3fbbc36b4e179a5985b9ab12624e9dfe7989341",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
"ref": "nixos-22.11", "ref": "nixos-23.05",
"type": "indirect" "type": "indirect"
} }
}, },

View file

@ -2,15 +2,15 @@
description = "Custom-Built MLIR Tools"; description = "Custom-Built MLIR Tools";
# Nixpkgs / NixOS version to use. # Nixpkgs / NixOS version to use.
inputs.nixpkgs.url = "nixpkgs/nixos-22.11"; inputs.nixpkgs.url = "nixpkgs/nixos-23.05";
outputs = { self, nixpkgs }: outputs = { self, nixpkgs }:
let let
# git revision to use (for version and git pull # git revision to use (for version and git pull
#llvmRevision = "llvmorg-17-init"; #llvmRevision = "llvmorg-17-init";
llvmRevision = "010a97974a158ebca0bdb58346a2b303ab8a401e"; llvmRevision = "0a35ac6c2e0cb0160ca2e6cc11644c263692a46d";
circtRevision = "4937a94071b4a3e15c740ae445e14b47e1f8154e"; circtRevision = "720846dd1611a336424e0d8a4ae81fd53b220ced";
# to work with older version of flakes # to work with older version of flakes
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101"; lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
@ -26,23 +26,23 @@
forAllSystems = nixpkgs.lib.genAttrs supportedSystems; forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# Nixpkgs instantiated for supported system types. # Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ self.overlay ]; }); nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ self.overlays.default ]; });
in in
{ {
# A Nixpkgs overlay. # A Nixpkgs overlay.
overlay = final: prev: { overlays.default = final: prev: {
mlir = with final; llvmPackages_14.stdenv.mkDerivation rec { mlir = with final; llvmPackages_16.stdenv.mkDerivation rec {
name = "mlir-${version}"; name = "mlir-${version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "llvm"; owner = "llvm";
repo = "llvm-project"; repo = "llvm-project";
rev = llvmRevision; rev = llvmRevision;
sha256 = "sha256-iZBZcHYW/rJm+4KAcNZGwryKsYsEQNi1LTpS0Mnm08A="; sha256 = "sha256-e8Rr1NZznjnNo3GvD1VSx8yb2ZcUdM2LtZDyNnwIJdU="; # lib.fakeSha256;
}; };
sourceRoot = "source/llvm"; sourceRoot = "source/llvm";
@ -53,9 +53,9 @@
cmake cmake
ncurses ncurses
zlib zlib
llvmPackages_14.llvm llvmPackages_16.llvm
llvmPackages_14.clang llvmPackages_16.clang
llvmPackages_14.bintools llvmPackages_16.bintools
]; ];
buildInputs = [ libxml2 ]; buildInputs = [ libxml2 ];
@ -85,7 +85,7 @@
"-DCMAKE_C_COMPILER=clang" "-DCMAKE_C_COMPILER=clang"
"-DCMAKE_CXX_COMPILER=clang++" "-DCMAKE_CXX_COMPILER=clang++"
"-DLLVM_ENABLE_LLD=ON" "-DLLVM_ENABLE_LLD=ON"
#"-DLLVM_USE_LINKER=${llvmPackages_14.bintools}/bin/lld" #"-DLLVM_USE_LINKER=${llvmPackages_16.bintools}/bin/lld"
# CCache can drastically speed up further rebuilds, try adding: # CCache can drastically speed up further rebuilds, try adding:
#"-DLLVM_CCACHE_BUILD=ON" #"-DLLVM_CCACHE_BUILD=ON"
# libxml2 needs to be disabled because the LLVM build system ignores its .la # libxml2 needs to be disabled because the LLVM build system ignores its .la
@ -100,14 +100,14 @@
# ''; # '';
}; };
circt = with final; llvmPackages_14.stdenv.mkDerivation rec { circt = with final; llvmPackages_16.stdenv.mkDerivation rec {
name = "circt-${version}"; name = "circt-${version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "llvm"; owner = "llvm";
repo = "circt"; repo = "circt";
rev = circtRevision; rev = circtRevision;
sha256 = "sha256-jptvNvrTF52vh0NyLqo4Iv6Ov9qttluERZgXsnayKa8="; sha256 = "sha256-iPt50T5+yqTnZKzgR5C6UW97XXfiKR1vXzXTNnvZOjE="; # lib.fakeSha256;
}; };
sourceRoot = "source/"; sourceRoot = "source/";
@ -118,9 +118,9 @@
cmake cmake
#ncurses #ncurses
#zlib #zlib
#llvmPackages_14.llvm #llvmPackages_16.llvm
llvmPackages_14.clang llvmPackages_16.clang
llvmPackages_14.bintools llvmPackages_16.bintools
mlir mlir
lit lit
]; ];
@ -178,7 +178,7 @@
nixosModules.mlir = nixosModules.mlir =
{ pkgs, ... }: { pkgs, ... }:
{ {
nixpkgs.overlays = [ self.overlay ]; nixpkgs.overlays = [ self.overlays.default ];
environment.systemPackages = [ pkgs.mlir ]; environment.systemPackages = [ pkgs.mlir ];
@ -188,7 +188,7 @@
nixosModules.circt = nixosModules.circt =
{ pkgs, ... }: { pkgs, ... }:
{ {
nixpkgs.overlays = [ self.overlay ]; nixpkgs.overlays = [ self.overlays.default ];
environment.systemPackages = [ pkgs.circt ]; environment.systemPackages = [ pkgs.circt ];