Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create conda package of patched dependencies #275

Merged
Merged
30 changes: 30 additions & 0 deletions conda/recipes/rapids_core_dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
cmake_minimum_required(VERSION 3.23.1)

project(rapids-dependencies LANGUAGES CXX)

set(rapids-cmake-dir "${PROJECT_SOURCE_DIR}/../../../rapids-cmake/")

include(${rapids-cmake-dir}/cpm/init.cmake)
rapids_cpm_init()

# Download all source packages
include(${rapids-cmake-dir}/cpm/libcudacxx.cmake)
include(${rapids-cmake-dir}/cpm/thrust.cmake)
set(CPM_DOWNLOAD_ALL "ON")
rapids_cpm_libcudacxx(INSTALL_EXPORT_SET rapids-dependencies)
rapids_cpm_thrust(NAMESPACE temp INSTALL_EXPORT_SET rapids-dependencies)
26 changes: 26 additions & 0 deletions conda/recipes/rapids_core_dependencies/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2022, NVIDIA CORPORATION.

# Script assumes the script is executed from the root of the repo directory

REPO_DIR=$(cd $(dirname $0); pwd)

SOURCE_DIR=${REPO_DIR}/conda/recipes/rapids_core_dependencies
BUILD_DIR=${BUILD_DIR:=${REPO_DIR}/build}

INSTALL_PREFIX=${INSTALL_PREFIX:=${PREFIX:=${CONDA_PREFIX:=$BUILD_DIR/install}}}
export PARALLEL_LEVEL=${PARALLEL_LEVEL:-4}

# If the dir to clean is a mounted dir in a container, the
# contents should be removed but the mounted dirs will remain.
# The find removes all contents but leaves the dirs, the rmdir
# attempts to remove the dirs but can fail safely.
if [ -d "${BUILD_DIR}" ]; then
find "${BUILD_DIR}" -mindepth 1 -delete
rmdir "${BUILD_DIR}" || true
fi

cmake -S "${SOURCE_DIR}" -B "${BUILD_DIR}" \
-DCMAKE_INSTALL_LIBDIR="lib" \
-DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
cmake --build "${BUILD_DIR}" --target install -j${PARALLEL_LEVEL}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cxx_compiler_version:
- 9

cuda_compiler:
- nvcc

sysroot_version:
- "2.17"
40 changes: 40 additions & 0 deletions conda/recipes/rapids_core_dependencies/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) 2022, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
robertmaynard marked this conversation as resolved.
Show resolved Hide resolved
{% set cuda_version = '.'.join(environ.get('CUDA', '11.5').split('.')[:2]) %}
{% set cuda_major=cuda_version.split('.')[0] %}

package:
name: rapids_core_dependencies
version: {{ version }}

source:
git_url: ../../..

build:
number: {{ GIT_DESCRIBE_NUMBER }}
robertmaynard marked this conversation as resolved.
Show resolved Hide resolved
string: cuda{{ cuda_major }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
script_env:
- VERSION_SUFFIX
ignore_run_exports_from:
- {{ compiler('cuda') }}

requirements:
build:
- cmake>=3.23.1
- {{ compiler('cxx') }}
- {{ compiler('cuda') }} {{ cuda_version }}
- sysroot_{{ target_platform }} {{ sysroot_version }}
host:
- cudatoolkit {{ cuda_version }}.*

about:
home: https://rapids.ai/
license: Apache-2.0
license_family: Apache
license_file: LICENSE
summary: RAPIDS patched CUDA dependencies
description: |
A subset of RAPIDS CUDA/C++ dependencies that need
to be packaged with custom C++ header locations to
avoid compiler issues.