diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 6f521937..dc397b73 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -14,9 +14,6 @@ jobs: win_64_cuda_compilercuda-nvcccuda_compiler_version12.0: CONFIG: win_64_cuda_compilercuda-nvcccuda_compiler_version12.0 UPLOAD_PACKAGES: 'True' - win_64_cuda_compilernvcccuda_compiler_version11.8: - CONFIG: win_64_cuda_compilernvcccuda_compiler_version11.8 - UPLOAD_PACKAGES: 'True' timeoutInMinutes: 360 variables: CONDA_BLD_PATH: D:\\bld\\ diff --git a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11.yaml b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11.yaml index e3ccb914..79b44eaa 100644 --- a/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11.yaml +++ b/.ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11.yaml @@ -32,11 +32,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x python: -- 3.10.* *_cpython -- 3.11.* *_cpython - 3.12.* *_cpython -- 3.8.* *_cpython -- 3.9.* *_cpython r_base: - '4.3' target_platform: diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilerNonecuda_compiler_versionNonecxx_compiler_version12.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilerNonecuda_compiler_versionNonecxx_compiler_version12.yaml index 91102458..ca2c96a8 100644 --- a/.ci_support/linux_64_c_compiler_version12cuda_compilerNonecuda_compiler_versionNonecxx_compiler_version12.yaml +++ b/.ci_support/linux_64_c_compiler_version12cuda_compilerNonecuda_compiler_versionNonecxx_compiler_version12.yaml @@ -32,11 +32,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x python: -- 3.10.* *_cpython -- 3.11.* *_cpython - 3.12.* *_cpython -- 3.8.* *_cpython -- 3.9.* *_cpython r_base: - '4.3' target_platform: diff --git a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml index ca128ee9..772f0755 100644 --- a/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml +++ b/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml @@ -32,11 +32,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x python: -- 3.10.* *_cpython -- 3.11.* *_cpython - 3.12.* *_cpython -- 3.8.* *_cpython -- 3.9.* *_cpython r_base: - '4.3' target_platform: diff --git a/.ci_support/win_64_cuda_compilerNonecuda_compiler_versionNone.yaml b/.ci_support/win_64_cuda_compilerNonecuda_compiler_versionNone.yaml index 1767a38f..3fa468c3 100644 --- a/.ci_support/win_64_cuda_compilerNonecuda_compiler_versionNone.yaml +++ b/.ci_support/win_64_cuda_compilerNonecuda_compiler_versionNone.yaml @@ -16,12 +16,6 @@ m2w64_c_compiler: - m2w64-toolchain m2w64_cxx_compiler: - m2w64-toolchain -pin_run_as_build: - r-base: - min_pin: x.x - max_pin: x.x -r_base: -- '4.1' target_platform: - win-64 zip_keys: diff --git a/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml index 590cce48..d7beb725 100644 --- a/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml +++ b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml @@ -16,12 +16,6 @@ m2w64_c_compiler: - m2w64-toolchain m2w64_cxx_compiler: - m2w64-toolchain -pin_run_as_build: - r-base: - min_pin: x.x - max_pin: x.x -r_base: -- '4.1' target_platform: - win-64 zip_keys: diff --git a/.ci_support/win_64_cuda_compilernvcccuda_compiler_version11.8.yaml b/.ci_support/win_64_cuda_compilernvcccuda_compiler_version11.8.yaml deleted file mode 100644 index 8ea29258..00000000 --- a/.ci_support/win_64_cuda_compilernvcccuda_compiler_version11.8.yaml +++ /dev/null @@ -1,29 +0,0 @@ -c_compiler: -- vs2019 -c_stdlib: -- vs -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- nvcc -cuda_compiler_version: -- '11.8' -cxx_compiler: -- vs2019 -m2w64_c_compiler: -- m2w64-toolchain -m2w64_cxx_compiler: -- m2w64-toolchain -pin_run_as_build: - r-base: - min_pin: x.x - max_pin: x.x -r_base: -- '4.1' -target_platform: -- win-64 -zip_keys: -- - cuda_compiler - - cuda_compiler_version diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index a5836e8d..c5dcc648 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -46,11 +46,10 @@ source run_conda_forge_build_setup # make the build number clobber make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" -if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]] && [[ "${HOST_PLATFORM}" != linux-* ]] && [[ "${BUILD_WITH_CONDA_DEBUG:-0}" != 1 ]]; then +if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]] && [[ "${BUILD_WITH_CONDA_DEBUG:-0}" != 1 ]]; then EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" fi - ( endgroup "Configuring conda" ) 2> /dev/null if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then @@ -72,7 +71,6 @@ else --suppress-variables ${EXTRA_CB_OPTIONS:-} \ --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \ --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" - ( startgroup "Inspecting artifacts" ) 2> /dev/null # inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat index 65650bf2..a7e8d062 100755 --- a/.scripts/run_win_build.bat +++ b/.scripts/run_win_build.bat @@ -42,9 +42,7 @@ if EXIST LICENSE.txt ( copy LICENSE.txt "recipe\\recipe-scripts-license.txt" ) if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] ( - if [%CROSSCOMPILING_EMULATOR%] == [] ( - set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test" - ) + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test" ) if NOT [%flow_run_id%] == [] ( diff --git a/README.md b/README.md index dbbb8ddc..0da9fea6 100644 --- a/README.md +++ b/README.md @@ -131,13 +131,6 @@ Current build status variant - - win_64_cuda_compilernvcccuda_compiler_version11.8 - - - variant - - diff --git a/conda-forge.yml b/conda-forge.yml index 92998234..409be079 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -18,4 +18,4 @@ os_version: provider: linux_aarch64: default linux_ppc64le: default -test: native_and_emulated +test: native diff --git a/recipe/0002-Enable-latest-libcxx-on-MacOS.patch b/recipe/0002-Enable-latest-libcxx-on-MacOS.patch deleted file mode 100644 index 0951d0ec..00000000 --- a/recipe/0002-Enable-latest-libcxx-on-MacOS.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 59ac1090da5ba692238f4baf87d46a4c81b9282c Mon Sep 17 00:00:00 2001 -From: Hyunsu Cho -Date: Wed, 1 Nov 2023 01:01:34 -0700 -Subject: [PATCH] Enable latest libcxx on MacOS - ---- - R-package/src/Makevars.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/R-package/src/Makevars.in b/R-package/src/Makevars.in -index 9e7cbfed..8b3af0ae 100644 ---- a/R-package/src/Makevars.in -+++ b/R-package/src/Makevars.in -@@ -7,7 +7,7 @@ CXX_STD = CXX17 - - XGB_RFLAGS = -DXGBOOST_STRICT_R_MODE=1 -DDMLC_LOG_BEFORE_THROW=0\ - -DDMLC_ENABLE_STD_THREAD=$(ENABLE_STD_THREAD) -DDMLC_DISABLE_STDIN=1\ -- -DDMLC_LOG_CUSTOMIZE=1 -+ -DDMLC_LOG_CUSTOMIZE=1 -D_LIBCPP_DISABLE_AVAILABILITY - - # disable the use of thread_local for 32 bit windows: - ifeq ($(R_OSTYPE)$(WIN),windows) --- -2.25.1 - diff --git a/recipe/0004-Undo-dmlc-xgboost-9436.patch b/recipe/0004-Undo-dmlc-xgboost-9436.patch deleted file mode 100644 index 2cbfbb3c..00000000 --- a/recipe/0004-Undo-dmlc-xgboost-9436.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 667a855dfa024ea392e60fa7f352a0781cb7f1e0 Mon Sep 17 00:00:00 2001 -From: Hyunsu Cho -Date: Thu, 2 Nov 2023 08:12:43 -0700 -Subject: [PATCH] Undo dmlc/xgboost#9436 - ---- - CMakeLists.txt | 9 --------- - cmake/Utils.cmake | 4 +--- - 2 files changed, 1 insertion(+), 12 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d6b861ab..ca0125cb 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -253,15 +253,6 @@ add_subdirectory(${xgboost_SOURCE_DIR}/plugin) - - if (PLUGIN_RMM) - find_package(rmm REQUIRED) -- -- # Patch the rmm targets so they reference the static cudart -- # Remove this patch once RMM stops specifying cudart requirement -- # (since RMM is a header-only library, it should not specify cudart in its CMake config) -- get_target_property(rmm_link_libs rmm::rmm INTERFACE_LINK_LIBRARIES) -- list(REMOVE_ITEM rmm_link_libs CUDA::cudart) -- list(APPEND rmm_link_libs CUDA::cudart_static) -- set_target_properties(rmm::rmm PROPERTIES INTERFACE_LINK_LIBRARIES "${rmm_link_libs}") -- get_target_property(rmm_link_libs rmm::rmm INTERFACE_LINK_LIBRARIES) - endif (PLUGIN_RMM) - - #-- library -diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake -index 08050205..98e96e30 100644 ---- a/cmake/Utils.cmake -+++ b/cmake/Utils.cmake -@@ -177,8 +177,7 @@ function(xgboost_set_cuda_flags target) - set_target_properties(${target} PROPERTIES - CUDA_STANDARD 17 - CUDA_STANDARD_REQUIRED ON -- CUDA_SEPARABLE_COMPILATION OFF -- CUDA_RUNTIME_LIBRARY Static) -+ CUDA_SEPARABLE_COMPILATION OFF) - endfunction(xgboost_set_cuda_flags) - - macro(xgboost_link_nccl target) -@@ -280,7 +279,6 @@ macro(xgboost_target_link_libraries target) - - if (USE_CUDA) - xgboost_set_cuda_flags(${target}) -- target_link_libraries(${target} PUBLIC CUDA::cudart_static) - endif (USE_CUDA) - - if (PLUGIN_RMM) --- -2.25.1 - diff --git a/recipe/bld.bat b/recipe/bld.bat index c26b2438..91558782 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -1,20 +1,22 @@ -mkdir "%SRC_DIR%"\build -pushd "%SRC_DIR%"\build +@echo on -if NOT "%cuda_compiler_version%"=="None" ( +mkdir %SRC_DIR%\build +pushd %SRC_DIR%\build + +if not "%cuda_compiler_version%" == "None" ( set "CMAKE_ARGS=-DUSE_CUDA=ON %CMAKE_ARGS%" ) cmake -G "Ninja" ^ %CMAKE_ARGS% ^ -DCMAKE_BUILD_TYPE:STRING="Release" ^ - -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^ + -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^ -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON ^ - -DR_LIB=OFF ^ + -DR_LIB:BOOL=OFF ^ "%SRC_DIR%" if errorlevel 1 exit 1 -cmake --build . --target install --config Release +cmake --build . --target install --config Release -- -v if errorlevel 1 exit 1 popd diff --git a/recipe/install-libxgboost.sh b/recipe/install-libxgboost.sh index ad403195..55b0381a 100644 --- a/recipe/install-libxgboost.sh +++ b/recipe/install-libxgboost.sh @@ -27,8 +27,6 @@ else fi mkdir -p ${LIBDIR} ${INCDIR}/xgboost ${BINDIR} || true -cp ${SRC_DIR}/xgboost${EXEEXT} ${BINDIR}/ cp ${SRC_DIR}/lib/${XGBOOSTDSO} ${SODIR}/ cp -Rf ${SRC_DIR}/include/xgboost ${INCDIR}/ -cp -Rf ${SRC_DIR}/rabit/include/rabit ${INCDIR}/xgboost/ cp -f ${SRC_DIR}/src/c_api/*.h ${INCDIR}/xgboost/ diff --git a/recipe/install-py-xgboost.sh b/recipe/install-py-xgboost.sh index ee992d49..ffb96347 100644 --- a/recipe/install-py-xgboost.sh +++ b/recipe/install-py-xgboost.sh @@ -1,5 +1,5 @@ #!/bin/bash pushd ${SRC_DIR}/python-package - ${PYTHON} -m pip install . -vv --config-settings use_system_libxgboost=True + ${PYTHON} -m pip install . -vv --config-settings use_system_libxgboost=True popd diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 6e324b58..0f147006 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,6 +1,7 @@ {% set name = "xgboost" %} -{% set version = "2.0.3" %} -{% set build_number = 4 %} +{% set version = "2.1.0" %} +{% set build_number = 0 %} +{% set min_python = "3.8" %} {% set string_prefix = "cuda" ~ (cuda_compiler_version | replace('.', '')) %} # [cuda_compiler_version != "None"] {% set string_prefix = "cpu" %} # [cuda_compiler_version == "None"] @@ -10,33 +11,37 @@ package: version: {{ version }} source: - # we have to use git urls here to get the submodules needed for the - # build - git_url: https://github.com/dmlc/xgboost - git_tag: v{{ version }} + url: https://github.com/dmlc/xgboost/releases/download/v{{ version }}/xgboost-{{ version }}.tar.gz + sha256: 28bec8e821b1fefcea722d96add66024adba399063f723bc5c815f7af4a5f5e4 patches: # xgboost patches - - 0001-Force-endian-flag-in-cross-compilation-mode.patch # [arm64 or aarch64 or ppc64le] - - 0002-Enable-latest-libcxx-on-MacOS.patch # [osx] - - 0003-Use-mingw-w64-path.patch - - 0004-Undo-dmlc-xgboost-9436.patch + - patches/0001-Force-endian-flag-in-cross-compilation-mode.patch # [arm64 or aarch64 or ppc64le] + - patches/0002-Enable-latest-libcxx-on-MacOS.patch # [osx] + - patches/0003-Use-mingw-w64-path.patch + - patches/0004-Backport-fixes.patch build: number: {{ build_number }} - skip: True # [cuda_compiler_version == "11.2"] + noarch: python + # Windows CUDA 11.8 fails due to a compilation error + # xref: https://github.com/conda-forge/xgboost-feedstock/issues/173 + skip: True # [win and cuda_compiler_version == "11.8"] requirements: build: - {{ compiler('c') }} - {{ compiler('cxx') }} - - {{ compiler('cuda') }} # [cuda_compiler != "None" and cuda_compiler_version != "None"] + - {{ compiler('m2w64_c') }} # [win] + - {{ compiler('m2w64_cxx') }} # [win] + - {{ compiler('cuda') }} # [cuda_compiler != "None" and cuda_compiler_version != "None"] - {{ stdlib('c') }} - cmake - llvm-openmp # [osx] - libgomp # [linux] - ninja host: - - nccl # [linux and cuda_compiler != "None"] + - cccl !=2.4.0,!=2.5.0 # [cuda_compiler != "None"] + - nccl # [linux and cuda_compiler != "None"] outputs: - name: libxgboost @@ -50,7 +55,10 @@ outputs: missing_dso_whitelist: # Conda-build raises the missing `R.dll` linkage erroneously. # xref: https://github.com/conda/conda-build/pull/4786 - - '*/R.dll' # [win] + - '*/R.dll' # [win] + # Conda-build raises the missing `ld64.so.2` linkage erroneously. + # xref: https://github.com/conda/conda-build/issues/5403 + - $RPATH/ld64.so.2 # [ppc64le] requirements: build: - {{ compiler('c') }} @@ -69,11 +77,18 @@ outputs: {% if (cuda_compiler_version or "").startswith("11") %} - cuda-version >=11.2,<12 {% endif %} + test: + commands: + - test -f "${PREFIX}/lib/libxgboost${SHLIB_EXT}" # [unix] + - if not exist %LIBRARY_PREFIX%\mingw-w64\bin\xgboost.dll exit 1 # [win] - name: _py-xgboost-mutex version: 2.0 build: string: {{ "cpu" if cuda_compiler == "None" else "gpu" }}_0 + test: + commands: + - exit 0 - name: py-xgboost script: install-py-xgboost.sh # [not win] @@ -91,51 +106,63 @@ outputs: - PIP_NO_INDEX=True requirements: build: - - python # [build_platform != target_platform] - - cross-python_{{ target_platform }} # [build_platform != target_platform] + - python # [build_platform != target_platform] + - cross-python_{{ target_platform }} # [build_platform != target_platform] host: + - {{ pin_subpackage('_py-xgboost-mutex', exact=True) }} - {{ pin_subpackage('libxgboost', max_pin='x.x.x') }} - - python + - python >={{ min_python }} - hatchling >=1.12.1 - pip run: - - {{ pin_subpackage('libxgboost', max_pin='x.x.x') }} - {{ pin_subpackage('_py-xgboost-mutex', exact=True) }} - - python + - {{ pin_subpackage('libxgboost', max_pin='x.x.x') }} + - python >={{ min_python }} - numpy - scipy - scikit-learn - __cuda # [cuda_compiler != "None"] test: - script: test-py-xgboost.py + requires: + - python imports: - xgboost + script: test-py-xgboost.py - name: py-xgboost-cpu build: noarch: python - skip: true # [cuda_compiler != "None"] + skip: True # [cuda_compiler != "None"] requirements: host: - - python + - python >={{ min_python }} - {{ pin_subpackage('py-xgboost', exact=True) }} run: - - python + - python >={{ min_python }} - {{ pin_subpackage('py-xgboost', exact=True) }} + test: + requires: + - python + imports: + - xgboost - name: py-xgboost-gpu build: noarch: python - skip: true # [cuda_compiler == "None"] + skip: True # [cuda_compiler == "None"] requirements: host: - - python + - python >={{ min_python }} - {{ pin_subpackage('py-xgboost', exact=True) }} run: - - python + - python >={{ min_python }} - {{ pin_subpackage('py-xgboost', exact=True) }} - __cuda # [cuda_compiler != "None"] - + test: + requires: + - python + imports: + - xgboost - name: xgboost build: @@ -143,24 +170,38 @@ outputs: string: {{ string_prefix }}_pyh{{ PKG_HASH }}_{{ PKG_BUILDNUM }} requirements: host: - - python + - python >={{ min_python }} + - {{ pin_subpackage('py-xgboost', exact=True) }} run: - - python + - python >={{ min_python }} - {{ pin_subpackage('py-xgboost', exact=True) }} - __cuda # [cuda_compiler != "None"] + test: + requires: + - python + imports: + - xgboost - name: _r-xgboost-mutex version: 2.0 build: string: {{ "cpu" if cuda_compiler == "None" else "gpu" }}_0 + test: + commands: + - exit 0 - name: r-xgboost script: install-r-xgboost.sh # [not win] script: install-r-xgboost.bat # [win] build: + skip: True # [r_base in ("4.1", "4.2") or win] string: {{ string_prefix }}_r{{ r_base | replace('.', '') }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} rpaths: - lib/R/lib + missing_dso_whitelist: + # Conda-build raises the missing `ld64.so.2` linkage erroneously. + # xref: https://github.com/conda/conda-build/issues/5403 + - $RPATH/ld64.so.2 # [ppc64le] requirements: build: - {{ compiler('m2w64_c') }} # [win] @@ -183,6 +224,7 @@ outputs: - r-jsonlite # [build_platform != target_platform] - r-knitr # [build_platform != target_platform] host: + - {{ pin_subpackage('_r-xgboost-mutex', exact=True) }} - {{ pin_subpackage('libxgboost', max_pin='x.x.x') }} - r-base - r-matrix @@ -191,8 +233,8 @@ outputs: - r-jsonlite - r-knitr run: - - {{ pin_subpackage('libxgboost', max_pin='x.x.x') }} - {{ pin_subpackage('_r-xgboost-mutex', exact=True) }} + - {{ pin_subpackage('libxgboost', max_pin='x.x.x') }} - r-base - r-matrix - r-data.table @@ -200,6 +242,8 @@ outputs: - r-jsonlite - __cuda # [cuda_compiler != "None"] test: + requires: + - r-base files: - test-r-xgboost.r commands: @@ -207,24 +251,40 @@ outputs: - name: r-xgboost-cpu build: - skip: true # [cuda_compiler != "None"] + skip: True # [cuda_compiler != "None"] + skip: True # [r_base in ("4.1", "4.2") or win] requirements: host: - r-base + - {{ pin_subpackage('r-xgboost', exact=True) }} run: - r-base - {{ pin_subpackage('r-xgboost', exact=True) }} + test: + requires: + - r-base + commands: + - $R -e "library('xgboost')" # [unix] + - "\"%R%\" -e \"library('xgboost')\"" # [win] - name: r-xgboost-gpu build: - skip: true # [cuda_compiler == "None"] + skip: True # [cuda_compiler == "None"] + skip: True # [r_base in ("4.1", "4.2") or win] requirements: host: - r-base + - {{ pin_subpackage('r-xgboost', exact=True) }} run: - r-base - {{ pin_subpackage('r-xgboost', exact=True) }} - __cuda # [cuda_compiler != "None"] + test: + requires: + - r-base + commands: + - $R -e "library('xgboost')" # [unix] + - "\"%R%\" -e \"library('xgboost')\"" # [win] about: home: https://github.com/dmlc/xgboost diff --git a/recipe/0001-Force-endian-flag-in-cross-compilation-mode.patch b/recipe/patches/0001-Force-endian-flag-in-cross-compilation-mode.patch similarity index 100% rename from recipe/0001-Force-endian-flag-in-cross-compilation-mode.patch rename to recipe/patches/0001-Force-endian-flag-in-cross-compilation-mode.patch diff --git a/recipe/patches/0002-Enable-latest-libcxx-on-MacOS.patch b/recipe/patches/0002-Enable-latest-libcxx-on-MacOS.patch new file mode 100644 index 00000000..5321e35a --- /dev/null +++ b/recipe/patches/0002-Enable-latest-libcxx-on-MacOS.patch @@ -0,0 +1,26 @@ +From 7bb7bd609859057f80576fc156f4b3e19218a671 Mon Sep 17 00:00:00 2001 +From: Hyunsu Cho +Date: Fri, 28 Jun 2024 17:40:28 -0700 +Subject: [PATCH] Enable latest libcxx on MacOS + +--- + R-package/src/Makevars.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/R-package/src/Makevars.in b/R-package/src/Makevars.in +index 93cfb8e5b..e24cfed93 100644 +--- a/R-package/src/Makevars.in ++++ b/R-package/src/Makevars.in +@@ -10,7 +10,8 @@ XGB_RFLAGS = \ + -DDMLC_LOG_BEFORE_THROW=0 \ + -DDMLC_ENABLE_STD_THREAD=$(ENABLE_STD_THREAD) \ + -DDMLC_DISABLE_STDIN=1 \ +- -DDMLC_LOG_CUSTOMIZE=1 ++ -DDMLC_LOG_CUSTOMIZE=1 \ ++ -D_LIBCPP_DISABLE_AVAILABILITY + + # disable the use of thread_local for 32 bit windows: + ifeq ($(R_OSTYPE)$(WIN),windows) +-- +2.34.1 + diff --git a/recipe/0003-Use-mingw-w64-path.patch b/recipe/patches/0003-Use-mingw-w64-path.patch similarity index 100% rename from recipe/0003-Use-mingw-w64-path.patch rename to recipe/patches/0003-Use-mingw-w64-path.patch diff --git a/recipe/patches/0004-Backport-fixes.patch b/recipe/patches/0004-Backport-fixes.patch new file mode 100644 index 00000000..199aac90 --- /dev/null +++ b/recipe/patches/0004-Backport-fixes.patch @@ -0,0 +1,143 @@ +From 7782edc8e004bd3fe10879c52753d6a6de35947d Mon Sep 17 00:00:00 2001 +From: Hyunsu Cho +Date: Fri, 28 Jun 2024 17:38:34 -0700 +Subject: [PATCH] Backport fixes + +* Undo dmlc/xgboost#9436 +* Explicitly link with CCCL (standalone or CTK) (#10624, #10633) +* Partial fix for CTK 12.5 (#10574) +--- + CMakeLists.txt | 27 ++++++++++++++++++--------- + cmake/Utils.cmake | 7 +++---- + src/tree/updater_gpu_common.cuh | 21 ++++++++------------- + src/tree/updater_gpu_hist.cu | 1 + + 4 files changed, 30 insertions(+), 26 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c4ca82937..aa078405f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -224,6 +224,24 @@ if(USE_CUDA) + add_subdirectory(${PROJECT_SOURCE_DIR}/gputreeshap) + + find_package(CUDAToolkit REQUIRED) ++ find_package(CCCL CONFIG) ++ if(NOT CCCL_FOUND) ++ message(STATUS "Standalone CCCL not found. Attempting to use CCCL from CUDA Toolkit...") ++ find_package(CCCL CONFIG ++ HINTS ${CUDAToolkit_LIBRARY_DIR}/cmake) ++ if(NOT CCCL_FOUND) ++ message(STATUS "Could not locate CCCL from CUDA Toolkit. Using Thrust and CUB from CUDA Toolkit...") ++ find_package(libcudacxx CONFIG REQUIRED ++ HINTS ${CUDAToolkit_LIBRARY_DIR}/cmake) ++ find_package(CUB CONFIG REQUIRED ++ HINTS ${CUDAToolkit_LIBRARY_DIR}/cmake) ++ find_package(Thrust CONFIG REQUIRED ++ HINTS ${CUDAToolkit_LIBRARY_DIR}/cmake) ++ thrust_create_target(Thrust HOST CPP DEVICE CUDA) ++ add_library(CCCL::CCCL INTERFACE IMPORTED GLOBAL) ++ target_link_libraries(CCCL::CCCL INTERFACE libcudacxx::libcudacxx CUB::CUB Thrust) ++ endif() ++ endif() + endif() + + if(FORCE_COLORED_OUTPUT AND (CMAKE_GENERATOR STREQUAL "Ninja") AND +@@ -301,15 +319,6 @@ add_subdirectory(${xgboost_SOURCE_DIR}/plugin) + + if(PLUGIN_RMM) + find_package(rmm REQUIRED) +- +- # Patch the rmm targets so they reference the static cudart +- # Remove this patch once RMM stops specifying cudart requirement +- # (since RMM is a header-only library, it should not specify cudart in its CMake config) +- get_target_property(rmm_link_libs rmm::rmm INTERFACE_LINK_LIBRARIES) +- list(REMOVE_ITEM rmm_link_libs CUDA::cudart) +- list(APPEND rmm_link_libs CUDA::cudart_static) +- set_target_properties(rmm::rmm PROPERTIES INTERFACE_LINK_LIBRARIES "${rmm_link_libs}") +- get_target_property(rmm_link_libs rmm::rmm INTERFACE_LINK_LIBRARIES) + endif() + + if(PLUGIN_SYCL) +diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake +index d555f5edf..c1f19fdbb 100644 +--- a/cmake/Utils.cmake ++++ b/cmake/Utils.cmake +@@ -108,12 +108,12 @@ function(xgboost_set_cuda_flags target) + target_compile_definitions(${target} PRIVATE -DXGBOOST_USE_NVTX=1) + endif() + ++ target_link_libraries(${target} ++ PRIVATE CCCL::CCCL CUDA::cudart_static) + target_compile_definitions(${target} PRIVATE -DXGBOOST_USE_CUDA=1) + target_include_directories( + ${target} PRIVATE +- ${xgboost_SOURCE_DIR}/gputreeshap +- ${xgboost_SOURCE_DIR}/rabit/include +- ${CUDAToolkit_INCLUDE_DIRS}) ++ ${xgboost_SOURCE_DIR}/gputreeshap) + + if(MSVC) + target_compile_options(${target} PRIVATE +@@ -240,7 +240,6 @@ macro(xgboost_target_link_libraries target) + + if(USE_CUDA) + xgboost_set_cuda_flags(${target}) +- target_link_libraries(${target} PUBLIC CUDA::cudart_static) + endif() + + if(PLUGIN_RMM) +diff --git a/src/tree/updater_gpu_common.cuh b/src/tree/updater_gpu_common.cuh +index 1c3e6a552..5d999d6d6 100644 +--- a/src/tree/updater_gpu_common.cuh ++++ b/src/tree/updater_gpu_common.cuh +@@ -1,18 +1,13 @@ +-/*! +- * Copyright 2017-2019 XGBoost contributors ++/** ++ * Copyright 2017-2024, XGBoost contributors + */ + #pragma once +-#include +-#include +-#include +-#include +-#include +-#include +-#include "../common/categorical.h" +-#include "../common/device_helpers.cuh" +-#include "../common/random.h" ++#include // for numeric_limits ++#include // for ostream ++ + #include "gpu_hist/histogram.cuh" + #include "param.h" ++#include "xgboost/base.h" + + namespace xgboost::tree { + struct GPUTrainingParam { +@@ -54,8 +49,8 @@ enum DefaultDirection { + }; + + struct DeviceSplitCandidate { +- float loss_chg {-FLT_MAX}; +- DefaultDirection dir {kLeftDir}; ++ float loss_chg{-std::numeric_limits::max()}; ++ DefaultDirection dir{kLeftDir}; + int findex {-1}; + float fvalue {0}; + // categorical split, either it's the split category for OHE or the threshold for partition-based +diff --git a/src/tree/updater_gpu_hist.cu b/src/tree/updater_gpu_hist.cu +index 958fa0331..e126aeb31 100644 +--- a/src/tree/updater_gpu_hist.cu ++++ b/src/tree/updater_gpu_hist.cu +@@ -19,6 +19,7 @@ + #include "../common/cuda_context.cuh" // CUDAContext + #include "../common/device_helpers.cuh" + #include "../common/hist_util.h" ++#include "../common/random.h" // for ColumnSampler, GlobalRandom + #include "../common/timer.h" + #include "../data/ellpack_page.cuh" + #include "../data/ellpack_page.h" +-- +2.45.2 + diff --git a/recipe/test-r-xgboost.r b/recipe/test-r-xgboost.r index 96285c98..e8978898 100644 --- a/recipe/test-r-xgboost.r +++ b/recipe/test-r-xgboost.r @@ -25,6 +25,6 @@ err <- mean(as.numeric(pred > 0.5) != test$label) print(paste("test-error=", err)) dtrain <- xgb.DMatrix(data = train$data, label=train$label) dtest <- xgb.DMatrix(data = test$data, label=test$label) -watchlist <- list(train=dtrain, test=dtest) -bst <- xgb.train(data=dtrain, max_depth=2, eta=1, nthread = 2, nrounds=2, watchlist=watchlist, objective = "binary:logistic") -bst <- xgb.train(data=dtrain, max_depth=2, eta=1, nthread = 2, nrounds=2, watchlist=watchlist, eval_metric = "error", eval_metric = "logloss", objective = "binary:logistic") +evals <- list(train=dtrain, test=dtest) +bst <- xgb.train(data=dtrain, max_depth=2, eta=1, nthread = 2, nrounds=2, evals=evals, objective = "binary:logistic") +bst <- xgb.train(data=dtrain, max_depth=2, eta=1, nthread = 2, nrounds=2, evals=evals, eval_metric = "error", eval_metric = "logloss", objective = "binary:logistic")