Skip to content

Commit

Permalink
Add a nix package
Browse files Browse the repository at this point in the history
Must be built with `nix build '.?submodules=1'` until this is merged:
  NixOS/nix#7862
  • Loading branch information
sjmonson committed May 23, 2024
1 parent 331bcad commit 83e3497
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
40 changes: 40 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
config,
stdenv,
lib,
cudaPackages ? { },
...
}:

stdenv.mkDerivation {
pname = "tdr-inverse";
version = "0.0.1";

src = ./.;

nativeBuildInputs = [
cudaPackages.cudatoolkit
];

# buildPhase = ''
# make
# '';

installPhase = ''
mkdir -p $out/bin
install ./bin/inverse $out/bin
install ./bin/cpu-inverse $out/bin
install ./bin/tdr-inverse $out/bin
'';

meta = with lib; {
name = "GPU-Based Matrix Inversion";
description = ''
Optimized GPU-Based Matrix Inversion
Though The Use of Thread-Data Remapping
'';
homepage = "https://github.com/scrufulufugus/tdr-inverse";
license = licenses.bsd3;
platforms = platforms.all;
};
}
5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
};
in
{
packages.default = pkgs.callPackage ./. {
stdenv = pkgs.gcc11Stdenv;
cudaPackages = pkgs.cudaPackages_12_3;
};

# TODO: Have to override with no CC since we're building with host CUDA
#devShells.default = pkgs.mkShell.override { stdenv = pkgs.stdenvNoCC; } {
devShells.default = pkgs.mkShell.override { stdenv = pkgs.gcc11Stdenv; } {
Expand Down

0 comments on commit 83e3497

Please sign in to comment.