jungle/pkgs/tacuda/default.nix
2025-10-07 17:30:23 +02:00

69 lines
1.2 KiB
Nix

{ stdenv
, fetchFromGitHub
, automake
, autoconf
, libtool
, gnumake
, autoreconfHook
, boost
, cudaPackages
, useGit ? false
, gitUrl ? "git@gitlab-internal.bsc.es:task-awareness/tacuda/tacuda.git"
, gitBranch ? "main"
, gitCommit ? "35234f9445e6149a2bd38d119841e2485d6ee05e"
}:
let
release_ver = "2.1.0";
release = {
version = release_ver;
src = fetchFromGitHub {
owner = "bsc-pm";
repo = "tacuda";
rev = release_ver;
hash = "sha256-Cj3EiLVJSLvRv0ydeg7Vp4SpkniEqHkcWF+YOJQ8EcM=";
};
};
git = rec {
version = src.shortRev;
src = builtins.fetchGit {
url = gitUrl;
ref = gitBranch;
rev = gitCommit;
};
};
source = if (useGit) then git else release;
in
stdenv.mkDerivation {
pname = "tacuda";
inherit (source) src version;
enableParallelBuilding = true;
separateDebugInfo = true;
nativeBuildInputs = [
autoreconfHook
automake
autoconf
libtool
gnumake
];
patches = [ ./fix_config.patch ];
configureFlags = [ "--with-cuda-include=${cudaPackages.cudatoolkit}/include" ];
buildInputs = [
boost
cudaPackages.libcublas
cudaPackages.cuda_cudart
];
}