diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index 3326beb9..cae45cd8 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -126,7 +126,6 @@ jobs: microsoft-edge-stable sudo apt-get autoremove -y >& /dev/null sudo apt-get autoclean -y >& /dev/null - sudo docker image prune --all --force df -h displayName: Manage disk space # configure qemu binfmt-misc running. This allows us to run docker containers @@ -139,6 +138,9 @@ jobs: - script: | export CI=azure + export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) + export remote_url=$(Build.Repository.Uri) + export sha=$(Build.SourceVersion) export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 95dcd565..20ae797c 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -8,6 +8,18 @@ jobs: vmImage: windows-2022 strategy: matrix: + win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.10.____cpython: + CONFIG: win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.10.____cpython + UPLOAD_PACKAGES: 'True' + win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.11.____cpython: + CONFIG: win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.11.____cpython + UPLOAD_PACKAGES: 'True' + win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.8.____cpython: + CONFIG: win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.8.____cpython + UPLOAD_PACKAGES: 'True' + win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.9.____cpython: + CONFIG: win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.9.____cpython + UPLOAD_PACKAGES: 'True' win_64_cuda_compilernvcccuda_compiler_version11.8python3.10.____cpython: CONFIG: win_64_cuda_compilernvcccuda_compiler_version11.8python3.10.____cpython UPLOAD_PACKAGES: 'True' @@ -51,6 +63,9 @@ jobs: PYTHONUNBUFFERED: 1 CONFIG: $(CONFIG) CI: azure + flow_run_id: azure_$(Build.BuildNumber).$(System.JobAttempt) + remote_url: $(Build.Repository.Uri) + sha: $(Build.SourceVersion) UPLOAD_PACKAGES: $(UPLOAD_PACKAGES) UPLOAD_TEMP: $(UPLOAD_TEMP) BINSTAR_TOKEN: $(BINSTAR_TOKEN) diff --git a/.ci_support/migrations/cuda120.yaml b/.ci_support/migrations/cuda120.yaml index 49da33d7..abfb9cb8 100644 --- a/.ci_support/migrations/cuda120.yaml +++ b/.ci_support/migrations/cuda120.yaml @@ -3,7 +3,7 @@ __migrator: kind: version migration_number: - 2 + 3 build_number: 1 paused: false @@ -47,13 +47,13 @@ __migrator: - 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 # [(linux or win) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] - - 12.0 # [(linux or win) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 10.2 # [(linux64 or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 11.0 # [(linux64 or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 11.1 # [(linux64 or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 11.2 # [(linux or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 12.0 # [(linux or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] commit_message: | - Rebuild for CUDA 12 w/arch support + Rebuild for CUDA 12 w/arch + Windows support 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 @@ -62,11 +62,11 @@ __migrator: [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: # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] - - cuda-nvcc # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] +cuda_compiler: # [(linux or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - cuda-nvcc # [(linux or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] -cuda_compiler_version: # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] - - 12.0 # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] +cuda_compiler_version: # [(linux or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] + - 12.0 # [(linux or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] c_compiler_version: # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] - 12 # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] diff --git a/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.10.____cpython.yaml b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.10.____cpython.yaml new file mode 100644 index 00000000..81400db9 --- /dev/null +++ b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.10.____cpython.yaml @@ -0,0 +1,27 @@ +c_compiler: +- vs2017 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cudnn: +- '8' +cutensor: +- '1' +cxx_compiler: +- vs2017 +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +target_platform: +- win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version diff --git a/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.11.____cpython.yaml b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.11.____cpython.yaml new file mode 100644 index 00000000..7934b19f --- /dev/null +++ b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.11.____cpython.yaml @@ -0,0 +1,27 @@ +c_compiler: +- vs2017 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cudnn: +- '8' +cutensor: +- '1' +cxx_compiler: +- vs2017 +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +target_platform: +- win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version diff --git a/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.8.____cpython.yaml b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.8.____cpython.yaml new file mode 100644 index 00000000..5887d119 --- /dev/null +++ b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.8.____cpython.yaml @@ -0,0 +1,27 @@ +c_compiler: +- vs2017 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cudnn: +- '8' +cutensor: +- '1' +cxx_compiler: +- vs2017 +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.8.* *_cpython +target_platform: +- win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version diff --git a/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.9.____cpython.yaml b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.9.____cpython.yaml new file mode 100644 index 00000000..79e1fe83 --- /dev/null +++ b/.ci_support/win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.9.____cpython.yaml @@ -0,0 +1,27 @@ +c_compiler: +- vs2017 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cuda_compiler: +- cuda-nvcc +cuda_compiler_version: +- '12.0' +cudnn: +- '8' +cutensor: +- '1' +cxx_compiler: +- vs2017 +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +target_platform: +- win-64 +zip_keys: +- - cuda_compiler + - cuda_compiler_version diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index d0fc82af..aea08d45 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -28,13 +28,15 @@ conda-build: pkgs_dirs: - ${FEEDSTOCK_ROOT}/build_artifacts/pkg_cache - /opt/conda/pkgs +solver: libmamba CONDARC +export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 mamba install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build boa conda-forge-ci-setup=3 + pip mamba conda-build conda-forge-ci-setup=4 mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build boa conda-forge-ci-setup + pip mamba conda-build conda-forge-ci-setup=4 # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -54,6 +56,12 @@ if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then cp "${FEEDSTOCK_ROOT}/LICENSE.txt" "${RECIPE_ROOT}/recipe-scripts-license.txt" fi +if [[ "${sha:-}" == "" ]]; then + pushd ${FEEDSTOCK_ROOT} + sha=$(git rev-parse HEAD) + popd +fi + if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" @@ -65,9 +73,10 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then # Drop into an interactive shell /bin/bash else - conda mambabuild "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + conda build "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ - --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \ + --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" ( startgroup "Validating outputs" ) 2> /dev/null validate_recipe_outputs "${FEEDSTOCK_NAME}" diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 92362398..b70ef014 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -91,6 +91,9 @@ docker run ${DOCKER_RUN_ARGS} \ -e CPU_COUNT \ -e BUILD_WITH_CONDA_DEBUG \ -e BUILD_OUTPUT_ID \ + -e flow_run_id \ + -e remote_url \ + -e sha \ -e BINSTAR_TOKEN \ -e FEEDSTOCK_TOKEN \ -e STAGING_BINSTAR_TOKEN \ diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat index 07d34456..5b2b8492 100755 --- a/.scripts/run_win_build.bat +++ b/.scripts/run_win_build.bat @@ -17,10 +17,14 @@ call :start_group "Configuring conda" :: Activate the base conda environment call activate base +:: Configure the solver +set "CONDA_SOLVER=libmamba" +if !errorlevel! neq 0 exit /b !errorlevel! +set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1" :: Provision the necessary dependencies to build the recipe later echo Installing dependencies -mamba.exe install "python=3.10" pip mamba conda-build boa conda-forge-ci-setup=3 -c conda-forge --strict-channel-priority --yes +mamba.exe install "python=3.10" pip mamba conda-build conda-forge-ci-setup=4 -c conda-forge --strict-channel-priority --yes if !errorlevel! neq 0 exit /b !errorlevel! :: Set basic configuration @@ -41,11 +45,15 @@ if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] ( set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test" ) +if NOT [%flow_run_id%] == [] ( + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --extra-meta flow_run_id=%flow_run_id% remote_url=%remote_url% sha=%sha%" +) + call :end_group :: Build the recipe echo Building recipe -conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% +conda.exe build "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% if !errorlevel! neq 0 exit /b !errorlevel! :: Prepare some environment variables for the upload step diff --git a/README.md b/README.md index 746b3931..fc7ee1d3 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,34 @@ Current build status variant + + win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.10.____cpython + + + variant + + + + win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.11.____cpython + + + variant + + + + win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.8.____cpython + + + variant + + + + win_64_cuda_compilercuda-nvcccuda_compiler_version12.0python3.9.____cpython + + + variant + + win_64_cuda_compilernvcccuda_compiler_version11.8python3.10.____cpython @@ -308,7 +336,7 @@ available continuous integration services. Thanks to the awesome service provide [CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/), [Drone](https://cloud.drone.io/welcome), and [TravisCI](https://travis-ci.com/) it is possible to build and upload installable packages to the -[conda-forge](https://anaconda.org/conda-forge) [Anaconda-Cloud](https://anaconda.org/) +[conda-forge](https://anaconda.org/conda-forge) [anaconda.org](https://anaconda.org/) channel for Linux, Windows and OSX respectively. To manage the continuous integration and simplify feedstock maintenance diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 77845f62..efd80af7 100755 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -21,13 +21,12 @@ source: - url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz sha256: {{ sha256 }} patches: - - support_new_cuda_layout.diff # [(linux and (cuda_compiler_version or "").startswith("12")) or (build_platform != target_platform)] + - support_new_cuda_layout.diff # [((linux or win64) and (cuda_compiler_version or "").startswith("12")) or (build_platform != target_platform)] - support_nvtx3_win.diff # [win64] build: - number: 3 - # TODO: turn on win64 + CUDA 12 once it's ready - skip: true # [cuda_compiler_version not in ("11.8", "12.0") or (cuda_compiler_version == "12.0" and win64)] + number: 4 + skip: true # [cuda_compiler_version not in ("11.8", "12.0")] script: # CuPy default detects CUDA from nvcc, but on Conda-Forge's dockers nvcc lives in a different place... # With conda-forge/nvcc-feedstock#58, CUDA_PATH is set correctly @@ -90,7 +89,7 @@ requirements: - cython >=0.29.22,<3 # [build_platform != target_platform] # TODO: clean up {% if cuda_major >= 12 %} - - cuda-driver-dev # [build_platform != target_platform] + - cuda-driver-dev # [linux and build_platform != target_platform] - cuda-cudart-dev # [build_platform != target_platform] - cuda-nvrtc-dev # [build_platform != target_platform] - cuda-nvtx-dev # [build_platform != target_platform] @@ -118,7 +117,7 @@ requirements: - nvtx-c # [win64] # TODO: clean up {% if cuda_major >= 12 %} - - cuda-driver-dev + - cuda-driver-dev # [linux] - cuda-cudart-dev - cuda-nvrtc-dev - cuda-nvtx-dev @@ -161,7 +160,7 @@ requirements: test: requires: # need the libcuda stub for import test - - cuda-driver-dev # [(cuda_compiler_version or "").startswith("12")] + - cuda-driver-dev # [linux and (cuda_compiler_version or "").startswith("12")] source_files: - tests diff --git a/recipe/support_new_cuda_layout.diff b/recipe/support_new_cuda_layout.diff index 4179d91b..7974159a 100644 --- a/recipe/support_new_cuda_layout.diff +++ b/recipe/support_new_cuda_layout.diff @@ -1,16 +1,19 @@ diff --git a/install/cupy_builder/cupy_setup_build.py b/install/cupy_builder/cupy_setup_build.py -index 8023e46ad..4349ebe05 100644 +index 8023e46ad..466f7152f 100644 --- a/install/cupy_builder/cupy_setup_build.py +++ b/install/cupy_builder/cupy_setup_build.py -@@ -5,6 +5,7 @@ from distutils import ccompiler +@@ -3,8 +3,10 @@ + import copy + from distutils import ccompiler from distutils import sysconfig ++import logging import os import shutil +import subprocess import sys import setuptools -@@ -294,16 +295,36 @@ def make_extensions(ctx: Context, compiler, use_cython): +@@ -294,16 +296,39 @@ def make_extensions(ctx: Context, compiler, use_cython): # deprecated since ROCm 4.2.0 settings['define_macros'].append(('__HIP_PLATFORM_HCC__', '1')) @@ -26,19 +29,22 @@ index 8023e46ad..4349ebe05 100644 - 'Please check above error log.') + try: + host_compiler = compiler -+ if os.environ.get('CONDA_BUILD_CROSS_COMPILATION'): ++ if int(os.environ.get('CONDA_BUILD_CROSS_COMPILATION', 0)) == 1: + os.symlink(f'{os.environ["BUILD_PREFIX"]}/x86_64-conda-linux-gnu/bin/x86_64-conda-linux-gnu-ld', + f'{os.environ["BUILD_PREFIX"]}/bin/ld') -+ if os.environ.get('CONDA_BUILD_CROSS_COMPILATION') or os.environ.get('CONDA_OVERRIDE_CUDA', '0').startswith('12'): ++ if int(os.environ.get('CONDA_BUILD_CROSS_COMPILATION', 0)) == 1 or os.environ.get('CONDA_OVERRIDE_CUDA', '0').startswith('12'): + # If cross-compiling, we need build_and_run() & build_shlib() to use the compiler + # on the build platform to generate stub files that are executable in the build + # environment, not the target environment. ++ logging.debug("creating a new compiler instance...") + compiler = ccompiler.new_compiler() -+ compiler.compiler = [os.environ['CC_FOR_BUILD'],] -+ compiler.compiler_cxx = [os.environ['CXX_FOR_BUILD'],] -+ compiler.compiler_so = [os.environ['CC_FOR_BUILD'],] -+ compiler.linker_exe = [os.environ['CC_FOR_BUILD'], f'-B{os.environ["BUILD_PREFIX"]}/bin'] -+ compiler.linker_so = [os.environ['CC_FOR_BUILD'], f'-B{os.environ["BUILD_PREFIX"]}/bin', '-shared'] ++ cc = os.environ['CC_FOR_BUILD'] if PLATFORM_LINUX else os.environ['CC'] ++ cxx = os.environ['CXX_FOR_BUILD'] if PLATFORM_LINUX else os.environ['CXX'] ++ compiler.compiler = [cc,] ++ compiler.compiler_cxx = [cxx,] ++ compiler.compiler_so = [cc,] ++ compiler.linker_exe = [cc, f'-B{os.environ["BUILD_PREFIX"]}/bin'] ++ compiler.linker_so = [cc, f'-B{os.environ["BUILD_PREFIX"]}/bin', '-shared'] + + available_modules = [] + if no_cuda: @@ -52,13 +58,13 @@ index 8023e46ad..4349ebe05 100644 + 'Please check above error log.') + finally: + compiler = host_compiler -+ if os.environ.get('CONDA_BUILD_CROSS_COMPILATION'): ++ if int(os.environ.get('CONDA_BUILD_CROSS_COMPILATION', 0)) == 1: + os.remove(f'{os.environ["BUILD_PREFIX"]}/bin/ld') ret = [] for module in MODULES: diff --git a/install/cupy_builder/install_build.py b/install/cupy_builder/install_build.py -index d0317e324..759d27157 100644 +index d0317e324..210bf46f7 100644 --- a/install/cupy_builder/install_build.py +++ b/install/cupy_builder/install_build.py @@ -1,7 +1,9 @@ @@ -81,7 +87,21 @@ index d0317e324..759d27157 100644 PLATFORM_LINUX = sys.platform.startswith('linux') PLATFORM_WIN32 = sys.platform.startswith('win32') -@@ -689,9 +694,59 @@ def get_cusparselt_version(formatted=False): +@@ -188,6 +193,13 @@ def get_compiler_setting(ctx: Context, use_hip): + cuda_cub_path = None + else: + cuda_cub_path = None ++ ++ if cuda_cub_path is None: ++ if int(os.environ.get('CONDA_BUILD', 0)) == 1 and PLATFORM_WIN32: ++ cuda_cub_path = os.path.join(os.environ['BUILD_PREFIX'], 'Library', 'include', 'targets', 'x64', 'cub') ++ if not os.path.exists(cuda_cub_path): ++ cuda_cub_path = None ++ + global _cub_path + if cuda_cub_path: + _cub_path = cuda_cub_path +@@ -689,9 +701,69 @@ def get_cusparselt_version(formatted=False): return _cusparselt_version @@ -93,8 +113,10 @@ index d0317e324..759d27157 100644 + out = "sbsa-linux" + else: + out = f"{plat}-linux" ++ elif PLATFORM_WIN32: ++ out = 'x64' + else: -+ raise NotImplementedError ++ assert False + logging.debug(f"{out=}") + return out + @@ -106,7 +128,7 @@ index d0317e324..759d27157 100644 + include_dirs = list(include_dirs) + library_dirs = list(library_dirs) + -+ if os.environ.get('CONDA_BUILD_CROSS_COMPILATION'): ++ if int(os.environ.get('CONDA_BUILD_CROSS_COMPILATION', 0)) == 1: + # If we're cross compiling, we need to generate stub files that are + # executable in the build environment, not the target environment. + # This assumes, however, that the build/host environments see the same @@ -124,11 +146,18 @@ index d0317e324..759d27157 100644 + library_dirs.append(f'{os.environ["BUILD_PREFIX"]}/lib') + + if os.environ.get('CONDA_OVERRIDE_CUDA', '0').startswith('12'): -+ include_dirs.append(f'{os.environ["BUILD_PREFIX"]}/targets/{conda_get_target_name()}/include') # for crt headers -+ library_dirs.append(f'{os.environ["PREFIX"]}/lib/stubs') -+ # for optional dependencies -+ include_dirs.append(f'{os.environ["PREFIX"]}/include') -+ library_dirs.append(f'{os.environ["PREFIX"]}/lib') ++ if PLATFORM_LINUX: ++ include_dirs.append(f'{os.environ["BUILD_PREFIX"]}/targets/{conda_get_target_name()}/include') # for crt headers ++ library_dirs.append(f'{os.environ["PREFIX"]}/lib/stubs') ++ # for optional dependencies ++ include_dirs.append(f'{os.environ["PREFIX"]}/include') ++ library_dirs.append(f'{os.environ["PREFIX"]}/lib') ++ else: ++ include_dirs.append(f'{os.environ["BUILD_PREFIX"]}/Library/include/targets/{conda_get_target_name()}') # for CCCL headers ++ # there seems to be no stubs for windows ++ # for optional dependencies ++ include_dirs.append(f'{os.environ["LIBRARY_INC"]}') # $PREFIX/Library/include ++ library_dirs.append(f'{os.environ["LIBRARY_LIB"]}') # $PREFIX/Library/lib + + return include_dirs, library_dirs + @@ -137,15 +166,17 @@ index d0317e324..759d27157 100644 include_dirs=(), library_dirs=(), define_macros=None, extra_compile_args=()): + include_dirs, library_dirs = conda_update_dirs(include_dirs, library_dirs) ++ logging.debug(include_dirs) + with _tempdir() as temp_dir: fname = os.path.join(temp_dir, 'a.cpp') with open(fname, 'w') as f: -@@ -717,6 +772,8 @@ def build_shlib(compiler, source, libraries=(), +@@ -717,6 +789,9 @@ def build_shlib(compiler, source, libraries=(), def build_and_run(compiler, source, libraries=(), include_dirs=(), library_dirs=(), define_macros=None, extra_compile_args=()): + include_dirs, library_dirs = conda_update_dirs(include_dirs, library_dirs) ++ logging.debug(include_dirs) + with _tempdir() as temp_dir: fname = os.path.join(temp_dir, 'a.cpp')