Skip to content

Commit

Permalink
catboost: tweak, fix build (#370663)
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage authored Jan 3, 2025
2 parents 9fb52ee + b3df77d commit 2707aa7
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions pkgs/by-name/ca/catboost/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
ragel,
yasm,
zlib,
gitUpdater,
cudaSupport ? config.cudaSupport,
cudaPackages ? { },
llvmPackages_12,
pythonSupport ? false,
}:
let
inherit (llvmPackages) stdenv;
stdenv = if cudaSupport then cudaPackages.backendStdenv else llvmPackages.stdenv;
in

stdenv.mkDerivation (finalAttrs: {
Expand All @@ -28,7 +29,7 @@ stdenv.mkDerivation (finalAttrs: {
src = fetchFromGitHub {
owner = "catboost";
repo = "catboost";
rev = "refs/tags/v${finalAttrs.version}";
tag = "v${finalAttrs.version}";
hash = "sha256-I3geFdVQ1Pm61eRXi+ueaxel3QRb8EJV9f4zV2Q7kk4=";
};

Expand Down Expand Up @@ -68,12 +69,9 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
]
++ lib.optionals cudaSupport (
with cudaPackages;
[
cuda_nvcc
]
);
++ lib.optionals cudaSupport [
cudaPackages.cuda_nvcc
];

buildInputs =
[
Expand All @@ -83,14 +81,11 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
]
++ lib.optionals cudaSupport (
with cudaPackages;
[
cuda_cudart
cuda_cccl
libcublas
]
);
++ lib.optionals cudaSupport [
cudaPackages.cuda_cudart
cudaPackages.cuda_cccl
cudaPackages.libcublas
];

env = {
PROGRAM_VERSION = finalAttrs.version;
Expand All @@ -101,6 +96,11 @@ stdenv.mkDerivation (finalAttrs: {
CUDAHOSTCXX = lib.optionalString cudaSupport "${llvmPackages_12.stdenv.cc}/bin/cc";
NIX_CFLAGS_LINK = lib.optionalString stdenv.hostPlatform.isLinux "-fuse-ld=lld";
NIX_LDFLAGS = "-lc -lm";
NIX_CFLAGS_COMPILE = toString (
lib.optionals stdenv.cc.isClang [
"-Wno-error=missing-template-arg-list-after-template-kw"
]
);
};

cmakeFlags = [
Expand All @@ -123,18 +123,20 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstall
'';

meta = with lib; {
passthru.updateScript = gitUpdater { rev-prefix = "v"; };

meta = {
description = "High-performance library for gradient boosting on decision trees";
longDescription = ''
A fast, scalable, high performance Gradient Boosting on Decision Trees
library, used for ranking, classification, regression and other machine
learning tasks for Python, R, Java, C++. Supports computation on CPU and GPU.
'';
changelog = "https://github.com/catboost/catboost/releases/tag/v${finalAttrs.version}";
license = licenses.asl20;
platforms = platforms.unix;
license = lib.licenses.asl20;
platforms = lib.platforms.unix;
homepage = "https://catboost.ai";
maintainers = with maintainers; [
maintainers = with lib.maintainers; [
PlushBeaver
natsukium
];
Expand Down

0 comments on commit 2707aa7

Please sign in to comment.