diff --git a/conda_forge_feedstock_check_solvable/_version.py b/conda_forge_feedstock_check_solvable/_version.py index 260c070..f9aa3e1 100644 --- a/conda_forge_feedstock_check_solvable/_version.py +++ b/conda_forge_feedstock_check_solvable/_version.py @@ -1 +1 @@ -__version__ = "0.3.1" +__version__ = "0.3.2" diff --git a/conda_forge_feedstock_check_solvable/mamba_solver.py b/conda_forge_feedstock_check_solvable/mamba_solver.py index e0475e3..a474f69 100644 --- a/conda_forge_feedstock_check_solvable/mamba_solver.py +++ b/conda_forge_feedstock_check_solvable/mamba_solver.py @@ -506,6 +506,7 @@ def clean(): fake_packages = [ FakePackage("__glibc", "2.12"), FakePackage("__glibc", "2.17"), + FakePackage("__glibc", "2.28"), FakePackage("__cuda", "9.2"), FakePackage("__cuda", "10.0"), FakePackage("__cuda", "10.1"), @@ -515,6 +516,17 @@ def clean(): FakePackage("__cuda", "11.2"), FakePackage("__cuda", "11.3"), FakePackage("__cuda", "11.4"), + FakePackage("__cuda", "11.5"), + FakePackage("__cuda", "11.6"), + FakePackage("__cuda", "11.7"), + FakePackage("__cuda", "11.8"), + FakePackage("__cuda", "11.9"), + FakePackage("__cuda", "12.0"), + FakePackage("__cuda", "12.1"), + FakePackage("__cuda", "12.2"), + FakePackage("__cuda", "12.3"), + FakePackage("__cuda", "12.4"), + FakePackage("__cuda", "12.5"), ] for pkg in fake_packages: repodata.add_package(pkg) @@ -549,6 +561,12 @@ def clean(): "13.0", "13.1", "13.2", + "13.3", + "13.4", + "13.5", + "13.6", + "13.7", + "13.8", ]: repodata.add_package( FakePackage("__osx", osx_ver), diff --git a/tests/test_mamba_solvable.py b/tests/test_mamba_solvable.py index a453798..bf862f0 100644 --- a/tests/test_mamba_solvable.py +++ b/tests/test_mamba_solvable.py @@ -257,6 +257,13 @@ def test_r_base_cross_solvable(): assert solvable, pprint.pformat(errors) +@flaky +def test_xgboost_solvable(): + feedstock_dir = os.path.join(os.path.dirname(__file__), "xgboost-feedstock") + solvable, errors, _ = is_recipe_solvable(feedstock_dir) + assert solvable, pprint.pformat(errors) + + def clone_and_checkout_repo(base_path: pathlib.Path, origin_url: str, ref: str): subprocess.run( f"cd {base_path} && git clone {origin_url} repo", diff --git a/tests/xgboost-feedstock/.ci_support/README b/tests/xgboost-feedstock/.ci_support/README new file mode 100644 index 0000000..a47316b --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/README @@ -0,0 +1,6 @@ +This file is automatically generated by conda-smithy. If any +particular build configuration is expected, but it is not found, +please make sure all dependencies are satisfiable. To add/modify any +matrix elements, you should create/change conda-smithy's input +recipe/conda_build_config.yaml and re-render the recipe, rather than +editing these files directly. diff --git a/tests/xgboost-feedstock/.ci_support/linux_64_c_compiler_version10cuda_compilernvcccxx_compiler_version10.yaml b/tests/xgboost-feedstock/.ci_support/linux_64_c_compiler_version10cuda_compilernvcccxx_compiler_version10.yaml new file mode 100644 index 0000000..0612a16 --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/linux_64_c_compiler_version10cuda_compilernvcccxx_compiler_version10.yaml @@ -0,0 +1,46 @@ +c_compiler: +- gcc +c_compiler_version: +- '10' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.2' +cxx_compiler: +- gxx +cxx_compiler_version: +- '10' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.2 +nccl: +- '2' +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.8.* *_cpython +- 3.9.* *_cpython +r_base: +- '4.2' +- '4.3' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - cuda_compiler + - cuda_compiler_version + - cdt_name + - docker_image diff --git a/tests/xgboost-feedstock/.ci_support/linux_64_c_compiler_version12cuda_compilerNonecxx_compiler_version12.yaml b/tests/xgboost-feedstock/.ci_support/linux_64_c_compiler_version12cuda_compilerNonecxx_compiler_version12.yaml new file mode 100644 index 0000000..647039f --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/linux_64_c_compiler_version12cuda_compilerNonecxx_compiler_version12.yaml @@ -0,0 +1,46 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +cdt_name: +- cos6 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +nccl: +- '2' +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.8.* *_cpython +- 3.9.* *_cpython +r_base: +- '4.2' +- '4.3' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - cuda_compiler + - cuda_compiler_version + - cdt_name + - docker_image diff --git a/tests/xgboost-feedstock/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccxx_compiler_version12.yaml b/tests/xgboost-feedstock/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccxx_compiler_version12.yaml new file mode 100644 index 0000000..b01204d --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/linux_64_c_compiler_version12cuda_compilercuda-nvcccxx_compiler_version12.yaml @@ -0,0 +1,46 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +nccl: +- '2' +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.8.* *_cpython +- 3.9.* *_cpython +r_base: +- '4.2' +- '4.3' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - cuda_compiler + - cuda_compiler_version + - cdt_name + - docker_image diff --git a/tests/xgboost-feedstock/.ci_support/linux_aarch64_c_compiler_version10cuda_compilernvcccxx_compiler_version10.yaml b/tests/xgboost-feedstock/.ci_support/linux_aarch64_c_compiler_version10cuda_compilernvcccxx_compiler_version10.yaml new file mode 100644 index 0000000..390f8ff --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/linux_aarch64_c_compiler_version10cuda_compilernvcccxx_compiler_version10.yaml @@ -0,0 +1,50 @@ +BUILD: +- aarch64-conda_cos7-linux-gnu +c_compiler: +- gcc +c_compiler_version: +- '10' +cdt_arch: +- aarch64 +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.2' +cxx_compiler: +- gxx +cxx_compiler_version: +- '10' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.2 +nccl: +- '2' +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.8.* *_cpython +- 3.9.* *_cpython +r_base: +- '4.2' +- '4.3' +target_platform: +- linux-aarch64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - cuda_compiler + - cuda_compiler_version + - cdt_name + - docker_image diff --git a/tests/xgboost-feedstock/.ci_support/linux_aarch64_c_compiler_version12cuda_compilerNonecxx_compiler_version12.yaml b/tests/xgboost-feedstock/.ci_support/linux_aarch64_c_compiler_version12cuda_compilerNonecxx_compiler_version12.yaml new file mode 100644 index 0000000..b865c91 --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/linux_aarch64_c_compiler_version12cuda_compilerNonecxx_compiler_version12.yaml @@ -0,0 +1,50 @@ +BUILD: +- aarch64-conda_cos7-linux-gnu +c_compiler: +- gcc +c_compiler_version: +- '12' +cdt_arch: +- aarch64 +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +nccl: +- '2' +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.8.* *_cpython +- 3.9.* *_cpython +r_base: +- '4.2' +- '4.3' +target_platform: +- linux-aarch64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - cuda_compiler + - cuda_compiler_version + - cdt_name + - docker_image diff --git a/tests/xgboost-feedstock/.ci_support/linux_ppc64le_c_compiler_version10cuda_compilernvcccxx_compiler_version10.yaml b/tests/xgboost-feedstock/.ci_support/linux_ppc64le_c_compiler_version10cuda_compilernvcccxx_compiler_version10.yaml new file mode 100644 index 0000000..be7a8ad --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/linux_ppc64le_c_compiler_version10cuda_compilernvcccxx_compiler_version10.yaml @@ -0,0 +1,46 @@ +c_compiler: +- gcc +c_compiler_version: +- '10' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- nvcc +cuda_compiler_version: +- '11.2' +cxx_compiler: +- gxx +cxx_compiler_version: +- '10' +docker_image: +- quay.io/condaforge/linux-anvil-cuda:11.2 +nccl: +- '2' +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.8.* *_cpython +- 3.9.* *_cpython +r_base: +- '4.2' +- '4.3' +target_platform: +- linux-ppc64le +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - cuda_compiler + - cuda_compiler_version + - cdt_name + - docker_image diff --git a/tests/xgboost-feedstock/.ci_support/linux_ppc64le_c_compiler_version12cuda_compilerNonecxx_compiler_version12.yaml b/tests/xgboost-feedstock/.ci_support/linux_ppc64le_c_compiler_version12cuda_compilerNonecxx_compiler_version12.yaml new file mode 100644 index 0000000..d5bf419 --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/linux_ppc64le_c_compiler_version12cuda_compilerNonecxx_compiler_version12.yaml @@ -0,0 +1,46 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +nccl: +- '2' +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.8.* *_cpython +- 3.9.* *_cpython +r_base: +- '4.2' +- '4.3' +target_platform: +- linux-ppc64le +zip_keys: +- - c_compiler_version + - cxx_compiler_version + - cuda_compiler + - cuda_compiler_version + - cdt_name + - docker_image diff --git a/tests/xgboost-feedstock/.ci_support/migrations/cuda120.yaml b/tests/xgboost-feedstock/.ci_support/migrations/cuda120.yaml new file mode 100644 index 0000000..17bd59c --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/migrations/cuda120.yaml @@ -0,0 +1,80 @@ +migrator_ts: 1682985063 +__migrator: + kind: + version + migration_number: + 1 + build_number: + 1 + paused: false + override_cbc_keys: + - cuda_compiler_stub + operation: key_add + check_solvable: false + primary_key: cuda_compiler_version + ordering: + cxx_compiler_version: + - 9 + - 8 + - 7 + c_compiler_version: + - 9 + - 8 + - 7 + fortran_compiler_version: + - 9 + - 8 + - 7 + docker_image: + - quay.io/condaforge/linux-anvil-comp7 # [os.environ.get("BUILD_PLATFORM") == "linux-64"] + - quay.io/condaforge/linux-anvil-aarch64 # [os.environ.get("BUILD_PLATFORM") == "linux-aarch64"] + - quay.io/condaforge/linux-anvil-ppc64le # [os.environ.get("BUILD_PLATFORM") == "linux-ppc64le"] + - quay.io/condaforge/linux-anvil-armv7l # [os.environ.get("BUILD_PLATFORM") == "linux-armv7l"] + - quay.io/condaforge/linux-anvil-cuda:9.2 # [linux64 and os.environ.get("BUILD_PLATFORM") == "linux-64"] + - quay.io/condaforge/linux-anvil-cuda:10.0 # [linux64 and os.environ.get("BUILD_PLATFORM") == "linux-64"] + - quay.io/condaforge/linux-anvil-cuda:10.1 # [linux64 and os.environ.get("BUILD_PLATFORM") == "linux-64"] + - quay.io/condaforge/linux-anvil-cuda:10.2 # [linux64 and os.environ.get("BUILD_PLATFORM") == "linux-64"] + - quay.io/condaforge/linux-anvil-cuda:11.0 # [linux64 and os.environ.get("BUILD_PLATFORM") == "linux-64"] + - quay.io/condaforge/linux-anvil-cuda:11.1 # [linux64 and os.environ.get("BUILD_PLATFORM") == "linux-64"] + - quay.io/condaforge/linux-anvil-cuda:11.2 # [linux64 and os.environ.get("BUILD_PLATFORM") == "linux-64"] + - quay.io/condaforge/linux-anvil-cos7-x86_64 # [linux64 and os.environ.get("BUILD_PLATFORM") == "linux-64"] + cuda_compiler_version: + - None + - 10.2 # [(linux64 or win) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 11.0 # [(linux64 or win) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 11.1 # [(linux64 or win) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 11.2 # [(linux64 or win) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 12.0 # [(linux64 or win) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + commit_message: | + Rebuild for CUDA 12 + + The transition to CUDA 12 SDK includes new packages for all CUDA libraries and + build tools. Notably, the cudatoolkit package no longer exists, and packages + should depend directly on the specific CUDA libraries (libblas, libcusolver, + etc) as needed. For an in-depth overview of the changes and to report problems + [see this issue]( https://github.com/conda-forge/conda-forge.github.io/issues/1963 ). + Please feel free to raise any issues encountered there. Thank you! :pray: + +cuda_compiler: # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - cuda-nvcc # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + +cuda_compiler_version: # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 12.0 # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + +c_compiler_version: # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 12 # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + +cxx_compiler_version: # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 12 # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + +fortran_compiler_version: # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 12 # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + +cudnn: # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 8 # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + +cdt_name: # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - cos7 # [linux64 and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + +docker_image: # [os.environ.get("BUILD_PLATFORM", "").startswith("linux-") and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - quay.io/condaforge/linux-anvil-cos7-x86_64 # [linux64 and os.environ.get("BUILD_PLATFORM") == "linux-64" and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] diff --git a/tests/xgboost-feedstock/.ci_support/migrations/cuda_112_ppc64le_aarch64.yaml b/tests/xgboost-feedstock/.ci_support/migrations/cuda_112_ppc64le_aarch64.yaml new file mode 100644 index 0000000..1012567 --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/migrations/cuda_112_ppc64le_aarch64.yaml @@ -0,0 +1,47 @@ +migrator_ts: 1645421738 +__migrator: + kind: + version + migration_number: + 1 + build_number: + 1 + paused: false + override_cbc_keys: + - cuda_compiler_stub + operation: key_add + check_solvable: false + primary_key: cuda_compiler_version + wait_for_migrators: + - aarch64 and ppc64le addition + exclude_pinned_pkgs: False + commit_message: "Rebuild for cuda for ppc64le and aarch64" + +arm_variant_type: # [aarch64] + - sbsa # [aarch64] + +c_compiler_version: # [ppc64le or aarch64] + - 10 # [ppc64le or aarch64] +cxx_compiler_version: # [ppc64le or aarch64] + - 10 # [ppc64le or aarch64] +fortran_compiler_version: # [ppc64le or aarch64] + - 10 # [ppc64le or aarch64] + +cuda_compiler: # [ppc64le or aarch64] + - nvcc # [ppc64le or aarch64] +cuda_compiler_version: # [ppc64le or aarch64] + - 11.2 # [ppc64le or aarch64] + +cudnn: # [ppc64le or aarch64] + - 8 # [ppc64le or aarch64] + +cdt_name: # [ppc64le or aarch64] + - cos7 # [ppc64le or aarch64] + +docker_image: # [os.environ.get("BUILD_PLATFORM", "").startswith("linux") and (ppc64le or aarch64)] + # case: native compilation (build == target) + - quay.io/condaforge/linux-anvil-ppc64le-cuda:11.2 # [ppc64le and os.environ.get("BUILD_PLATFORM") == "linux-ppc64le"] + - quay.io/condaforge/linux-anvil-aarch64-cuda:11.2 # [aarch64 and os.environ.get("BUILD_PLATFORM") == "linux-aarch64"] + # case: cross-compilation (build != target) + - quay.io/condaforge/linux-anvil-cuda:11.2 # [ppc64le and os.environ.get("BUILD_PLATFORM") == "linux-64"] + - quay.io/condaforge/linux-anvil-cuda:11.2 # [aarch64 and os.environ.get("BUILD_PLATFORM") == "linux-64"] diff --git a/tests/xgboost-feedstock/.ci_support/migrations/python311.yaml b/tests/xgboost-feedstock/.ci_support/migrations/python311.yaml new file mode 100644 index 0000000..d23a0fd --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/migrations/python311.yaml @@ -0,0 +1,37 @@ +migrator_ts: 1666686085 +__migrator: + migration_number: 1 + operation: key_add + primary_key: python + ordering: + python: + - 3.6.* *_cpython + - 3.7.* *_cpython + - 3.8.* *_cpython + - 3.9.* *_cpython + - 3.10.* *_cpython + - 3.11.* *_cpython # new entry + - 3.6.* *_73_pypy + - 3.7.* *_73_pypy + - 3.8.* *_73_pypy + - 3.9.* *_73_pypy + paused: false + longterm: True + pr_limit: 10 + max_solver_attempts: 10 # this will make the bot retry "not solvable" stuff 10 times + exclude: + # this shouldn't attempt to modify the python feedstocks + - python + - pypy3.6 + - pypy-meta + - cross-python + - python_abi + exclude_pinned_pkgs: false + +python: + - 3.11.* *_cpython +# additional entries to add for zip_keys +numpy: + - 1.23 +python_impl: + - cpython diff --git a/tests/xgboost-feedstock/.ci_support/migrations/r_base43.yaml b/tests/xgboost-feedstock/.ci_support/migrations/r_base43.yaml new file mode 100644 index 0000000..ec19ef3 --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/migrations/r_base43.yaml @@ -0,0 +1,17 @@ +migrator_ts: 1682187595 +__migrator: + kind: version + migration_number: 1 + bump_number: 1 + operation: key_add + commit_message: "Rebuild for r-base 4.3" + primary_key: r_base + automerge: True + longterm: True + include_noarch: True + pr_limit: 40 + conda_forge_yml_patches: + provider.win_64: win_disabled + +r_base: + - 4.3 # [not win] diff --git a/tests/xgboost-feedstock/.ci_support/osx_64_.yaml b/tests/xgboost-feedstock/.ci_support/osx_64_.yaml new file mode 100644 index 0000000..4b03a97 --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/osx_64_.yaml @@ -0,0 +1,42 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.9' +c_compiler: +- clang +c_compiler_version: +- '15' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '15' +llvm_openmp: +- '15' +macos_machine: +- x86_64-apple-darwin13.4.0 +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.8.* *_cpython +- 3.9.* *_cpython +r_base: +- '4.2' +- '4.3' +target_platform: +- osx-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version diff --git a/tests/xgboost-feedstock/.ci_support/osx_arm64_.yaml b/tests/xgboost-feedstock/.ci_support/osx_arm64_.yaml new file mode 100644 index 0000000..c76b3ca --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/osx_arm64_.yaml @@ -0,0 +1,42 @@ +MACOSX_DEPLOYMENT_TARGET: +- '11.0' +c_compiler: +- clang +c_compiler_version: +- '15' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +cxx_compiler: +- clangxx +cxx_compiler_version: +- '15' +llvm_openmp: +- '15' +macos_machine: +- arm64-apple-darwin20.0.0 +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.8.* *_cpython +- 3.9.* *_cpython +r_base: +- '4.2' +- '4.3' +target_platform: +- osx-arm64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version diff --git a/tests/xgboost-feedstock/.ci_support/win_64_cuda_compilerNone.yaml b/tests/xgboost-feedstock/.ci_support/win_64_cuda_compilerNone.yaml new file mode 100644 index 0000000..399ceff --- /dev/null +++ b/tests/xgboost-feedstock/.ci_support/win_64_cuda_compilerNone.yaml @@ -0,0 +1,35 @@ +c_compiler: +- vs2019 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- None +cuda_compiler_version: +- None +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.8.* *_cpython +- 3.9.* *_cpython +r_base: +- '4.1' +target_platform: +- win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version diff --git a/tests/xgboost-feedstock/recipe/0001-Force-endian-flag-in-cross-compilation-mode.patch b/tests/xgboost-feedstock/recipe/0001-Force-endian-flag-in-cross-compilation-mode.patch new file mode 100644 index 0000000..95ffef7 --- /dev/null +++ b/tests/xgboost-feedstock/recipe/0001-Force-endian-flag-in-cross-compilation-mode.patch @@ -0,0 +1,55 @@ +From a764caad9e5120003a04d70e7b183f832d10d869 Mon Sep 17 00:00:00 2001 +From: "Uwe L. Korn" +Date: Thu, 16 Mar 2023 21:53:37 +0100 +Subject: [PATCH] Force endian flag in cross-compilation mode + +--- + R-package/configure | 32 +------------------------------- + 1 file changed, 1 insertion(+), 31 deletions(-) + +diff --git a/R-package/configure b/R-package/configure +index 6c157ca17..68ad4b367 100755 +--- a/R-package/configure ++++ b/R-package/configure +@@ -2792,37 +2792,7 @@ fi + + + ### Endian detection +-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking endian" >&5 +-printf %s "checking endian... " >&6; } +-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +-printf "%s\n" "" >&6; } +-if test "$cross_compiling" = yes +-then : +- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error $? "cannot run test program while cross compiling +-See \`config.log' for more details" "$LINENO" 5; } +-else $as_nop +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main (void) +-{ +-const uint16_t endianness = 256; return !!(*(const uint8_t *)&endianness); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_run "$LINENO" +-then : +- ENDIAN_FLAG="-DDMLC_CMAKE_LITTLE_ENDIAN=1" +-else $as_nop +- ENDIAN_FLAG="-DDMLC_CMAKE_LITTLE_ENDIAN=0" +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ +- conftest.$ac_objext conftest.beam conftest.$ac_ext +-fi ++ENDIAN_FLAG="-DDMLC_CMAKE_LITTLE_ENDIAN=1" + + + OPENMP_CXXFLAGS="" +-- +2.40.0 + diff --git a/tests/xgboost-feedstock/recipe/0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch b/tests/xgboost-feedstock/recipe/0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch new file mode 100644 index 0000000..4534c74 --- /dev/null +++ b/tests/xgboost-feedstock/recipe/0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch @@ -0,0 +1,16 @@ +diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py +index f7a7d9cd..70d73626 100644 +--- a/python-package/xgboost/libpath.py ++++ b/python-package/xgboost/libpath.py +@@ -29,7 +29,10 @@ def find_lib_path() -> List[str]: + # option. + os.path.join(sys.prefix, 'lib'), + ] +- ++ if sys.platform == 'win32': ++ dll_path = [os.path.join(sys.prefix, 'Library', 'mingw-w64', 'bin')] ++ else: ++ dll_path = [os.path.join(sys.prefix, 'lib')] + if sys.platform == 'win32': + if platform.architecture()[0] == '64bit': + dll_path.append( diff --git a/tests/xgboost-feedstock/recipe/bld.bat b/tests/xgboost-feedstock/recipe/bld.bat new file mode 100644 index 0000000..c0ace65 --- /dev/null +++ b/tests/xgboost-feedstock/recipe/bld.bat @@ -0,0 +1,15 @@ +mkdir "%SRC_DIR%"\build +pushd "%SRC_DIR%"\build + +cmake -G "Ninja" ^ + -DCMAKE_BUILD_TYPE:STRING="Release" ^ + -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^ + -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON ^ + -DR_LIB=OFF ^ + "%SRC_DIR%" +if errorlevel 1 exit 1 + +cmake --build . --target install --config Release +if errorlevel 1 exit 1 + +popd diff --git a/tests/xgboost-feedstock/recipe/build.sh b/tests/xgboost-feedstock/recipe/build.sh new file mode 100644 index 0000000..5fef5d6 --- /dev/null +++ b/tests/xgboost-feedstock/recipe/build.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -exuo pipefail + +mkdir -p build-target + +if [[ ${cuda_compiler_version} != "None" ]]; then + export CMAKE_ARGS="-DUSE_CUDA=ON -DUSE_NCCL=ON -DBUILD_WITH_SHARED_NCCL=ON ${CMAKE_ARGS}" +fi + +# Limit number of threads used to avoid hardware oversubscription +if [[ "${target_platform}" == "linux-aarch64" ]] || [[ "${target_platform}" == "linux-ppc64le" ]]; then + export CMAKE_BUILD_PARALLEL_LEVEL=6 +fi + +pushd build-target +cmake ${CMAKE_ARGS} \ + -GNinja \ + -DCMAKE_BUILD_TYPE:STRING="Release" \ + -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON \ + -DCMAKE_INSTALL_PREFIX:PATH="${PREFIX}" \ + "${SRC_DIR}" +cmake --build . --config Release +popd diff --git a/tests/xgboost-feedstock/recipe/install-libxgboost.sh b/tests/xgboost-feedstock/recipe/install-libxgboost.sh new file mode 100644 index 0000000..ad40319 --- /dev/null +++ b/tests/xgboost-feedstock/recipe/install-libxgboost.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +if [[ ${OSTYPE} == msys ]]; then + # Just for now; should we handle slash fixing in conda-build? + PREFIX=${PREFIX//\\//} + SRC_DIR=${SRC_DIR//\\//} +fi + +if [[ ${OSTYPE} == msys ]]; then + LIBDIR=${PREFIX}/Library/mingw-w64/lib + INCDIR=${PREFIX}/Library/mingw-w64/include + BINDIR=${PREFIX}/Library/mingw-w64/bin + SODIR=${BINDIR} + XGBOOSTDSO=xgboost.dll + EXEEXT=.exe +else + LIBDIR=${PREFIX}/lib + INCDIR=${PREFIX}/include + BINDIR=${PREFIX}/bin + SODIR=${LIBDIR} + if [[ $(uname) == Darwin ]]; then + XGBOOSTDSO=libxgboost.dylib + else + XGBOOSTDSO=libxgboost.so + fi + EXEEXT= +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/tests/xgboost-feedstock/recipe/install-py-xgboost.sh b/tests/xgboost-feedstock/recipe/install-py-xgboost.sh new file mode 100644 index 0000000..91e0866 --- /dev/null +++ b/tests/xgboost-feedstock/recipe/install-py-xgboost.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +pushd ${SRC_DIR}/python-package + ${PYTHON} setup.py install --use-system-libxgboost --single-version-externally-managed --record=record.txt +popd diff --git a/tests/xgboost-feedstock/recipe/install-r-xgboost.bat b/tests/xgboost-feedstock/recipe/install-r-xgboost.bat new file mode 100644 index 0000000..9a46957 --- /dev/null +++ b/tests/xgboost-feedstock/recipe/install-r-xgboost.bat @@ -0,0 +1,16 @@ +@echo on +mkdir "%SRC_DIR%"\build-r +pushd "%SRC_DIR%"\build-r + +cmake -G "Ninja" ^ + -DCMAKE_BUILD_TYPE:STRING="Release" ^ + -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^ + -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON ^ + -DR_LIB=ON ^ + "%SRC_DIR%" +if errorlevel 1 exit 1 + +cmake --build . --target install --config Release +if errorlevel 1 exit 1 + +popd diff --git a/tests/xgboost-feedstock/recipe/install-r-xgboost.sh b/tests/xgboost-feedstock/recipe/install-r-xgboost.sh new file mode 100644 index 0000000..07651ce --- /dev/null +++ b/tests/xgboost-feedstock/recipe/install-r-xgboost.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +pushd ${SRC_DIR}/R-package + # Remove src/Makevars.win because it says: + # This file is only used for windows compilation from github + # It will be replaced with Makevars.in for the CRAN version + # rm src/Makevars.win + ${R} CMD INSTALL --preclean --build . ${R_ARGS} +popd diff --git a/tests/xgboost-feedstock/recipe/install-win-wrapper.bat b/tests/xgboost-feedstock/recipe/install-win-wrapper.bat new file mode 100644 index 0000000..b477285 --- /dev/null +++ b/tests/xgboost-feedstock/recipe/install-win-wrapper.bat @@ -0,0 +1,13 @@ +copy "%RECIPE_DIR%\install-%PKG_NAME%.sh" . +if %errorlevel% neq 0 exit /b %errorlevel% + +set PREFIX=%PREFIX:\=/% +set SRC_DIR=%SRC_DIR:\=/% +set MSYSTEM=MINGW%ARCH% +set MSYS2_PATH_TYPE=inherit +set CHERE_INVOKING=1 + +bash -lc "./install-%PKG_NAME%.sh" +if %errorlevel% neq 0 exit /b %errorlevel% + +exit /b 0 \ No newline at end of file diff --git a/tests/xgboost-feedstock/recipe/meta.yaml b/tests/xgboost-feedstock/recipe/meta.yaml new file mode 100644 index 0000000..a22bc93 --- /dev/null +++ b/tests/xgboost-feedstock/recipe/meta.yaml @@ -0,0 +1,236 @@ +{% set name = "xgboost" %} +{% set version = "1.7.6" %} +{% set build_number = "0" %} + +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 }} + patches: + # xgboost patches + - 0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch + - 0001-Force-endian-flag-in-cross-compilation-mode.patch # [arm64 or aarch64 or ppc64le] + +build: + number: {{ build_number }} + skip: true # [win and cuda_compiler != "None"] + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - {{ compiler('cuda') }} # [cuda_compiler != "None"] + - git # [not win] + - m2-git # [win] + - cmake + - llvm-openmp # [osx] + - libgomp # [linux] + - ninja + host: + - nccl # [linux and cuda_compiler != "None"] + +outputs: + - name: libxgboost + script: install-libxgboost.sh # [not win] + script: install-win-wrapper.bat # [win] + build: + activate_in_script: True + string: cuda{{ cuda_compiler_version | replace('.', '') }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"] + string: cpu_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"] + ignore_run_exports_from: + - {{ compiler('cuda') }} # [(cuda_compiler_version or "").startswith("11")] + requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - {{ compiler('cuda') }} # [cuda_compiler != "None"] + - git + - cmake + - make + - llvm-openmp # [osx] + - libgomp # [linux] + host: + - nccl # [linux and cuda_compiler != "None"] + run: + - cuda-version >=11.2,<12 # [(cuda_compiler_version or "").startswith("11")] + - __cuda # [cuda_compiler != "None"] + + - name: _py-xgboost-mutex + version: 2.0 + build: + string: cpu_0 # [cuda_compiler == "None"] + string: gpu_0 # [cuda_compiler != "None"] + + - name: py-xgboost + script: install-py-xgboost.sh # [not win] + script: install-win-wrapper.bat # [win] + build: + string: cuda{{ cuda_compiler_version | replace('.', '') }}py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"] + string: cpu_py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"] + requirements: + build: + - python # [build_platform != target_platform] + - cross-python_{{ target_platform }} # [build_platform != target_platform] + host: + - {{ pin_subpackage('libxgboost', exact=True) }} + - python + - setuptools + - pip + run: + - {{ pin_subpackage('libxgboost', exact=True) }} + - {{ pin_subpackage('_py-xgboost-mutex', exact=True) }} + - python + - numpy + - scipy + - scikit-learn + - __cuda # [cuda_compiler != "None"] + test: + script: test-py-xgboost.py + imports: + - xgboost + + - name: py-xgboost-cpu + build: + skip: true # [cuda_compiler != "None"] + requirements: + host: + - python + - {{ pin_subpackage('py-xgboost', exact=True) }} + run: + - python + - {{ pin_subpackage('py-xgboost', exact=True) }} + + - name: py-xgboost-gpu + build: + skip: true # [cuda_compiler == "None"] + requirements: + host: + - python + - {{ pin_subpackage('py-xgboost', exact=True) }} + run: + - python + - {{ pin_subpackage('py-xgboost', exact=True) }} + - __cuda # [cuda_compiler != "None"] + + + - name: xgboost + build: + string: cuda{{ cuda_compiler_version | replace('.', '') }}py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"] + string: cpu_py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"] + requirements: + host: + - python + run: + - python + - {{ pin_subpackage('py-xgboost', exact=True) }} + - __cuda # [cuda_compiler != "None"] + + - name: _r-xgboost-mutex + version: 2.0 + build: + string: cpu_0 # [cuda_compiler == "None"] + string: gpu_0 # [cuda_compiler != "None"] + + - name: r-xgboost + script: install-r-xgboost.sh # [not win] + script: install-r-xgboost.bat # [win] + build: + string: cuda{{ cuda_compiler_version | replace('.', '') }}_r{{ r_base | replace('.', '') }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"] + string: cpu_r{{ r_base | replace('.', '') }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"] + rpaths: + - lib/R/lib + requirements: + build: + - {{ compiler('m2w64_c') }} # [win] + - {{ compiler('m2w64_cxx') }} # [win] + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - llvm-openmp # [osx] + - libgomp # [linux] + - git + - make # [not win] + - posix # [win] + - cmake + - ninja + - cross-r-base {{ r_base }} # [build_platform != target_platform] + - r-base # [build_platform != target_platform] + - r-matrix # [build_platform != target_platform] + - r-data.table # [build_platform != target_platform] + - r-magrittr # [build_platform != target_platform] + - r-jsonlite # [build_platform != target_platform] + - r-knitr # [build_platform != target_platform] + host: + - {{ pin_subpackage('libxgboost', exact=True) }} + - r-base + - r-matrix + - r-data.table + - r-magrittr + - r-jsonlite + - r-knitr + run: + - {{ pin_subpackage('libxgboost', exact=True) }} + - {{ pin_subpackage('_r-xgboost-mutex', exact=True) }} + - r-base + - r-matrix + - r-data.table + - r-magrittr + - r-jsonlite + - __cuda # [cuda_compiler != "None"] + test: + files: + - test-r-xgboost.r + commands: + - Rscript test-r-xgboost.r + + - name: r-xgboost-cpu + build: + skip: true # [cuda_compiler != "None"] + requirements: + host: + - r-base + run: + - r-base + - {{ pin_subpackage('r-xgboost', exact=True) }} + + - name: r-xgboost-gpu + build: + skip: true # [cuda_compiler == "None"] + requirements: + host: + - r-base + run: + - r-base + - {{ pin_subpackage('r-xgboost', exact=True) }} + - __cuda # [cuda_compiler != "None"] + +about: + home: https://github.com/dmlc/xgboost + license: Apache-2.0 + license_file: LICENSE + summary: | + Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library, for + Python, R, Java, Scala, C++ and more. Runs on single machine, Hadoop, Spark, Flink + and DataFlow + description: | + XGBoost is an optimized distributed gradient boosting library designed to be highly efficient, + flexible and portable. It implements machine learning algorithms under the Gradient Boosting + framework. XGBoost provides a parallel tree boosting (also known as GBDT, GBM) that solve many + data science problems in a fast and accurate way. The same code runs on major distributed + environment (Hadoop, SGE, MPI) and can solve problems beyond billions of examples. + doc_url: https://xgboost.readthedocs.io/ + dev_url: https://github.com/dmlc/xgboost/ + +extra: + feedstock-name: xgboost + recipe-maintainers: + - aldanor + - fhoehle + - jakirkham + - ksangeek + - xhochy + - mfansler diff --git a/tests/xgboost-feedstock/recipe/test-py-xgboost.py b/tests/xgboost-feedstock/recipe/test-py-xgboost.py new file mode 100644 index 0000000..6eb1f2d --- /dev/null +++ b/tests/xgboost-feedstock/recipe/test-py-xgboost.py @@ -0,0 +1,28 @@ +""" +A simple test for xgboost based on scikit-learn. + +Note that xgboost's internal tests are NOT shipped with their +python package on PyPI. Hence our own test is rolled here. +""" +import xgboost +import sklearn.datasets +import sklearn.model_selection +import sklearn.metrics + +X, y = sklearn.datasets.load_iris(return_X_y=True) +Xtrn, Xtst, ytrn, ytst = sklearn.model_selection.train_test_split( + X, y, train_size=0.8, random_state=4) + +clf = xgboost.XGBClassifier( + max_depth=2, + learning_rate=1, + n_estimators=10, + silent=True, + objective='multi:softmax', + seed=5) +clf.fit(Xtrn, ytrn) +ypred = clf.predict(Xtst) +acc = sklearn.metrics.accuracy_score(ytst, ypred) + +print('xgboost accuracy on iris:', acc) +assert acc > 0.9 diff --git a/tests/xgboost-feedstock/recipe/test-r-xgboost.r b/tests/xgboost-feedstock/recipe/test-r-xgboost.r new file mode 100644 index 0000000..96285c9 --- /dev/null +++ b/tests/xgboost-feedstock/recipe/test-r-xgboost.r @@ -0,0 +1,30 @@ +# Taken from: https://github.com/dmlc/xgboost/blob/master/R-package/vignettes/xgboostPresentation.Rmd + +require(xgboost) +data(agaricus.train, package='xgboost') +data(agaricus.test, package='xgboost') +train <- agaricus.train +test <- agaricus.test +str(train) +dim(train$data) +dim(test$data) +class(train$data)[1] +class(train$label) + +bstSparse <- xgboost(data = train$data, label = train$label, max_depth = 2, eta = 1, nthread = 2, nrounds = 2, objective = "binary:logistic") +bstDense <- xgboost(data = as.matrix(train$data), label = train$label, max_depth = 2, eta = 1, nthread = 2, nrounds = 2, objective = "binary:logistic") +dtrain <- xgb.DMatrix(data = train$data, label = train$label) +bstDMatrix <- xgboost(data = dtrain, max_depth = 2, eta = 1, nthread = 2, nrounds = 2, objective = "binary:logistic") +bst <- xgboost(data = dtrain, max_depth = 2, eta = 1, nthread = 2, nrounds = 2, objective = "binary:logistic", verbose = 2) +pred <- predict(bst, test$data) +print(length(pred)) +print(head(pred)) +prediction <- as.numeric(pred > 0.5) +print(head(prediction)) +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")