Skip to content

Commit

Permalink
recipes: Add clrng
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Jul 6, 2017
1 parent aacae4f commit 3d25cb8
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 0 deletions.
25 changes: 25 additions & 0 deletions recipes/clrng/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
mkdir build_release
cd build_release

if "%ARCH%" == "64" (
set BUILD64=ON
) else (
set BUILD64=OFF
)

cmake ^
-G "NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY="%LIBRARY_LIB%" ^
-DBUILD64="%BUILD64%" ^
-DSUFFIX_BIN="" ^
-DSUFFIX_LIB="" ^
-DBUILD_TEST=OFF ^
-DBUILD_KTEST=OFF ^
-DBUILD_CLIENT=OFF ^
-DOPENCL_ROOT="%LIBRARY_PREFIX%" ^
"%SRC_DIR%\src"
nmake
nmake install
26 changes: 26 additions & 0 deletions recipes/clrng/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

mkdir build_release
cd build_release


OPENCL_ROOT_FLAG="-DOPENCL_ROOT=${PREFIX}"
if [[ "`uname`" == "Darwin" ]] && [[ "${OSX_VARIANT}" == "native" ]]
then
OPENCL_ROOT_FLAG="";
fi

cmake \
-G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${PREFIX}" \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DSUFFIX_BIN="" \
-DSUFFIX_LIB="" \
-DBUILD_TEST=0 \
-DBUILD_KTEST=0 \
-DBUILD_CLIENT=0 \
"${OPENCL_ROOT_FLAG}" \
"${SRC_DIR}/src"
make
make install
77 changes: 77 additions & 0 deletions recipes/clrng/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{% set name = "clRNG" %}
{% set version = "1.0.0-beta" %}
{% set sha256 = "12e46c89a577ea26ea8af2b11176b1c503c2b0a28a3766178f317f21f27324f4" %}

{% set OSX_VARIANT = os.environ.get("OSX_VARIANT", "native") %}

package:
name: {{ name|lower }}
version: {{ version.replace("-", "").replace("beta", "b") }}

source:
fn: {{ name }}-{{ version }}.tar.gz
url: https://github.com/clMathLibraries/{{ name }}/archive/v{{ version }}.tar.gz
sha256: {{ sha256 }}

build:
number: 0
script_env:
- OSX_VARIANT

{% if OSX_VARIANT != "native" %}
skip: True # [not osx]
{% else %}
skip: True # [win and py35]
{% endif %}

features:
{% if OSX_VARIANT == "pocl" %}
- osx_pocl_opencl # [osx]
{% endif %}
- vc9 # [win and py27]
- vc10 # [win and py34]
- vc14 # [win and py35]
- vc14 # [win and py36]

requirements:
build:
- toolchain
- python # [win]
- cmake
- ocl-icd # [linux]
- khronos-opencl-icd-loader # [win]
{% if OSX_VARIANT == "pocl" %}
- osx-pocl-opencl # [osx]
- pocl >=0.14 # [unix]
{% endif %}

run:
- khronos-opencl-icd-loader # [win]
- ocl-icd # [linux]
{% if OSX_VARIANT == "pocl" %}
- osx-pocl-opencl # [osx]
- pocl >=0.14 # [unix]
{% endif %}

test:
requires:
- python {{ environ['PY_VER'] + '*' }} # [win]

commands:
# Check files
- test -f "${PREFIX}/include/clRNG.h" # [unix]
- test -f "${PREFIX}/lib/libclRNG.so" # [linux]
- test -f "${PREFIX}/lib/libclRNG.dylib" # [osx]
- if not exist %LIBRARY_INC%\\clRNG.h exit 1 # [win]
- if not exist %LIBRARY_BIN%\\clRNG.dll exit 1 # [win]
- if not exist %LIBRARY_LIB%\\clRNG.lib exit 1 # [win]

about:
home: https://github.com/clMathLibraries/{{ name }}
license: BSD 3-Clause
license_file: LICENSE
summary: A library for uniform random number generation in OpenCL

extra:
recipe-maintainers:
- jakirkham

0 comments on commit 3d25cb8

Please sign in to comment.