about summary refs log tree commit diff
path: root/pkgs/development/libraries/catboost
diff options
context:
space:
mode:
authornatsukium <tomoya.otabi@gmail.com>2024-03-03 11:10:09 +0900
committernatsukium <tomoya.otabi@gmail.com>2024-03-09 09:24:41 +0900
commit4bf3e6cf24af275628c335b7f385b80065c20bf3 (patch)
tree80fb4fd86eb3fed789bacdc7603ef4acd9052839 /pkgs/development/libraries/catboost
parent31f91738fb4aae351f1ee93300139c751dcf8196 (diff)
catboost: 1.2.2 -> 1.2.3
Diff: https://github.com/catboost/catboost/compare/refs/tags/v1.2.2...v1.2.3
Diffstat (limited to 'pkgs/development/libraries/catboost')
-rw-r--r--pkgs/development/libraries/catboost/default.nix17
-rw-r--r--pkgs/development/libraries/catboost/remove-conan.patch16
2 files changed, 21 insertions, 12 deletions
diff --git a/pkgs/development/libraries/catboost/default.nix b/pkgs/development/libraries/catboost/default.nix
index fc18eef2ca893..242ec3c0e8c8f 100644
--- a/pkgs/development/libraries/catboost/default.nix
+++ b/pkgs/development/libraries/catboost/default.nix
@@ -1,8 +1,8 @@
 { lib
 , config
-, stdenv
 , fetchFromGitHub
 , cmake
+, darwin
 , libiconv
 , llvmPackages
 , ninja
@@ -13,18 +13,22 @@
 , zlib
 , cudaSupport ? config.cudaSupport
 , cudaPackages ? {}
+, llvmPackages_12
 , pythonSupport ? false
 }:
+let
+  inherit (llvmPackages) stdenv;
+in
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "catboost";
-  version = "1.2.2";
+  version = "1.2.3";
 
   src = fetchFromGitHub {
     owner = "catboost";
     repo = "catboost";
     rev = "refs/tags/v${finalAttrs.version}";
-    hash = "sha256-A1zCIqPOW21dHKBQHRtS+/sstZ2o6F8k71lmJFGn0+g=";
+    hash = "sha256-wn9STnpqX3zmdxPmMYAz9JPdg13Goux76CMaCiqohk8=";
   };
 
   patches = [
@@ -55,6 +59,8 @@ stdenv.mkDerivation (finalAttrs: {
     (python3Packages.python.withPackages (ps: with ps; [ six ]))
     ragel
     yasm
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
+    darwin.cctools
   ] ++ lib.optionals cudaSupport (with cudaPackages; [
     cuda_nvcc
   ]);
@@ -71,7 +77,10 @@ stdenv.mkDerivation (finalAttrs: {
   ]);
 
   env = {
-    CUDAHOSTCXX = lib.optionalString cudaSupport "${stdenv.cc}/bin/cc";
+    # catboost requires clang 14+ for build, but does clang 12 for cuda build.
+    # after bumping the default version of llvm, check for compatibility with the cuda backend and pin it.
+    # see https://catboost.ai/en/docs/installation/build-environment-setup-for-cmake#compilers,-linkers-and-related-tools
+    CUDAHOSTCXX = lib.optionalString cudaSupport "${llvmPackages_12.stdenv.cc}/bin/cc";
     NIX_CFLAGS_LINK = lib.optionalString stdenv.isLinux "-fuse-ld=lld";
     NIX_LDFLAGS = "-lc -lm";
   };
diff --git a/pkgs/development/libraries/catboost/remove-conan.patch b/pkgs/development/libraries/catboost/remove-conan.patch
index 6f96b7989a587..44411ad4160ba 100644
--- a/pkgs/development/libraries/catboost/remove-conan.patch
+++ b/pkgs/development/libraries/catboost/remove-conan.patch
@@ -1,26 +1,26 @@
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index becd2ad03c..7e3c8c99b1 100644
+index ed6c53b220..5c6fb8f157 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -27,7 +27,6 @@ cmake_policy(SET CMP0104 OLD)
- 
+@@ -29,7 +29,6 @@ include(cmake/global_flags.cmake)
+ include(cmake/global_vars.cmake)
  include(cmake/archive.cmake)
  include(cmake/common.cmake)
 -include(cmake/conan.cmake)
  include(cmake/cuda.cmake)
  include(cmake/cython.cmake)
  include(cmake/fbs.cmake)
-@@ -37,21 +36,6 @@ include(cmake/recursive_library.cmake)
+@@ -38,21 +37,6 @@ include(cmake/recursive_library.cmake)
+ include(cmake/shared_libs.cmake)
  include(cmake/swig.cmake)
- include(cmake/global_vars.cmake)
  
 -if (CMAKE_CROSSCOMPILING)
--  include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
+-  include(${PROJECT_BINARY_DIR}/conan_paths.cmake)
 -else()
 -  conan_cmake_autodetect(settings)
 -  conan_cmake_install(
--    PATH_OR_REFERENCE ${CMAKE_SOURCE_DIR}
--    INSTALL_FOLDER ${CMAKE_BINARY_DIR}
+-    PATH_OR_REFERENCE ${PROJECT_SOURCE_DIR}
+-    INSTALL_FOLDER ${PROJECT_BINARY_DIR}
 -    BUILD missing
 -    REMOTE conancenter
 -    SETTINGS ${settings}