Skip to content

Commit

Permalink
ENH: use conda version of CUDA toolkit in build
Browse files Browse the repository at this point in the history
  • Loading branch information
kohr-h committed Sep 21, 2016
1 parent ece2cfe commit 242324c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 11 additions & 1 deletion conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,18 @@ fi
CUDA_ROOT=$PREFIX/lib/
BOOST_LIBRARY=$PREFIX/lib/libboost_python.so

# Fix: need .so files without version number for FindCUDA.cmake
cd $CUDA_ROOT
for lib in libcu*.so.*.[0-9]; do
# Replace *.so.* with *.so
ln -sf $lib $(echo $lib | sed 's/\(.*\.so\)\..*/\1/')
done

NUMPY_INCLUDE_DIR=$(python -c "from __future__ import print_function; import numpy; print(numpy.get_include())")

ODLCUDA_BUILDDIR=$SRC_DIR/build-py$PYTHON_VERSION
ODLCUDA_NUMPY_BUILDOPTS="-DPYTHON_NUMPY_INCLUDE_DIR=$PREFIX/lib/python$PYTHON_VERSION/site-packages/numpy/core/include"
#ODLCUDA_NUMPY_BUILDOPTS="-DPYTHON_NUMPY_INCLUDE_DIR=$PREFIX/lib/python$PYTHON_VERSION/site-packages/numpy/core/include"
ODLCUDA_NUMPY_BUILDOPTS="-DPYTHON_NUMPY_INCLUDE_DIR=$NUMPY_INCLUDE_DIR"
ODLCUDA_PYTHON_BUILDOPTS="-DPYTHON_EXECUTABLE=$PYTHON -DPYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR -DPYTHON_LIBRARY=$PYTHON_LIBRARY"
ODLCUDA_CUDA_BUILDOPTS="-DCUDA_TOOLKIT_ROOT_DIR=$CUDA_ROOT -DODL_CUDA_COMPUTE=$CUDA_COMPUTE -DCUDA_LIBRARIES=$CUDA_LIBRARIES"
ODLCUDA_BOOST_BUILDOPTS="-DBoost_PYTHON_LIBRARY_RELEASE=$BOOST_LIBRARY -DBoost_PYTHON_LIBRARY_DEBUG=$BOOST_LIBRARY"
Expand Down
12 changes: 5 additions & 7 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package:

source:
git_url: https://github.com/odlgroup/odlcuda.git
# TODO: this is for testing. Change to a version tag when done.
git_rev: conda-build

build:
Expand All @@ -19,7 +20,7 @@ requirements:
- future >=0.14
- cudatoolkit
- boost
# Make sure to run "conda config --append channels odlgroup"
# Make sure to run "conda config --append channels odlgroup" before building.
- odl >=0.3.0
# Compilers, needed for build only
- gcc <5 # [linux]
Expand All @@ -36,10 +37,10 @@ requirements:

test:
imports:
- odlcuda
- odl

requires:
- pytest
commands:
- python -c "import odl; odl.rn(5, impl='cuda').element()"

about:
home: https://github.com/odlgroup/odlcuda
Expand All @@ -51,6 +52,3 @@ extra:
maintainers:
- Jonas Adler (@adler-j)
- Holger Kohr (@kohr-h)
- Ozan Öktem (@ozanoktem)


0 comments on commit 242324c

Please sign in to comment.