mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-27 22:44:56 +00:00
Merge pull request #292960 from natsukium/catboost/update
catboost: 1.2.2 -> 1.2.3
This commit is contained in:
commit
d742035eb3
@ -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 = [
|
||||
@ -33,8 +37,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace cmake/common.cmake \
|
||||
--replace "\''${RAGEL_BIN}" "${ragel}/bin/ragel" \
|
||||
--replace "\''${YASM_BIN}" "${yasm}/bin/yasm"
|
||||
--replace-fail "\''${RAGEL_BIN}" "${ragel}/bin/ragel" \
|
||||
--replace-fail "\''${YASM_BIN}" "${yasm}/bin/yasm"
|
||||
|
||||
shopt -s globstar
|
||||
for cmakelists in **/CMakeLists.*; do
|
||||
@ -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,17 +77,19 @@ 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";
|
||||
};
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_BINARY_DIR=$out"
|
||||
"-DCMAKE_POSITION_INDEPENDENT_CODE=on"
|
||||
"-DCATBOOST_COMPONENTS=app;libs${lib.optionalString pythonSupport ";python-package"}"
|
||||
] ++ lib.optionals cudaSupport [
|
||||
"-DHAVE_CUDA=on"
|
||||
(lib.cmakeFeature "CMAKE_BINARY_DIR" "$out")
|
||||
(lib.cmakeBool "CMAKE_POSITION_INDEPENDENT_CODE" true)
|
||||
(lib.cmakeFeature "CATBOOST_COMPONENTS" "app;libs${lib.optionalString pythonSupport ";python-package"}")
|
||||
(lib.cmakeBool "HAVE_CUDA" cudaSupport)
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
|
@ -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}
|
||||
|
@ -20343,10 +20343,6 @@ with pkgs;
|
||||
captive-browser = callPackage ../applications/networking/browsers/captive-browser { };
|
||||
|
||||
catboost = callPackage ../development/libraries/catboost {
|
||||
# catboost requires clang 12+ for build
|
||||
# after bumping the default version of llvm, check for compatibility with the cuda backend and pin it.
|
||||
inherit (llvmPackages_12) stdenv;
|
||||
|
||||
# https://github.com/catboost/catboost/issues/2540
|
||||
cudaPackages = cudaPackages_11;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user