Skip to content

Commit

Permalink
BLD Add conda build script
Browse files Browse the repository at this point in the history
  • Loading branch information
raydouglass committed Jan 11, 2019
1 parent b91a6bc commit 2efced5
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
25 changes: 25 additions & 0 deletions conda/recipes/cugraph/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

CMAKE_COMMON_VARIABLES="-DNVG_PLUGIN=TRUE -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Release"


if [ -n "$MACOSX_DEPLOYMENT_TARGET" ]; then
# C++11 requires 10.9
# but cudatoolkit 8 is build for 10.11
export MACOSX_DEPLOYMENT_TARGET=10.11
fi

# show environment
printenv
# Cleanup local git
git clean -xdf
# Use CMake-based build procedure
mkdir build
cd build
# configure
cmake $CMAKE_COMMON_VARIABLES ..
# build
make -j VERBOSE=1 install

cd ..
python setup.py install
35 changes: 35 additions & 0 deletions conda/recipes/cugraph/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2018, NVIDIA CORPORATION.

# Usage:
# conda build -c defaults -c conda-forge .
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set git_revision_count=environ.get('GIT_DESCRIBE_NUMBER', 0) %}
{% set cuda_version='.'.join(environ.get('CUDA_VERSION', 'unknown').split('.')[:2]) %}
{% set py_version=environ.get('CONDA_PY', 35) %}
package:
name: cugraph
version: {{ version }}

source:
path: ../../..

build:
number: {{ git_revision_count }}
string: cuda{{ cuda_version }}_py{{ py_version }}_{{ git_revision_count }}

requirements:
build:
- cmake 3.12.4
- python
- cython=0.28.*
- nvgraph {{ version }}
run:
- python
- cython=0.28.*
- nvgraph {{ version }}

about:
home: http://rapids.ai/
license: Apache 2.0
license_file: LICENSE
summary: cugraph Library
34 changes: 34 additions & 0 deletions conda_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
set -xe

conda install conda-build anaconda-client conda-verify -y
conda build -c nvidia -c rapidsai -c conda-forge -c defaults --python=${PYTHON} conda/recipes/cugraph

if [ "$UPLOAD_PACKAGE" == '1' ]; then
export UPLOADFILE=`conda build -c nvidia -c rapidsai -c conda-forge -c defaults --python=${PYTHON} conda/recipes/cugraph --output`
SOURCE_BRANCH=master

test -e ${UPLOADFILE}
CUDA_REL=${CUDA:0:3}
if [ "${CUDA:0:2}" == '10' ]; then
# CUDA 10 release
CUDA_REL=${CUDA:0:4}
fi

LABEL_OPTION="--label dev --label cuda${CUDA_REL}"
if [ "${LABEL_MAIN}" == '1' ]; then
LABEL_OPTION="--label main --label cuda${CUDA_REL}"
fi
echo "LABEL_OPTION=${LABEL_OPTION}"

if [ -z "$MY_UPLOAD_KEY" ]; then
echo "No upload key"
return 0
fi

echo "Upload"
echo ${UPLOADFILE}
anaconda -t ${MY_UPLOAD_KEY} upload -u nvidia ${LABEL_OPTION} --force ${UPLOADFILE}
else
echo "Skipping upload"
fi

0 comments on commit 2efced5

Please sign in to comment.