Skip to content

Commit 7800fc5

Browse files
committed
fix: use nixpkgs 24.05 and use gcc12 for cuda 12
1 parent 9ad0367 commit 7800fc5

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

flake.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description = "libdebayer";
33

44
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
66
jetpack-nixos.url = "github:anduril/jetpack-nixos";
77
rust-overlay.url = "github:oxalica/rust-overlay";
88
flake-utils.url = "github:numtide/flake-utils";
@@ -18,7 +18,7 @@
1818
};
1919

2020
cudatoolkit = if system == "aarch64-linux" then jetpack-nixos.legacyPackages.aarch64-linux.cudaPackages.cudatoolkit else pkgs.cudatoolkit;
21-
libdebayer = pkgs.stdenv.mkDerivation {
21+
libdebayer = pkgs.gcc12Stdenv.mkDerivation {
2222
pname = "libdebayer";
2323
version = "0.1.0";
2424
src = ./c;
@@ -29,7 +29,7 @@
2929
'';
3030
};
3131

32-
libdebayer_cpp = pkgs.stdenv.mkDerivation {
32+
libdebayer_cpp = pkgs.gcc12Stdenv.mkDerivation {
3333
pname = "libdebayer_cpp";
3434
version = "0.1.0";
3535
src = ./cpp;
@@ -81,9 +81,10 @@
8181
packages.fetch_kodak = fetch_kodak;
8282
packages.kodak_benchmark_cpp_unwrapped = kodak_benchmark_cpp_unwrapped;
8383
packages.kodak_benchmark_cpp = kodak_benchmark_cpp;
84-
85-
devShells.default = mkShell {
86-
nativeBuildInputs = with pkgs; [ pkg-config cmake clang ];
84+
85+
# NOTE: have to use gcc 12 for nvcc+cuda12
86+
devShells.default = mkShell.override { stdenv = gcc12Stdenv; } {
87+
nativeBuildInputs = with pkgs; [ pkg-config cmake clang ] ;
8788
buildInputs = with pkgs; [
8889
gitFull gitRepo gnupg autoconf curl
8990
procps gnumake util-linux m4 gperf unzip
@@ -103,11 +104,11 @@
103104
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib/";
104105

105106

107+
106108
shellHook = ''
107109
export CUDA_PATH=${cudatoolkit}
108110
export libdebayer_DIR=${libdebayer}/lib/cmake
109111
export libdebayercpp_DIR=${libdebayer_cpp}/lib/cmake
110-
# export LD_LIBRARY_PATH=${pkgs.linuxPackages.nvidia_x11}/lib:${pkgs.ncurses5}/lib
111112
export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib"
112113
export EXTRA_CCFLAGS="-I/usr/include"
113114
'';

0 commit comments

Comments
 (0)