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_version11python3.8.____cpython.yaml similarity index 89% rename from .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11.yaml rename to .ci_support/linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.8.____cpython.yaml index 53ddddfe..0b131e3c 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_version11python3.8.____cpython.yaml @@ -34,13 +34,8 @@ 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.2' - '4.3' target_platform: - linux-64 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_version12python3.8.____cpython.yaml similarity index 89% rename from .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml rename to .ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.8.____cpython.yaml index da6b36ed..b4978f92 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_version12python3.8.____cpython.yaml @@ -34,13 +34,8 @@ 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.2' - '4.3' target_platform: - linux-64 diff --git a/.ci_support/linux_aarch64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11.yaml b/.ci_support/linux_aarch64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.8.____cpython.yaml similarity index 90% rename from .ci_support/linux_aarch64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11.yaml rename to .ci_support/linux_aarch64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.8.____cpython.yaml index b381c17d..39495b50 100644 --- a/.ci_support/linux_aarch64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11.yaml +++ b/.ci_support/linux_aarch64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.8.____cpython.yaml @@ -38,13 +38,8 @@ 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.2' - '4.3' target_platform: - linux-aarch64 diff --git a/.ci_support/linux_aarch64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml b/.ci_support/linux_aarch64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.8.____cpython.yaml similarity index 90% rename from .ci_support/linux_aarch64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml rename to .ci_support/linux_aarch64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.8.____cpython.yaml index 81474bf9..360e6d89 100644 --- a/.ci_support/linux_aarch64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12.yaml +++ b/.ci_support/linux_aarch64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.8.____cpython.yaml @@ -38,13 +38,8 @@ 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.2' - '4.3' target_platform: - linux-aarch64 diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_python3.8.____cpython.yaml similarity index 89% rename from .ci_support/osx_64_.yaml rename to .ci_support/osx_64_python3.8.____cpython.yaml index 17afc491..ade4a1ba 100644 --- a/.ci_support/osx_64_.yaml +++ b/.ci_support/osx_64_python3.8.____cpython.yaml @@ -34,13 +34,8 @@ 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.2' - '4.3' target_platform: - osx-64 diff --git a/.ci_support/osx_arm64_.yaml b/.ci_support/osx_arm64_python3.8.____cpython.yaml similarity index 89% rename from .ci_support/osx_arm64_.yaml rename to .ci_support/osx_arm64_python3.8.____cpython.yaml index 20802e40..7bcd5cda 100644 --- a/.ci_support/osx_arm64_.yaml +++ b/.ci_support/osx_arm64_python3.8.____cpython.yaml @@ -34,13 +34,8 @@ 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.2' - '4.3' target_platform: - osx-arm64 diff --git a/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.8.____cpython.yaml similarity index 77% rename from .ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml rename to .ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.8.____cpython.yaml index e90aabe0..89c50e21 100644 --- a/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0.yaml +++ b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.8.____cpython.yaml @@ -20,17 +20,8 @@ pin_run_as_build: python: min_pin: x.x max_pin: x.x - r-base: - 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.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 8296e59b..00000000 --- a/.ci_support/win_64_cuda_compilernvcccuda_compiler_version11.8.yaml +++ /dev/null @@ -1,38 +0,0 @@ -c_compiler: -- vs2019 -c_stdlib: -- vs -channel_sources: -- rapidsai,rapidsai-nightly,conda-forge -channel_targets: -- rapidsai-nightly 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: - python: - min_pin: x.x - max_pin: x.x - r-base: - 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.1' -target_platform: -- win-64 -zip_keys: -- - cuda_compiler - - cuda_compiler_version diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index b28b1eeb..0593f809 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -23,39 +23,35 @@ jobs: fail-fast: false matrix: include: - - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11 + - CONFIG: linux_64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.8.____cpython UPLOAD_PACKAGES: True os: ubuntu runs_on: ['ubuntu-latest'] DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 - - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12 + - CONFIG: linux_64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.8.____cpython UPLOAD_PACKAGES: True os: ubuntu runs_on: ['ubuntu-latest'] DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - - CONFIG: linux_aarch64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11 + - CONFIG: linux_aarch64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11python3.8.____cpython UPLOAD_PACKAGES: True os: ubuntu runs_on: ['ubuntu-latest'] DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cuda:11.8 - - CONFIG: linux_aarch64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12 + - CONFIG: linux_aarch64_c_compiler_version12cuda_compilercuda-nvcccuda_compiler_version12.0cxx_compiler_version12python3.8.____cpython UPLOAD_PACKAGES: True os: ubuntu runs_on: ['ubuntu-latest'] DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - - CONFIG: osx_64_ + - CONFIG: osx_64_python3.8.____cpython UPLOAD_PACKAGES: True os: macos runs_on: ['macos-13'] - - CONFIG: osx_arm64_ + - CONFIG: osx_arm64_python3.8.____cpython UPLOAD_PACKAGES: True os: macos runs_on: ['macos-13'] - - CONFIG: win_64_cuda_compilercuda-nvcccuda_compiler_version12.0 - UPLOAD_PACKAGES: True - os: windows - runs_on: ['windows-latest'] - - CONFIG: win_64_cuda_compilernvcccuda_compiler_version11.8 + - CONFIG: win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.8.____cpython UPLOAD_PACKAGES: True os: windows runs_on: ['windows-latest'] diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index ddccc5d1..93621368 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,6 +71,12 @@ 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 + command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" + + ( endgroup "Inspecting artifacts" ) 2> /dev/null ( startgroup "Uploading packages" ) 2> /dev/null diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 759e4c43..d12507d3 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -86,6 +86,13 @@ else --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 + command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" + + ( endgroup "Inspecting artifacts" ) 2> /dev/null + ( startgroup "Uploading packages" ) 2> /dev/null if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat index 73035396..9dd6b0ac 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%] == [] ( @@ -58,6 +56,11 @@ echo Building recipe conda-build.exe "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% if !errorlevel! neq 0 exit /b !errorlevel! +call :start_group "Inspecting artifacts" +:: inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 +WHERE inspect_artifacts >nul 2>nul && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" +call :end_group + :: Prepare some environment variables for the upload step if /i "%CI%" == "github_actions" ( set "FEEDSTOCK_NAME=%GITHUB_REPOSITORY:*/=%" diff --git a/conda-forge.yml b/conda-forge.yml index 90928b72..2adfa803 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -7,10 +7,7 @@ channel_priority: flexible conda_build: error_overlinking: true pkg_format: '2' -conda_build_tool: conda-build conda_forge_output_validation: false -conda_install_tool: mamba -conda_solver: libmamba github: branch_name: main tooling_branch_name: main @@ -27,5 +24,5 @@ provider: linux_aarch64: github_actions osx: github_actions win: github_actions -test: native_and_emulated +test: native upload_on_branch: main 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/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 97fb9009..c400cd47 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,41 +1,54 @@ {% set name = "xgboost" %} -{% set version = "2.0.3" %} -{% set build_number = 5 %} +{% set version = "2.1.0" %} +{% set build_number = 1 %} +{% set min_python = "3.8" %} package: name: xgboost-split 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-pandas2-patch.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 # [(linux or win) and cuda_compiler == "None"] - skip: True # [cuda_compiler_version == "11.2"] + # Make sure only one Python is built for as packages are `noarch: python`. + # However using `noarch: python` upsets the linter. + # So skip all Python's except the minimum Python version upstream supports + # xref: https://github.com/conda-forge/conda-smithy/issues/1887#issuecomment-2244323850 + # Windows CUDA 11.8 fails due to a compilation error + # xref: https://github.com/conda-forge/xgboost-feedstock/issues/173 + {% if python is defined and cuda_compiler_version is defined %} + skip: {{ ( + ((linux or win) and cuda_compiler_version == "None") or + python.split(".")[:2] != min_python.split(".")[:2] or + (win and cuda_compiler_version == "11.8") + ) }} + {% endif %} 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"] - - librmm # [linux and cuda_compiler != "None"] + - cccl !=2.4.0,!=2.5.0 # [cuda_compiler != "None"] + - nccl # [linux and cuda_compiler != "None"] + - librmm # [linux and cuda_compiler != "None"] outputs: - name: libxgboost @@ -50,7 +63,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') }} @@ -71,6 +87,10 @@ outputs: {% endif %} run_constrained: - {{ pin_compatible('librmm', max_pin='x.x') }} # [linux and cuda_compiler != "None"] + 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 script: install-py-xgboost.sh # [not win] @@ -90,25 +110,27 @@ 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('libxgboost', max_pin='x.x.x') }} - libxgboost =*=rapidsai_h*_{{ PKG_BUILDNUM }} - - python + - python >={{ min_python }} - hatchling >=1.12.1 - pip run: - {{ pin_subpackage('libxgboost', max_pin='x.x.x') }} - libxgboost =*=rapidsai_h*_{{ PKG_BUILDNUM }} - - python + - python >={{ min_python }} - numpy - scipy - scikit-learn - test: - script: test-py-xgboost.py - imports: - - xgboost + test: + requires: + - python + imports: + - xgboost + script: test-py-xgboost.py - name: xgboost build: @@ -117,21 +139,32 @@ outputs: - librmm # [linux and cuda_compiler != "None"] requirements: host: - - python + - python >={{ min_python }} + - {{ pin_subpackage('py-xgboost', max_pin="x.x.x.x.x.x") }} run: - - python + - python >={{ min_python }} - {{ pin_subpackage('py-xgboost', max_pin="x.x.x.x.x.x") }} - py-xgboost =*=rapidsai_pyh*_{{ PKG_BUILDNUM }} + test: + requires: + - python + imports: + - xgboost - 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: rapidsai_r{{ r_base | replace('.', '') }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} rpaths: - lib/R/lib force_use_keys: - librmm # [linux and cuda_compiler != "None"] + 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] @@ -170,11 +203,13 @@ outputs: - r-data.table - r-magrittr - r-jsonlite - test: - files: - - test-r-xgboost.r - commands: - - Rscript test-r-xgboost.r + test: + requires: + - r-base + files: + - test-r-xgboost.r + commands: + - Rscript test-r-xgboost.r 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")